Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
[Guide]New Habbo Protocol
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Adil" data-source="post: 143333" data-attributes="member: 3031"><p>Habbo Packets</p><p> </p><p>This is a quick overview, nothing special.</p><p> </p><p>As most of you guys may know, Sulake have fiddled with their protocol. However, though the protocol looks hard to understand, </p><p>it's main concept (of raw bytes) is actually easier to work with (if you know what you're doing). The new implementation is also </p><p>faster and as I've said, easier to grasp.</p><p>So... Down to business.</p><p> </p><p>4BYTES [INT, MSG LEN], 2BYTES [SHORT, MSG ID], 2BYTES [SHORT, STRLEN], STR</p><p> </p><p>Basically, what this means is:</p><p>4 bytes (2 bits) are used for the message length. For example, you could have 00 00 00 0f [15 in hexadecimal]</p><p>2 bytes (1 bit) are used for the message ID. E.g 0fa0 [4000 in hexadecimal]</p><p>2 bytes (1 bit) are used for the string length. E.g 0008 [8 in hexadecimal]</p><p> </p><p>00 00 00 0f //Packet length</p><p>0f a0 //Packet ID </p><p>00 08 //String length</p><p>lalacats //String</p><p> </p><p>This is a quick overview, there are other bits (like booleans) that aren't covered here.</p><p> </p><p>So.. Some code.</p><p>[PHP]</p><p>int msgLen = buffer.readInt(); //reads four bytes of the buffer</p><p>short msgId = buffer.readShort();</p><p>short strlen = buffer.readShort();</p><p>String msgString = buffer.readBytes( strlen );</p><p>[/PHP]</p><p> </p><p>This code will basically do the following:</p><p>>Read the message length as an integer.</p><p>>Read the message id as a short.</p><p>>Read the string length as a short.</p><p>>Read the bytes of the string, length specified by the string length.</p><p> </p><p> </p><p>Please leave any feedback here, thanks.</p><p></p><p>I will also be adding classes and files (Java, and C++(?) if I can find them!)</p></blockquote><p></p>
[QUOTE="Adil, post: 143333, member: 3031"] Habbo Packets This is a quick overview, nothing special. As most of you guys may know, Sulake have fiddled with their protocol. However, though the protocol looks hard to understand, it's main concept (of raw bytes) is actually easier to work with (if you know what you're doing). The new implementation is also faster and as I've said, easier to grasp. So... Down to business. 4BYTES [INT, MSG LEN], 2BYTES [SHORT, MSG ID], 2BYTES [SHORT, STRLEN], STR Basically, what this means is: 4 bytes (2 bits) are used for the message length. For example, you could have 00 00 00 0f [15 in hexadecimal] 2 bytes (1 bit) are used for the message ID. E.g 0fa0 [4000 in hexadecimal] 2 bytes (1 bit) are used for the string length. E.g 0008 [8 in hexadecimal] 00 00 00 0f //Packet length 0f a0 //Packet ID 00 08 //String length lalacats //String This is a quick overview, there are other bits (like booleans) that aren't covered here. So.. Some code. [PHP] int msgLen = buffer.readInt(); //reads four bytes of the buffer short msgId = buffer.readShort(); short strlen = buffer.readShort(); String msgString = buffer.readBytes( strlen ); [/PHP] This code will basically do the following: >Read the message length as an integer. >Read the message id as a short. >Read the string length as a short. >Read the bytes of the string, length specified by the string length. Please leave any feedback here, thanks. I will also be adding classes and files (Java, and C++(?) if I can find them!) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[Guide]New Habbo Protocol
Top