Thread: Map region not showing on login?

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11  
    Registered Member
    Join Date
    Dec 2009
    Age
    27
    Posts
    169
    Thanks given
    16
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by digistr View Post
    have you tried a client you know works? cuz that looks like a really old client.

    probably won't find one you like in downloads section but if it works you can at least know your problem isn't server side.
    I've tried multiple clients. Let me check Galkon's just for the hell of it. Nope, still get a T2 as well as a mismatch error. Debugged the server and it's not sending the map region for some reason. The coordinates are set at 3200, 3200, 0. I just want the land to show; walking can wait. There's an exception with every client so it must be an updating problem but I don't see any problem with it..

    EDIT: This could be part of the reason why it's messing up.

    [Only registered and activated users can see links. ]

    The start, finish and putBit methods are actually being bullshitted. They could have wrong variables in them but I'm not too sure. I've tried Netty a couple times before this and they all failed. The farthest I've gotten is where I am now.

    EDIT again: Debugged two servers. Mine and MythScape (wL). Seems like the bitPosition is messing up as well as the updating.. The BitSet flags are being empty since it's not receiving an update..
    [Only registered and activated users can see links. ]

    I am nerdier than 74% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and write on the nerd forum!

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #12  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Second idea.

    Comment out player updating so none of that happens

    if you still get t2 then your problem is where you login.

    you probably do something like

    for example for my server it's like this, still needs improvement but the bolded part should give you an idea of what i'm talking about for login.

    Code:
    	public static void queueLogins() {
    		PlayerDetails d = null;
    		while ((d = LOGINS.poll()) != null) {
    			Player player = new Player(d);
    			StaticPacketBuilder spb = new StaticPacketBuilder().setBare(true);
    			byte returnCode = (byte)FileManager.loadGame(player);
    			if (returnCode == 2)
    				returnCode = World.add(player);
    			if (returnCode != 2) {
    				spb.addByte(returnCode);
    				d.getSession().write(spb.toPacket());
    				d.getSession().close();
    				continue;
    			}
    			spb.addByte(2);
    			spb.addByte((byte) player.getRights());
    			spb.addByte((byte) 0);
    			spb.addShort(player.INDEX);
    			spb.addByte((byte) 1);
    			d.getSession().setAttachment(player);
    			d.getSession().write(spb.toPacket());
    			player.getActionSender().sendLogin();	
    		}
    	}
    Reply With Quote  
     

  3. #13  
    Registered Member
    Join Date
    Dec 2009
    Age
    27
    Posts
    169
    Thanks given
    16
    Thanks received
    3
    Rep Power
    11
    No errors when player updating is taken out. Here's what I get on the screen though:


    Difference now is that the message is being sent, "Welcome.". Also, it gets to the "Loading - please wait" part in packet 73. But just the map/land won't show. Do you have to have player updating in a 317 in order for the land around you to show? I'm thinking no but I could be wrong. My login class is basically the same as yours. It has the "player.getPacketSender().login();" right at the end. The login method contains the interface, message, skills, and map region showing. Only problem is, of course, the maps. The T2 error only showed with packet 81 which is player updating.
    [Only registered and activated users can see links. ]

    I am nerdier than 74% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and write on the nerd forum!

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #14  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Quote Originally Posted by Continue View Post
    No errors when player updating is taken out. Here's what I get on the screen though:


    Difference now is that the message is being sent, "Welcome.". Also, it gets to the "Loading - please wait" part in packet 73. But just the map/land won't show. Do you have to have player updating in a 317 in order for the land around you to show? I'm thinking no but I could be wrong. My login class is basically the same as yours. It has the "player.getPacketSender().login();" right at the end. The login method contains the interface, message, skills, and map region showing. Only problem is, of course, the maps. The T2 error only showed with packet 81 which is player updating.
    Hmm that picture is what your at without playerupdating?

    well my server is a 474 but when i remove player updating i get this.

    so post your login() method in the PacketSender class.

    Reply With Quote  
     

  5. #15  
    Banned
    Join Date
    Sep 2010
    Posts
    297
    Thanks given
    28
    Thanks received
    64
    Rep Power
    0
    The player must be updated in order for the region to show, I'm pretty sure... But I could be wrong.
    Reply With Quote  
     

  6. #16  
    Registered Member
    Join Date
    Dec 2009
    Age
    27
    Posts
    169
    Thanks given
    16
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by digistr View Post
    Hmm that picture is what your at without playerupdating?
    Yup. Could have changed from 317 to 474.

    Quote Originally Posted by digistr View Post
    well my server is a 474 but when i remove player updating i get this.

    so post your login() method in the PacketSender class.
    Login:
    Code:
    package com.emulation.net.codec;
    
    import java.security.SecureRandom;
    
    import org.jboss.netty.buffer.ChannelBuffer;
    import org.jboss.netty.channel.Channel;
    import org.jboss.netty.channel.ChannelHandlerContext;
    import org.jboss.netty.handler.codec.frame.FrameDecoder;
    
    import com.emulation.io.Session;
    import com.emulation.model.player.Player;
    import com.emulation.net.packet.PacketBuilder;
    import com.emulation.util.LoginUtility;
    import com.emulation.world.Location;
    import com.emulation.world.World;
    
    public class Login extends FrameDecoder {
    
    	private int loginSize;
    	private int encryptedSize;
    	private SecureRandom random = new SecureRandom();
    	private long serverKey = this.random.nextLong();
    	private static byte[] INITIAL_RESPONSE = new byte[] {
    		0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
    	};
    	private enum LoginState {
    		REQUEST, CONNECTION, CRYPTION;
    	}
    	LoginState loginState = LoginState.REQUEST;
    
    	@SuppressWarnings("unused")
    	@Override
    	protected Object decode(ChannelHandlerContext chc, Channel channel, ChannelBuffer
    			cb) throws Exception {
    		switch (this.loginState) {
    		case REQUEST:
    			if (cb.readableBytes() >= 2) {
    				int requestType = cb.readByte() & 0xFF;
    				if (requestType != 14) {
    					World.getWorld().getLogger().info("Request type was incorrect! Found: " + requestType);
    					return false;
    				}
    				int nameHash = cb.readByte() & 0xFF;
    				channel.write(new PacketBuilder().putBytes(Login.INITIAL_RESPONSE).putLong(this.serverKey).toPacket());
    				this.loginState = LoginState.CONNECTION;
    				return true;
    			}
    			break;
    		case CONNECTION:
    			if (cb.readableBytes() >= 2) {
    				int connectionType = cb.readByte() & 0xFF;
    				if ((connectionType != 16) && (connectionType != 18)) {
    					World.getWorld().getLogger().info("Connection type was incorrect! Found: " + connectionType);
    					return false;
    				}
    				this.loginSize = cb.readByte() & 0xFF;
    				this.encryptedSize = this.loginSize - 40;
    				if (this.encryptedSize <= 0) {
    					World.getWorld().getLogger().info("Encrypted size was incorrect! Found: " + this.encryptedSize);
    					return false;
    				}
    				this.loginState = LoginState.CRYPTION;
    				return true;
    			}
    			break;
    		case CRYPTION:
    			if (cb.readableBytes() >= this.loginSize) {
    				int magicCode = cb.readByte() & 0xFF;
    				if (magicCode != 255) {
    					World.getWorld().getLogger().info("Magic ID was incorrect! Found: " + magicCode);
    					return false;
    				}
    				int version = cb.readShort();
    				if (version != 317) {
    					World.getWorld().getLogger().info("Client's version was incorrect! Found: " + version);
    					return false;
    				}
    				int memory = cb.readByte();
    				if (memory != 0) {
    					World.getWorld().getLogger().info("Memory was incorrect! Found: " + memory);
    					return false;
    				}
    				for (int i = 0; i < 9; i++) {
    					cb.readInt();
    				}
    				this.encryptedSize--;
    				int rsaOpcode = cb.readByte() & 0xFF;
    				if (this.encryptedSize != rsaOpcode) {
    					World.getWorld().getLogger().info("Encrypted size was incorrect! Found: " + this.encryptedSize);
    					return false;
    				}
    				rsaOpcode = cb.readByte() & 0xFF;
    				if (rsaOpcode != 10) {
    					World.getWorld().getLogger().info("RSA was incorrect! Found: " + rsaOpcode);
    					return false;
    				}
    				long clientKey = cb.readLong();
    				long reportedKey = cb.readLong();
    				if (reportedKey != this.serverKey) {
    					World.getWorld().getLogger().info("Reported key was incorrect! Found: " + reportedKey);
    					return false;
    				}
    				int uid = cb.readInt();
    				String name = LoginUtility.readString(cb);
    				if (name.startsWith("\"")) {
    					name = name.substring(1);
    				}
    				if (name.equals("") || (name == null)) {
    					World.getWorld().getLogger().info("Name was incorrect! Found: " + name);
    					return false;
    				}
    				String pass = LoginUtility.readString(cb);
    				if (pass.equals("") || (pass == null)) {
    					World.getWorld().getLogger().info("Pass was incorrect! Found: " + pass);
    					return false;
    				}
    				World.getWorld().getLogger().info("Registering player: " + name);
    				Player player = new Player(new Session(channel));
    				player.setLocation(new Location(3200, 3200, 0));
    				player.setName(name);
    				player.setPass(pass);
    				player.setLastLocation(player.getLocation());
    				World.getWorld().registerPlayer(player);
    				channel.write(new PacketBuilder().putByte((byte) 2).putByte((byte) 0)
    						.putByte((byte) 0).toPacket());
    				World.getWorld().getLogger().info("Sending the packets to the client.");
    				/** Execution.getScheduledExecutorService().scheduleAtFixedRate(new
    						EntityUpdate(), 0, Constants.CYCLE_TIME, TimeUnit.MILLISECONDS); */
    				player.getPacketSender().login();
    				return true;
    			}
    			break;
    		}
    		return false;
    	}
    }
    PacketSender:
    Code:
    package com.emulation.net.packet;
    
    import com.emulation.model.player.Player;
    import com.emulation.net.packet.Packet.Type;
    
    public class PacketSender {
    
    	private Player player;
    
    	public PacketSender(Player player) {
    		this.player = player;
    	}
    
    	public PacketSender login() {
    		this.playerID().camera().interfaces().mapRegion().message("Welcome.");
    		return this;
    	}
    
    	public PacketSender playerID() {
    		this.player.write(new PacketBuilder(249).putByteA(1).putLEShortA(this.player
    				.getID()).toPacket());
    		return this;
    	}
    
    	public PacketSender camera() {
    		this.player.write(new PacketBuilder(107).toPacket());
    		return this;
    	}
    
    	public PacketSender interfaces() {
    		int[] interfaceOrder = { 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 0 };
    		int[] interfaces = {
    				3917, 638, 3213, 1644, 5608, 1151, 5065, 5715, 2449, 4445, 147, 6299,
    				2423
    		};
    		for (int i = 0; i < interfaceOrder.length; i++) {
    			this.player.write(new PacketBuilder(71).putShort(interfaces[i])
    					.putByteA(interfaceOrder[i]).toPacket());
    		}
    		return this;
    	}
    
    	public PacketSender message(String message) {
    		this.player.write(new PacketBuilder(253, Type.VARIABLE).putString(message)
    				.toPacket());
    		return this;
    	}
    
    	public PacketSender mapRegion() {
    		this.player.setLastLocation(this.player.getLocation());
    		this.player.write(new PacketBuilder(73).putShortA(this.player.getLocation()
    				.getRegionX() + 6).putShort(this.player.getLocation()
    						.getRegionY() + 6).toPacket());
    		return this;
    	}
    
    	public PacketSender logout() {
    		this.player.write(new PacketBuilder(109).toPacket());
    		return this;
    	}
    }
    [Only registered and activated users can see links. ]

    I am nerdier than 74% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and write on the nerd forum!

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #17  
    Banned

    Join Date
    Jan 2010
    Posts
    3,665
    Thanks given
    533
    Thanks received
    918
    Rep Power
    0
    I don't know what to tell you but I've never had this problem with higher revisions.
    Reply With Quote  
     

  8. #18  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Hmm..a

    Well i think to get past the loading please wait you need send packet 241 then 73.

    but i could be wrong. mostly im wondering where are you sending your z coordinate?

    because finding that should fix your issue. because i know for a fact when i did 317 and removed player updating i got maps loaded.
    Reply With Quote  
     

  9. #19  
    Registered Member
    Join Date
    Dec 2009
    Age
    27
    Posts
    169
    Thanks given
    16
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by digistr View Post
    Hmm..a

    Well i think to get past the loading please wait you need send packet 241 then 73.

    but i could be wrong. mostly im wondering where are you sending your z coordinate?

    because finding that should fix your issue. because i know for a fact when i did 317 and removed player updating i got maps loaded.
    What do you mean where's z? new Location(3200, 3200, 0); new Location(x, y, z); It's there. Packet 241? What is packet 241 anyway? I've never dealt with packet 241 at all; even on a winterLove based server, I've never used it, so I wouldn't know what's in it.
    [Only registered and activated users can see links. ]

    I am nerdier than 74% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and write on the nerd forum!

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #20  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    oh i was only guessing =\ cuz that thing u posted has 73 and 241.

    um but by "z" i meant where do you send your hieghtLevel aka "z" to the client?
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Construct map region packet aka 'secondary map region packet'
    By Graham in forum Informative Threads
    Replies: 95
    Last Post: 06-22-2015, 12:19 PM
  2. Replies: 3
    Last Post: 11-06-2010, 01:52 AM
  3. Replies: 50
    Last Post: 09-06-2010, 06:55 PM
  4. Lag in Region?
    By silabgarza in forum Help
    Replies: 6
    Last Post: 07-16-2010, 01:13 PM
  5. Region IDS
    By G0nzo in forum Requests
    Replies: 3
    Last Post: 11-01-2009, 08:23 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •