Thread: [Apollo] Packets and Packets lenght question

Results 1 to 3 of 3
  1. #1 [Apollo] Packets and Packets lenght question 
    Registered Member DarkSlayerz's Avatar
    Join Date
    Nov 2008
    Posts
    928
    Thanks given
    88
    Thanks received
    44
    Rep Power
    46
    Hi guys,

    ive got a question about packets,

    For example; a packet out of my client, case 176, the welcome screen, it looks something like this:

    Code:
    				case 176:
    					daysSinceRecovChange = inStream.method427();
    					unreadMessages = inStream.method435();
    					membersInt = inStream.readUnsignedByte();
    					anInt1193 = inStream.method440();
    					daysSinceLastLogin = inStream.readUnsignedWord();
    					if(anInt1193 != 0 && openInterfaceID == -1) {
    						signlink.dnslookup(TextClass.method586(anInt1193));
    						clearTopInterfaces();
    						char c = '\u028A';
    						if(daysSinceRecovChange != 201 || membersInt == 1)
    							c = '\u028F';
    						reportAbuseInput = "";
    						canMute = false;
    						for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
    							if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
    								continue;
    							openInterfaceID = RSInterface.interfaceCache[k9].parentID;
    							
    						}
    					}
    					pktType = -1;
    					return true;
    But if i want to change that, so it will only have one argument, readed by the server, can i do it like this?

    Code:
    				case 176:
    					int example = inStream.readUnsignedByte();
    					if(anInt1193 != 0 && openInterfaceID == -1) {
    						clearTopInterfaces();
    						char c = '\u028A';
    						if(daysSinceRecovChange != 201 || membersInt == 1)
    							c = '\u028F';
    						reportAbuseInput = "";
    						canMute = false;
    						for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
    							if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
    								continue;
    							openInterfaceID = example;
    							
    						}
    					}
    					pktType = -1;
    					return true;
    or do i have to change my packet lengths? and how?

    and heres server sided code:

    Code:
    package org.apollo.net.release.r317;
    
    import org.apollo.game.event.impl.OpenInterfaceSidebarEvent;
    import org.apollo.game.event.impl.OpenWelcomeScreenEvent;
    import org.apollo.net.codec.game.DataTransformation;
    import org.apollo.net.codec.game.DataType;
    import org.apollo.net.codec.game.GamePacket;
    import org.apollo.net.codec.game.GamePacketBuilder;
    import org.apollo.net.release.EventEncoder;
    
    /**
     * An {@link EventEncoder} for the {@link OpenInterfaceSidebarEvent}.
     * @author Graham
     */
    public final class OpenWelcomeScreenEventEncoder extends EventEncoder<OpenWelcomeScreenEvent> {
    
    	@Override
    	public GamePacket encode(OpenWelcomeScreenEvent event) {
    		GamePacketBuilder builder = new GamePacketBuilder(176);
                    builder.put(DataType.BYTE, event.getExampe());
    		return builder.toGamePacket();
    	}
    
    }
    please explain :c
    Reply With Quote  
     

  2. #2  
    Ain't Messin' Around - Gary Clark Jr.

    Wolfs Darker's Avatar
    Join Date
    Jul 2012
    Posts
    1,542
    Thanks given
    598
    Thanks received
    464
    Rep Power
    252
    Source Part:

    Code:
    @Override
    	public GamePacket encode(OpenWelcomeScreenEvent event) {
    		GamePacketBuilder builder = new GamePacketBuilder(176);
                    builder.writeByte(event.getExampe());
    		return builder.toGamePacket();
    	}
    Client:

    int example = stream.readUnsignedByte();
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member DarkSlayerz's Avatar
    Join Date
    Nov 2008
    Posts
    928
    Thanks given
    88
    Thanks received
    44
    Rep Power
    46
    Quote Originally Posted by wolfs darker View Post
    Source Part:

    Code:
    @Override
    	public GamePacket encode(OpenWelcomeScreenEvent event) {
    		GamePacketBuilder builder = new GamePacketBuilder(176);
                    builder.writeByte(event.getExampe());
    		return builder.toGamePacket();
    	}
    Client:

    int example = stream.readUnsignedByte();
    Yeah, i tryed that.

    But then im getting a T1 error. Ive heard i has to change the packet sizes aswell? But how?
    Reply With Quote  
     


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. 531 deob and packet printer v1
    By Martin in forum Downloads
    Replies: 42
    Last Post: 02-15-2009, 04:17 AM
  2. [530] Some mapdata and packets.
    By Simon in forum Downloads
    Replies: 2
    Last Post: 02-02-2009, 03:51 PM
  3. Replies: 18
    Last Post: 01-06-2009, 05:57 PM
  4. 521 deob with mapdata and packet logging!!!!
    By Clienthax in forum Downloads
    Replies: 22
    Last Post: 11-21-2008, 03:20 AM
  5. Understanding Packets and Unhandled Packets
    By Vastiko in forum Tutorials
    Replies: 10
    Last Post: 09-27-2008, 06:46 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
  •