Thread: Packets example

Results 1 to 5 of 5
  1. #1 Packets example 
    https://podcaster.one


    Join Date
    Nov 2012
    Posts
    522
    Thanks given
    193
    Thanks received
    83
    Rep Power
    97
    Base PI

    Can someone give me an EXACT example of how to send a String over a new/custom packet?(Server -> Client)

    For example

    Code:
    stream.createFrame(55); //55 is an example, don't tell me it has already been used. XD
    stream.writeString("does not work");
    results in a bunch of errors.

    (probably because of the size or something, I don't know how to do it)

    Thanks.
    Thanks,
    DharmeshPHP.

    Co-founder and Full Stack Web Dev
    https://podcaster.one
    Attached image

    Click to view our Project Thread! ^
    Reply With Quote  
     

  2. #2  
    Member
    Join Date
    Sep 2012
    Age
    27
    Posts
    172
    Thanks given
    22
    Thanks received
    7
    Rep Power
    0
    I don't know if this is what you mean but, like.

    stream.createFrame(185);
    stream.writeWord(100);

    would click the button 100. Sorry if this is not what you wanted to know

    but for a list of packets: http://www.rune-server.org/runescape...cket-list.html
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    https://podcaster.one


    Join Date
    Nov 2012
    Posts
    522
    Thanks given
    193
    Thanks received
    83
    Rep Power
    97
    I really appreciate your help. But what I'm trying to do is send a string over a new customized packet.
    Thanks,
    DharmeshPHP.

    Co-founder and Full Stack Web Dev
    https://podcaster.one
    Attached image

    Click to view our Project Thread! ^
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,097
    Thanks given
    140
    Thanks received
    564
    Rep Power
    2918
    Aw, seeking for help again you retard?
    Reply With Quote  
     

  6. #5  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Both the client and server have an array containing the sizes of the incoming packets.
    This array contains the size in bytes of the packet with the index in the array as opcode (packet number).
    With the exception of -1 and -2.
    -1 means a variable size packet where the size can be written as a byte (0-255).
    -2 means a variable size packet where the size can be written as 2 bytes, a short (0-65535).

    For your custom packet you'll have to add this size.
    If you're sending a string, the size will most likely be variable in 1 byte: size -1.

    The sending of the packet happens as you've given the example (but don't forget to write the stream to the session if your server doesn't do so automatically, look at other packets).
    The reading happens in a similar way as you can see happening in the client.
    Don't forget to set the packetSize variable back to -1 and return the correct value.

    This thread may be for the 474 protocol, but the information on packets is still correct.
    Give it a quick read if you want:
    Posts 2, 3 and partially 4: http://www.rune-server.org/runescape...-protocol.html
    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. Replies: 17
    Last Post: 11-28-2008, 08:54 AM
  2. Packet 130 - Close Window
    By Runite in forum Tutorials
    Replies: 15
    Last Post: 08-23-2007, 04:23 PM
  3. Packet 61 - Icons in bottom corner
    By Blazefire in forum Tutorials
    Replies: 6
    Last Post: 08-15-2007, 05:09 PM
  4. Packet sizes fix
    By Diablo1123 in forum Tutorials
    Replies: 9
    Last Post: 08-13-2007, 10:25 PM
  5. Packet 36 - Interface button Status
    By uber killer in forum Tutorials
    Replies: 9
    Last Post: 07-31-2007, 04:33 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
  •