RSWiki https://rswiki.moparisthebest.com/index.php?title=Main_Page MediaWiki 1.19.2 first-letter Media Special Talk User User talk RSWiki RSWiki talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Main Page 0 1 4ekt8vw9ti0lmgilborq9q0ubtp396e 1 2011-06-15T02:39:50Z MediaWiki default 0 '''MediaWiki has been successfully installed.''' Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software. == Getting started == * [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list] * [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ] * [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list] 2 2011-06-15T03:22:00Z Admin 1 /* Getting started */ '''MediaWiki has been successfully installed.''' Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software. == Welcome == * [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list] * [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ] * [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list] 3 2011-06-15T03:24:14Z Admin 1 '''Welcome to RSWiki''' Our goal is to accurately document the rs2 protocol(s). == Useful links: == * [Protocol Documentation] * ''More to come...'' 4 2011-06-15T03:24:33Z Admin 1 '''Welcome to RSWiki''' ---- Our goal is to accurately document the rs2 protocol(s). == Useful links: == * [Protocol Documentation] * ''More to come...'' 5 2011-06-15T03:25:13Z Admin 1 '''Welcome to RSWiki''', our goal is to accurately document the rs2 protocol(s). == Useful links: == * [Protocol Documentation] * ''More to come...'' 6 2011-06-15T03:25:28Z Admin 1 /* Useful links: */ '''Welcome to RSWiki''', our goal is to accurately document the rs2 protocol(s). == Useful links: == * ''More to come...'' 7 2011-06-15T03:25:45Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rs2 protocol(s). == Useful links: == * ''More to come...'' 8 2011-06-15T03:34:49Z Admin 1 Protected "[[Main Page]]": High traffic page ([edit=sysop] (indefinite) [move=sysop] (indefinite)) Welcome to '''RSWiki''', our goal is to accurately document the rs2 protocol(s). == Useful links: == * ''More to come...'' 15 2011-06-15T03:47:27Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rs2 protocol(s) and much more. == Useful links: == * ''More to come...'' 54 2011-06-18T04:27:54Z Admin 1 /* Useful links: */ Welcome to '''RSWiki''', our goal is to accurately document the rs2 protocol(s) and much more. == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * ''More to come...'' 62 2011-06-18T04:57:55Z Admin 1 /* Useful links: */ Welcome to '''RSWiki''', our goal is to accurately document the rs2 protocol(s) and much more. == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * [http://rswiki.gyrat.in/index.php?title=Category:RS2] RS2 Documentation * [http://rswiki.gyrat.in/index.php?title=Category:RSC] RSC Documentation * ''More to come...'' 64 2011-06-18T05:00:29Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the ''Articles that need contributions'' in the useful links to contribute! == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * [http://rswiki.gyrat.in/index.php?title=Category:RS2] RS2 Documentation * [http://rswiki.gyrat.in/index.php?title=Category:RSC] RSC Documentation * ''More to come...'' 65 2011-06-18T05:02:01Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the ''Articles that need contributions'' in the useful links to contribute! == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * [[title=Category:Crappy_articles]] * [http://rswiki.gyrat.in/index.php?title=Category:RS2] RS2 Documentation * [http://rswiki.gyrat.in/index.php?title=Category:RSC] RSC Documentation * ''More to come...'' 66 2011-06-18T05:03:24Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the ''Articles that need contributions'' in the useful links to contribute! == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * [http://rswiki.gyrat.in/index.php?title=Category:RS2] RS2 Documentation * [http://rswiki.gyrat.in/index.php?title=Category:RSC] RSC Documentation * ''More to come...'' 67 2011-06-18T05:04:07Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>Articles that need contributions</u> in the useful links to contribute! == Useful links: == * [http://rswiki.gyrat.in/index.php?title=Category:Crappy_articles]Articles that need contributions. * [http://rswiki.gyrat.in/index.php?title=Category:RS2] RS2 Documentation * [http://rswiki.gyrat.in/index.php?title=Category:RSC] RSC Documentation * ''More to come...'' 129 2011-06-20T04:58:08Z Admin 1 /* Useful links: */ Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>Articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * ''More to come...'' 130 2011-06-20T04:58:31Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * ''More to come...'' 131 2011-06-20T04:59:32Z Admin 1 /* Useful links: */ Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[Category:RSC|RSC Documentation]] * [[Category:RS2|RS2 Documentation]] * ''More to come...'' 132 2011-06-20T05:00:58Z Admin 1 /* Useful links: */ Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * ''More to come...'' 227 2011-06-26T18:14:39Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB|JAGGRAB Protocol]] * [[:Category:Ondemand|Ondemand Protocol]] * ''More to come...'' 228 2011-06-26T18:15:04Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * ''More to come...'' 231 2011-06-26T18:17:23Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Category:Archive Format|Archive Format]] * [[:Category:Archive Format|Archive Format]] * [[:Category:Archive Format|Archive Format]] * ''More to come...'' 234 2011-06-26T18:21:38Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Category:Data Types|Data Types]] * ''More to come...'' 235 2011-06-26T18:23:27Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Category:Data_Types|Data_Types]] * ''More to come...'' 236 2011-06-26T18:24:01Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[RSWiki:Community portal|All main articles (many need contributions, especially red links)]] * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * ''More to come...'' 237 2011-06-26T18:25:46Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * ''More to come...'' 244 2011-07-11T03:38:29Z Admin 1 Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more. Please check out the <u>articles that need contributions</u> in the useful links to contribute! == Useful links: == * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * [[:DMCA_Policy|DMCA Policy]] * ''More to come...'' 267 2011-07-14T00:59:01Z Admin 1 <center> Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more! Want to meet the community? Check out our [[:RSWiki_IRC|Official IRC]]! </center> == Useful links: == * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * [[:DMCA_Policy|DMCA Policy]] * ''More to come...'' 273 2011-07-15T17:13:14Z Admin 1 <center> Welcome to '''RSWiki''', our goal is to accurately document the rsc/rs2 protocol(s) and much more! Read the [[:Rules]], you may be sorry. Want to meet the community? Check out our [[:RSWiki_IRC|Official IRC]]! </center> == Useful links: == * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * [[:DMCA_Policy|DMCA Policy]] * ''More to come...'' 274 2011-07-15T17:23:12Z Admin 1 <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki,</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} == Useful links: == * [[:Category:RSC|RSC Documentation]] * [[:Category:RS2|RS2 Documentation]] * [[:Category:JAGGRAB Protocol|JAGGRAB Protocol]] * [[:Category:Ondemand Protocol|Ondemand Protocol]] * [[:Category:Archive Format|Archive Format]] * [[:Data Types|Data Types]] * [[:DMCA_Policy|DMCA Policy]] * ''More to come...'' 275 2011-07-15T17:45:53Z Admin 1 /* Useful links: */ <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki,</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} {| cellspacing="0" cellpadding="0" style="margin:0 0 1em; width:100%" | style="width:50%; vertical-align:top; border:1px solid #fad67d; background-color:#faf6ed;" | <div style="border-bottom:1px solid #fad67d; background-color:#faecc8; padding:0.2em 0.5em; font-size:110%;">'''Game Protocol'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Category:RSC|RSC Documentation]] The first public game play that was soon replaced by RS2 after the RS2 Beta. (2001 - 2004) * [[:Category:RS2|RS2 Documentation]] The current game play available to all users. (2004 - present) </div> | style="padding:0 0.5em;" | | style="width:50%; vertical-align:top; border:1px solid #abd5f5; background-color:#f1f5fc;" | <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Cache Documentation'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Category:JAGGRAB Protocol|JAGGRAB Documentation]] * [[:Category:Ondemand Protocol|Ondemand Documentation]] * [[:Category:Archive Format|Archive Format Documentation]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Data Types'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Data Types|Custom Data Types]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Miscellaneous'''</div> <div style="padding:0.4em 1em 0.3em;"> * More to come... </div> |} 276 2011-07-15T17:48:21Z Admin 1 <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} {| cellspacing="0" cellpadding="0" style="margin:0 0 1em; width:100%" | style="width:50%; vertical-align:top; border:1px solid #fad67d; background-color:#faf6ed;" | <div style="border-bottom:1px solid #fad67d; background-color:#faecc8; padding:0.2em 0.5em; font-size:110%;">'''Game Protocol'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Category:RSC|RSC Documentation]] The first public game play that was soon replaced by RS2 after the RS2 Beta. (2001 - 2004) * [[:Category:RS2|RS2 Documentation]] The current game play available to all users. (2004 - present) </div> | style="padding:0 0.5em;" | | style="width:50%; vertical-align:top; border:1px solid #abd5f5; background-color:#f1f5fc;" | <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Cache Documentation'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Category:JAGGRAB Protocol|JAGGRAB Documentation]] * [[:Category:Ondemand Protocol|Ondemand Documentation]] * [[:Category:Archive Format|Archive Format Documentation]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Data Types'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Data Types|Custom Data Types]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Miscellaneous'''</div> <div style="padding:0.4em 1em 0.3em;"> * More to come... </div> |} 289 2011-07-19T16:57:31Z Admin 1 <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} {| cellspacing="0" cellpadding="0" style="margin:0 0 1em; width:100%" | style="width:50%; vertical-align:top; border:1px solid #fad67d; background-color:#faf6ed;" | <div style="border-bottom:1px solid #fad67d; background-color:#faecc8; padding:0.2em 0.5em; font-size:110%;">'''Game Protocol'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Category:RSC|RSC Documentation]] The first public game play that was soon replaced by RS2 after the RS2 Beta. (2001 - 2004) * [[:Category:RS2|RS2 Documentation]] The current game play available to all users. (2004 - present) </div> | style="padding:0 0.5em;" | | style="width:50%; vertical-align:top; border:1px solid #abd5f5; background-color:#f1f5fc;" | <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Cache Documentation'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Category:JAGGRAB Protocol|JAGGRAB Documentation]] * [[:Category:Ondemand Protocol|Ondemand Documentation]] * [[:Category:Archive Format|Archive Format Documentation]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Data Types'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Data Types|Custom Data Types]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Miscellaneous'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Map Region System]] * More to come... </div> |} 592 2012-08-28T02:29:52Z Jmood 88 <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} {| cellspacing="0" cellpadding="0" style="margin:0 0 1em; width:100%" | style="width:50%; vertical-align:top; border:1px solid #fad67d; background-color:#faf6ed;" | <div style="border-bottom:1px solid #fad67d; background-color:#faecc8; padding:0.2em 0.5em; font-size:110%;">'''Game Protocol'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Category:RSC|RSC Documentation]] The first public game play that was soon replaced by RS2 after the RS2 Beta. (2001 - 2004) * [[:Category:RS2|RS2 Documentation]] The current game play available to all users. (2004 - present) </div> | style="padding:0 0.5em;" | | style="width:50%; vertical-align:top; border:1px solid #abd5f5; background-color:#f1f5fc;" | <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''[[:Category:Cache|Cache Documentation]]'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[JAGGRAB_Protocol|JAGGRAB Documentation]] * [[Ondemand_Protocol|Ondemand Documentation]] * [[Archive_Format|Archive Format Documentation]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Data Types'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Data Types|Custom Data Types]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Miscellaneous'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Map Region System]] * More to come... </div> |} 903 2013-10-17T01:33:53Z Jmood 88 <!--------------------------------------Main heading-----------------------------------------> {| id="mainpage-welcome-box" style="width:100%; background:#f6f6f6; border:1px solid #ccc;" | style="width:61%; text-align:center; white-space:nowrap; color:#000;" | <div style="font-size:150%; border:none; margin:0; padding:.1em; color:#000;">Welcome to RSWiki</div> <div style="top:+0.2em; font-size:90%;">Our goal is to accurately document the rsc/rs2 protocol(s) and much more!</div> | style="width:13%;" | '''[[:Rules]]'''<br /> '''[[:DMCA_Policy|DMCA Policy]]''' | style="width:13%;" | '''[[:RSWiki:General_disclaimer|Disclaimer]]'''<br /> '''[[:RSWiki:Privacy_policy|Privacy Policy]]''' | style="width:13%;" | '''[[:RSWiki_IRC|Official IRC]]'''<br /> '''[[:RSWiki:About|About RSWiki]]''' |} {| cellspacing="0" cellpadding="0" style="margin:0 0 1em; width:100%" | style="width:50%; vertical-align:top; border:1px solid #fad67d; background-color:#faf6ed;" | <div style="border-bottom:1px solid #fad67d; background-color:#faecc8; padding:0.2em 0.5em; font-size:110%;">'''Game Protocol'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Category:RSC|RSC Documentation]] The first public game play that was soon replaced by RS2 after the RS2 Beta. (2001 - 2004) * [[:Category:RS2|RS2 Documentation]] The second major overhaul of the game. (2004 - 2013) * [[:Category:RS3|RS3 Documentation]] The current game play available to all users. (2013 - present) </div> | style="padding:0 0.5em;" | | style="width:50%; vertical-align:top; border:1px solid #abd5f5; background-color:#f1f5fc;" | <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''[[:Category:Cache|Cache Documentation]]'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[JAGGRAB_Protocol|JAGGRAB Documentation]] * [[Ondemand_Protocol|Ondemand Documentation]] * [[Archive_Format|Archive Format Documentation]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Data Types'''</div> <div style="border-bottom:1px solid #abd5f5; padding:0.4em 1em 0.3em;"> * [[:Data Types|Custom Data Types]] </div> <div style="border-bottom:1px solid #abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em; font-size:110%;">'''Miscellaneous'''</div> <div style="padding:0.4em 1em 0.3em;"> * [[:Map Region System]] * More to come... </div> |} Rules 0 117 t8i864rpe16hevpqzah1jmouoelbe84 271 2011-07-15T17:12:14Z Admin 1 Created page with "== '''Simple Rules''' == === '''Vandalism''' === Obviously, we do not allow vandalism of any kind - users (or IP Addresses) found in violation of this rule will find them self ..." == '''Simple Rules''' == === '''Vandalism''' === Obviously, we do not allow vandalism of any kind - users (or IP Addresses) found in violation of this rule will find them self with a nice IP ban. === '''Advertising''' === Attempting to advertise other sites outside of the wiki that do not provide educational benefits is strictly prohibited. === '''Download Links/Uploads''' === Any link or upload that contains copywrited material (ex: a client revision or cache archive) is strictly prohibited and will be removed along with a punishment for the user; this is your only warning. === '''Posting Unreliable Information''' === The wiki is an education resource, so posting misinformed information is not optimal for learning - please avoid this. 272 2011-07-15T17:12:20Z Admin 1 Protected "[[Rules]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) == '''Simple Rules''' == === '''Vandalism''' === Obviously, we do not allow vandalism of any kind - users (or IP Addresses) found in violation of this rule will find them self with a nice IP ban. === '''Advertising''' === Attempting to advertise other sites outside of the wiki that do not provide educational benefits is strictly prohibited. === '''Download Links/Uploads''' === Any link or upload that contains copywrited material (ex: a client revision or cache archive) is strictly prohibited and will be removed along with a punishment for the user; this is your only warning. === '''Posting Unreliable Information''' === The wiki is an education resource, so posting misinformed information is not optimal for learning - please avoid this. 310 2011-10-07T21:16:32Z Admin 1 == '''Simple Rules''' == === '''Vandalism''' === Obviously, we do not allow vandalism of any kind - users (or IP Addresses) found in violation of this rule will find them self with a nice IP ban. === '''Advertising''' === Attempting to advertise other sites outside of the wiki that do not provide educational benefits is strictly prohibited. === '''Download Links/Uploads''' === Any link or upload that contains copywrited material (ex: a client revision or cache archive) is strictly prohibited and will be removed along with a punishment for the user; this is your only warning. === '''Posting Unreliable Information''' === The wiki is an education resource, so posting misinformed information is not optimal for learning - please avoid this. This includes edits with unclear explanations or bad information. === '''Proprietary Code'''=== No server-specific code, only easily interpretable pseudo-code. 311 2011-10-07T21:16:38Z Admin 1 == '''Simple Rules''' == === '''Vandalism''' === Obviously, we do not allow vandalism of any kind - users (or IP Addresses) found in violation of this rule will find them self with a nice IP ban. === '''Advertising''' === Attempting to advertise other sites outside of the wiki that do not provide educational benefits is strictly prohibited. === '''Download Links/Uploads''' === Any link or upload that contains copywrited material (ex: a client revision or cache archive) is strictly prohibited and will be removed along with a punishment for the user; this is your only warning. === '''Posting Unreliable Information''' === The wiki is an education resource, so posting misinformed information is not optimal for learning - please avoid this. This includes edits with unclear explanations or bad information. === '''Proprietary Code'''=== No server-specific code, only easily interpretable pseudo-code. DMCA Policy 0 113 7audtkuvvhft5p3q0w3q6mabcmskdw6 242 2011-07-11T03:38:02Z Admin 1 Created page with "If you find something on this wiki page that infringes on your intellectual rights, contact: rswiki[at]gyrat.in to ask for the content's removal." If you find something on this wiki page that infringes on your intellectual rights, contact: rswiki[at]gyrat.in to ask for the content's removal. 243 2011-07-11T03:38:08Z Admin 1 Protected "[[DMCA Policy]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) If you find something on this wiki page that infringes on your intellectual rights, contact: rswiki[at]gyrat.in to ask for the content's removal. 309 2011-10-07T21:11:55Z Admin 1 If you find something on this wiki page that infringes on your intellectual rights, contact: admin[at]moparisthebest.com to ask for the content's removal. RSWiki:General disclaimer 4 4 pqzz00jm6qlzho0xxsr6jjtf7nvjcd1 13 2011-06-15T03:46:56Z Admin 1 Created page with "All information provided on this wiki is provided AS IS and contains NO WARRANTY. All information provided is for pure educational purposes only." All information provided on this wiki is provided AS IS and contains NO WARRANTY. All information provided is for pure educational purposes only. 14 2011-06-15T03:47:05Z Admin 1 Protected "[[RSWiki:General disclaimer]]": High traffic page ([edit=sysop] (indefinite) [move=sysop] (indefinite)) All information provided on this wiki is provided AS IS and contains NO WARRANTY. All information provided is for pure educational purposes only. RSWiki:Privacy policy 4 3 dpm3y5jf196ox8q6ke7jk5ot4jyscv1 11 2011-06-15T03:45:36Z Admin 1 Created page with "<!-- START PRIVACY POLICY CODE --><div style="font-family:arial"><strong>What information do we collect?</strong> <br /><br />We collect information from you when you register on..." <!-- START PRIVACY POLICY CODE --><div style="font-family:arial"><strong>What information do we collect?</strong> <br /><br />We collect information from you when you register on our site or information posted on our site. <br /><br />When ordering or registering on our site, as appropriate, you may be asked to enter your: e-mail address. You may, however, visit our site anonymously.<br /><br /><strong>What do we use your information for?</strong> <br /><br />Any of the information we collect from you may be used to improve customer service (your information helps us to more effectively respond to your customer service requests and support needs)<br /><br /><strong>How do we protect your information?</strong> <br /><br />We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information. <br /><br /><strong>Do we use cookies?</strong> <br /><br />Yes (Cookies are small files that a site or its service provider transfers to your computers hard drive through your Web browser (if you allow) that enables the sites or service providers systems to recognize your browser and capture and remember certain information<br /><br /> We use cookies to compile aggregate data about site traffic and site interaction so that we can offer better site experiences and tools in the future.<br /><br /><strong>Do we disclose any information to outside parties?</strong> <br /><br />We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.<br /><br /> 12 2011-06-15T03:45:44Z Admin 1 Protected "[[RSWiki:Privacy policy]]": High traffic page ([edit=sysop] (indefinite) [move=sysop] (indefinite)) <!-- START PRIVACY POLICY CODE --><div style="font-family:arial"><strong>What information do we collect?</strong> <br /><br />We collect information from you when you register on our site or information posted on our site. <br /><br />When ordering or registering on our site, as appropriate, you may be asked to enter your: e-mail address. You may, however, visit our site anonymously.<br /><br /><strong>What do we use your information for?</strong> <br /><br />Any of the information we collect from you may be used to improve customer service (your information helps us to more effectively respond to your customer service requests and support needs)<br /><br /><strong>How do we protect your information?</strong> <br /><br />We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information. <br /><br /><strong>Do we use cookies?</strong> <br /><br />Yes (Cookies are small files that a site or its service provider transfers to your computers hard drive through your Web browser (if you allow) that enables the sites or service providers systems to recognize your browser and capture and remember certain information<br /><br /> We use cookies to compile aggregate data about site traffic and site interaction so that we can offer better site experiences and tools in the future.<br /><br /><strong>Do we disclose any information to outside parties?</strong> <br /><br />We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.<br /><br /> RSWiki IRC 0 116 3rgithd4de0kjacgs9h28bjalg60phz 262 2011-07-14T00:46:36Z Admin 1 Created page with "Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == == '''How To Guide (New Users)''' ==" Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == == '''How To Guide (New Users)''' == 263 2011-07-14T00:53:52Z Admin 1 Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== #303 == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 264 2011-07-14T00:54:05Z Admin 1 /* IRC Clients */ Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== #303 == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 265 2011-07-14T00:57:00Z Admin 1 Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== <nowiki>#303 </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 266 2011-07-14T00:57:06Z Admin 1 /* IRC Server(s) */ Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== <nowiki>#303 </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 268 2011-07-14T01:05:39Z Admin 1 Protected "[[RSWiki IRC]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== <nowiki>#303 </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 290 2011-07-28T16:45:16Z Admin 1 Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.gyrat.in irc.thehost.me ===Channel(s)=== <nowiki>#RSWiki </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 326 2011-10-26T20:15:27Z Admin 1 /* IRC Server(s) */ Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.moparisthebest.com ===Channel(s)=== <nowiki>#RSWiki </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] 327 2011-10-26T20:15:51Z Admin 1 /* Channel(s) */ Want to chat with RSWiki members? Discuss anything and everything? Join our IRC network! == '''Connection Information''' == ===IRC Server(s)=== irc.moparisthebest.com ===Channel(s)=== <nowiki>#mopar / #moparscape </nowiki> == '''How To Guide (New Users)''' == ===Important commands=== ====Register your nickname==== /msg nickserv register YourPassword YourEmail ====Identifying Yourself==== /msg nickserv identify YourPassword ====Joining a channel==== /join #channelname ===IRC Clients=== [http://www.mirc.com/get.html mIRC] [http://xchat.org/download/ X-Chat] [http://irssi.org/download irssi] RSWiki:About 4 2 9662affkkbtch3p8tzn5qddywyul3gf 9 2011-06-15T03:36:55Z Admin 1 Created page with "''Coming soon...''" ''Coming soon...'' 10 2011-06-15T03:37:06Z Admin 1 Protected "[[RSWiki:About]]": High traffic page ([edit=sysop] (indefinite) [move=sysop] (indefinite)) ''Coming soon...'' 277 2011-07-15T17:58:28Z Admin 1 Many of you may recall Graham and Blakeman's runewiki project - it contained very useful information about numerous client revision protocols and other resources. Unfortunately, the wiki and any backups of the database have been lost for over two years now (and there are no cached copies floating around). Because of this, we've decided (and have started) embarking on the journey of re-creating the wiki. In regards to the aforementioned, we are now releasing the wiki to the public. Captcha has been added to the wiki to prevent abuse; and of course, backups have (and are continuously) being made of the database. Currently, the majority of the information covered is based on the '''#317''' Protocol, '''JAGGRAB''' Protocol, '''Ondemand''' Protocol, '''Cache Archive Format''', '''RS Data Types''', and '''#202''' Protocol. The format of the wiki is fairly laid out, so it will be quite easy to expand on certain topics. If anyone has any information on the other commonly used client revisions (or perhaps a new one) feel free to contribute. RSWiki is hosted and maintained by the [http://moparisthebest.com moparisthebest] community. Category:RSC 14 18 sq5a6b76ht32wsvso6bytjtzsvnl43e 53 2011-06-18T04:26:48Z Admin 1 Created page with "This page will display any information regarding RSC." This page will display any information regarding RSC. 117 2011-06-20T04:52:13Z Admin 1 This page will display any information regarding RSC. == RSC #202 == * [[202 Protocol]] * [[204 Items|202 Items]] * [[204 NPCs|202 NPCs]] * [[204 Objects|202 Objects]] == RSC #203/#204 == * [[204 Protocol]] * [[204 Items]] * [[204 NPCs]] * [[204 Objects]] 118 2011-06-20T04:52:36Z Admin 1 This page will display any information regarding RSC. 135 Protocol 0 217 ab1t1dmm05eiyt60v2frk1wrhsnuxcg 712 2012-11-07T13:54:36Z Protocol 120 Created page with "[[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> ..." [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn packet-logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 27 (defn remove-from-friends-list [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 713 2012-11-07T14:52:56Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 27 (defn remove-from-friends-list [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 714 2012-11-07T22:16:38Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 715 2012-11-08T15:51:40Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 716 2012-11-08T15:53:03Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 717 2012-11-08T16:05:41Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 720 2012-11-08T16:54:12Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td>Test</td> <td>Test</td> <td>Test</td> <td>Test</td> </tr> </table> 721 2012-11-08T16:55:00Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 722 2012-11-08T16:56:46Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> <table border="1" cellpadding="3" cellspacing="3"> {| class="wikitable" style="text-align:center; width:200px; height:200px;" |+ Multiplication table |- ! × ! 1 ! 2 ! 3 |- ! 1 | 1 || 2 || 3 |- ! 2 | 2 || 4 || 6 |- ! 3 | 3 || 6 || 9 |- ! 4 | 4 || 8 || 12 |- ! 5 | 5 || 10 || 15 |} </table> 723 2012-11-08T17:01:18Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" style="text-align:center; width:200px; height:200px;" |+ Outgoing Packets |- ! Name ! Opcode ! Payload |- ! Add User to Friends List | 26 || * Long - Long represenation of username |} 724 2012-11-08T17:05:17Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" style="text-align:center; width:200px; height:200px;" |+ Outgoing Packets |- ! Name ! Opcode ! Payload |- ! Newplayer (Registration) | 2 || * Short - unknown * Long - long represenation of username * Short - referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - password, server session ID, bigintegers ! Add User to Friends List | 26 || * Long - long represenation of username |} 725 2012-11-08T17:05:53Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" style="text-align:center; width:200px; height:200px;" |+ Outgoing Packets |- ! Name ! Opcode ! Payload |- ! Newplayer (Registration) | 2 || * Short - unknown * Long - long represenation of username * Short - referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - password, server session ID, bigintegers |- ! Add User to Friends List | 26 || * Long - long represenation of username |} 726 2012-11-08T17:08:49Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" style="text-align:center; width:200px; height:200px;" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - unknown * Long - long represenation of username * Short - referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * | Sends the logout packet to the server |- ! Add User to Friends List | 26 || * Long - long represenation of username | Adds a user to your friends list |} 727 2012-11-08T17:10:49Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-pacet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - unknown * Long - long represenation of username * Short - referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Add User to Friends List | 26 || * Long - long represenation of username | Adds a user to your friends list |} 728 2012-11-08T17:46:13Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - unknown * Long - long represenation of username * Short - referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Add User to Friends List | 26 || * Long - long represenation of username | Adds a user to your friends list |} 729 2012-11-08T17:51:37Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/name-for-long username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 730 2012-11-08T17:55:34Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? =='''Reference'''== A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.135.packets (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 731 2012-11-08T17:58:29Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? =='''Reference'''== A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Incoming Data''' == '''TODO:''' <pre> </pre> == '''Outgoing Data''' == <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 732 2012-11-08T18:00:57Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 733 2012-11-08T18:03:07Z Protocol 120 /* Login */ [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == (The login protocol documentation is currently a work in progress. Below you will find a partially refactored version of the login method found in the 135 client.) <pre> try { username = user; user = jagex.Util.formatString(user, 20); password = pass; pass = jagex.Util.formatString(pass, 20); if (user.trim().length() == 0) { drawMessage(messageTable[0], messageTable[1]); return; } if (reconnecting) d(messageTable[2], messageTable[3]); else drawMessage(messageTable[6], messageTable[7]); if (appletStarted()) stream = new SocketStream(host, this, port); else stream = new SocketStream(host, null, port); stream.oe = xc; int ssk = stream.readInt32(); serverSessionID = ssk; System.out.println("Session id: " + ssk); if (reconnecting) stream.beginFrame(19); else stream.beginFrame(0); stream.putInt16(wc); stream.putInt64(jagex.Util.longForName(user)); stream.putLineRSA(pass, ssk, pd, qd); stream.putInt32(getSessionID()); stream.flush(); stream.read(); int response = stream.read(); System.out.println("Login response: " + response); if (response == 0) { ed = 0; e_(); return; } if (response == 1) { ed = 0; a(); return; } if (reconnecting) { user = ""; pass = ""; f(); return; } if (response == 3) { drawMessage(messageTable[10], messageTable[11]); return; } if (response == 4) { drawMessage(messageTable[4], messageTable[5]); return; } if (response == 5) { drawMessage(messageTable[16], messageTable[17]); return; } if (response == 6) { drawMessage(messageTable[18], messageTable[19]); return; } if (response == 7) { drawMessage(messageTable[20], messageTable[21]); return; } if (response == 11) { drawMessage(messageTable[22], messageTable[23]); return; } if (response == 12) { drawMessage(messageTable[24], messageTable[25]); return; } if (response == 13) { drawMessage(messageTable[14], messageTable[15]); return; } if (response == 14) { drawMessage(messageTable[8], messageTable[9]); sd = 1500; return; } if (response == 15) { drawMessage(messageTable[26], messageTable[27]); return; } if (response == 16) { drawMessage(messageTable[28], messageTable[29]); return; } else { drawMessage(messageTable[12], messageTable[13]); return; } } catch (Exception exception) { System.out.println(String.valueOf(exception)); } if (ed > 0) { try { Thread.sleep(5000L); } catch (Exception _ex) { } ed--; login(username, password, reconnecting); } if (reconnecting) { username = ""; password = ""; f(); } else { drawMessage(messageTable[12], messageTable[13]); }</pre> == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 734 2012-11-08T18:05:25Z Protocol 120 /* Reference */ [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == (The login protocol documentation is currently a work in progress. Below you will find a partially refactored version of the login method found in the 135 client.) <pre> try { username = user; user = jagex.Util.formatString(user, 20); password = pass; pass = jagex.Util.formatString(pass, 20); if (user.trim().length() == 0) { drawMessage(messageTable[0], messageTable[1]); return; } if (reconnecting) d(messageTable[2], messageTable[3]); else drawMessage(messageTable[6], messageTable[7]); if (appletStarted()) stream = new SocketStream(host, this, port); else stream = new SocketStream(host, null, port); stream.oe = xc; int ssk = stream.readInt32(); serverSessionID = ssk; System.out.println("Session id: " + ssk); if (reconnecting) stream.beginFrame(19); else stream.beginFrame(0); stream.putInt16(wc); stream.putInt64(jagex.Util.longForName(user)); stream.putLineRSA(pass, ssk, pd, qd); stream.putInt32(getSessionID()); stream.flush(); stream.read(); int response = stream.read(); System.out.println("Login response: " + response); if (response == 0) { ed = 0; e_(); return; } if (response == 1) { ed = 0; a(); return; } if (reconnecting) { user = ""; pass = ""; f(); return; } if (response == 3) { drawMessage(messageTable[10], messageTable[11]); return; } if (response == 4) { drawMessage(messageTable[4], messageTable[5]); return; } if (response == 5) { drawMessage(messageTable[16], messageTable[17]); return; } if (response == 6) { drawMessage(messageTable[18], messageTable[19]); return; } if (response == 7) { drawMessage(messageTable[20], messageTable[21]); return; } if (response == 11) { drawMessage(messageTable[22], messageTable[23]); return; } if (response == 12) { drawMessage(messageTable[24], messageTable[25]); return; } if (response == 13) { drawMessage(messageTable[14], messageTable[15]); return; } if (response == 14) { drawMessage(messageTable[8], messageTable[9]); sd = 1500; return; } if (response == 15) { drawMessage(messageTable[26], messageTable[27]); return; } if (response == 16) { drawMessage(messageTable[28], messageTable[29]); return; } else { drawMessage(messageTable[12], messageTable[13]); return; } } catch (Exception exception) { System.out.println(String.valueOf(exception)); } if (ed > 0) { try { Thread.sleep(5000L); } catch (Exception _ex) { } ed--; login(username, password, reconnecting); } if (reconnecting) { username = ""; password = ""; f(); } else { drawMessage(messageTable[12], messageTable[13]); }</pre> == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> In the 135 client, messages that are to be drawn on the login screen are stored in an array. This makes it a bit tedious to understand what messages are being drawn. Here is the message table: <pre> static { messageTable = new String[50]; messageTable[0] = "You must enter both a username"; messageTable[1] = "and a password - Please try again"; messageTable[2] = "Connection lost! Please wait..."; messageTable[3] = "Attempting to re-establish"; messageTable[4] = "That username is already in use."; messageTable[5] = "Wait 60 seconds then retry"; messageTable[6] = "Please wait..."; messageTable[7] = "Connecting to server"; messageTable[8] = "Sorry! The server is currently full."; messageTable[9] = "Please try again later"; messageTable[10] = "Invalid username or password."; messageTable[11] = "Try again, or create a new account"; messageTable[12] = "Sorry! Unable to connect to server."; messageTable[13] = "Check your internet settings"; messageTable[14] = "Username already taken."; messageTable[15] = "Please choose another username"; messageTable[16] = "The client has been updated."; messageTable[17] = "Please reload this page"; messageTable[18] = "You may only use 1 character at once."; messageTable[19] = "Your ip-address is already in use"; messageTable[20] = "Login attempts exceeded!"; messageTable[21] = "Please try again in 5 minutes"; messageTable[22] = "Account has been temporarily disabled"; messageTable[23] = "for cheating or abuse"; messageTable[24] = "Account has been permanently disabled"; messageTable[25] = "for cheating or abuse"; messageTable[26] = "You need a members account"; messageTable[27] = "to login to this server"; messageTable[28] = "Please login to a members server"; messageTable[29] = "to access member-only features"; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 739 2012-11-10T13:43:16Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == (The login protocol documentation is currently a work in progress. Below you will find a partially refactored version of the login method found in the 135 client.) <pre> try { username = user; user = jagex.Util.formatString(user, 20); password = pass; pass = jagex.Util.formatString(pass, 20); if (user.trim().length() == 0) { drawMessage(messageTable[0], messageTable[1]); return; } if (reconnecting) d(messageTable[2], messageTable[3]); else drawMessage(messageTable[6], messageTable[7]); if (appletStarted()) stream = new SocketStream(host, this, port); else stream = new SocketStream(host, null, port); stream.oe = xc; int ssk = stream.readInt32(); serverSessionID = ssk; System.out.println("Session id: " + ssk); if (reconnecting) stream.beginFrame(19); else stream.beginFrame(0); stream.putInt16(wc); stream.putInt64(jagex.Util.longForName(user)); stream.putLineRSA(pass, ssk, pd, qd); stream.putInt32(getSessionID()); stream.flush(); stream.read(); int response = stream.read(); System.out.println("Login response: " + response); if (response == 0) { ed = 0; e_(); return; } if (response == 1) { ed = 0; a(); return; } if (reconnecting) { user = ""; pass = ""; f(); return; } if (response == 3) { drawMessage(messageTable[10], messageTable[11]); return; } if (response == 4) { drawMessage(messageTable[4], messageTable[5]); return; } if (response == 5) { drawMessage(messageTable[16], messageTable[17]); return; } if (response == 6) { drawMessage(messageTable[18], messageTable[19]); return; } if (response == 7) { drawMessage(messageTable[20], messageTable[21]); return; } if (response == 11) { drawMessage(messageTable[22], messageTable[23]); return; } if (response == 12) { drawMessage(messageTable[24], messageTable[25]); return; } if (response == 13) { drawMessage(messageTable[14], messageTable[15]); return; } if (response == 14) { drawMessage(messageTable[8], messageTable[9]); sd = 1500; return; } if (response == 15) { drawMessage(messageTable[26], messageTable[27]); return; } if (response == 16) { drawMessage(messageTable[28], messageTable[29]); return; } else { drawMessage(messageTable[12], messageTable[13]); return; } } catch (Exception exception) { System.out.println(String.valueOf(exception)); } if (ed > 0) { try { Thread.sleep(5000L); } catch (Exception _ex) { } ed--; login(username, password, reconnecting); } if (reconnecting) { username = ""; password = ""; f(); } else { drawMessage(messageTable[12], messageTable[13]); }</pre> == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> In the 135 client, messages that are to be drawn on the login screen are stored in an array. This makes it a bit tedious to understand what messages are being drawn. Here is the message table: <pre> static { messageTable = new String[50]; messageTable[0] = "You must enter both a username"; messageTable[1] = "and a password - Please try again"; messageTable[2] = "Connection lost! Please wait..."; messageTable[3] = "Attempting to re-establish"; messageTable[4] = "That username is already in use."; messageTable[5] = "Wait 60 seconds then retry"; messageTable[6] = "Please wait..."; messageTable[7] = "Connecting to server"; messageTable[8] = "Sorry! The server is currently full."; messageTable[9] = "Please try again later"; messageTable[10] = "Invalid username or password."; messageTable[11] = "Try again, or create a new account"; messageTable[12] = "Sorry! Unable to connect to server."; messageTable[13] = "Check your internet settings"; messageTable[14] = "Username already taken."; messageTable[15] = "Please choose another username"; messageTable[16] = "The client has been updated."; messageTable[17] = "Please reload this page"; messageTable[18] = "You may only use 1 character at once."; messageTable[19] = "Your ip-address is already in use"; messageTable[20] = "Login attempts exceeded!"; messageTable[21] = "Please try again in 5 minutes"; messageTable[22] = "Account has been temporarily disabled"; messageTable[23] = "for cheating or abuse"; messageTable[24] = "Account has been permanently disabled"; messageTable[25] = "for cheating or abuse"; messageTable[26] = "You need a members account"; messageTable[27] = "to login to this server"; messageTable[28] = "Please login to a members server"; messageTable[29] = "to access member-only features"; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet. |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |} 740 2012-11-10T21:50:56Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream id] (doto stream (.begin-packet 251) (.put-int16 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet. |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The ID of the item to drop | Drops the specified item on the ground |} 742 2012-11-11T15:59:20Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream id] (doto stream (.begin-packet 251) (.put-int16 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - Unknown * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The ID of the item to drop | Drops the specified item on the ground |} 743 2012-11-11T18:05:22Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == A lot of times, Util.longForName is referenced in the packets following: <pre> public static long longForName(String arg0) { String s = ""; for (int i = 0; i < arg0.length(); i++) { char c = arg0.charAt(i); if (c >= 'a' && c <= 'z') s = s + c; else if (c >= 'A' && c <= 'Z') s = s + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s = s + c; else s = s + ' '; } s = s.trim(); if (s.length() > 12) s = s.substring(0, 12); long l = 0L; for (int j = 0; j < s.length(); j++) { char c1 = s.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream id] (doto stream (.begin-packet 251) (.put-int16 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client revision number (135) * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The ID of the item to drop | Drops the specified item on the ground |} 744 2012-11-11T23:09:11Z .S. 122 expanded on username coding [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames are encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream id] (doto stream (.begin-packet 251) (.put-int16 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client revision number (135) * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The ID of the item to drop | Drops the specified item on the ground |} 745 2012-11-11T23:14:25Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames are encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream id] (doto stream (.begin-packet 251) (.put-int16 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client revision number (135) * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The ID of the item to drop | Drops the specified item on the ground |} 746 2012-11-12T14:25:15Z .S. 122 it's the slot, not the id, silly. also finished inventory stuff [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames are encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 ???) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream slot] (doto stream (.begin-packet 251) (.put-int16 slot) (.end-packet))) ;; Opcode: 220 (defn cast-inv [stream slot spell] (doto stream (.begin-packet 220) (.put-int16 slot) (.put-int16 spell) (.end-packet))) ;; Opcode: 240 (defn use2-items [stream slot1 slot2] (doto stream (.begin-packet 240) (.put-int16 slot1) (.put-int16 slot2) (.end-packet))) ;; Opcode: 248 (defn remove-item [stream slot] (doto stream (.begin-packet 248) (.put-int16 slot) (.end-packet))) ;; Opcode: 249 (defn equip-item [stream slot] (doto stream (.begin-packet 249) (.put-int16 slot) (.end-packet))) ;; Opcode: 246 (defn item-cmd [stream slot] (doto stream (.begin-packet 246) (.put-int16 slot) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client revision number (135) * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Inventory | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use Two Inventory Items | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified item |- ! Inventory Command | 246 || * Short - The slot of the item to use | Burys, eats, etc the specified item |} 747 2012-11-12T14:45:43Z .S. 122 outgoing banking, dialogs, combat style, prayer [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames are encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. Some 135 packets are documented ahead. First you will find the packets' body, then you will find a table (for easier reading) === '''Incoming Data''' === '''TODO:''' <pre> </pre> === '''Outgoing Data''' === <pre> (ns rsc.rsc135.packets (:require [jagex.Util]) (:use [jagex.client.SocketStream])) ;; Opcode: 1 (defn disconnect [stream] (doto stream (.begin-packet1) (.flush))) ;; Opcode: 2 (defn newplayer [stream] (doto stream (.begin-packet 2) (.put-int16 revisionid) (.put-int64 (Util/long-for-name username)) (.put-int16 referrerid) (.putline-rsa password server-session-id key-a key-b) ; keys for RSA? (.flush) (.read) ; newplayer response (.end-packet))) ;; Opcode: 6 (defn logout [stream] (doto stream (.begin-packet 6) (.end-packet))) ;; Opcode: 7 (defn send-command [stream command] ; sends command to server e.g ::home, command arg is (.substring command 2) (doto stream (.begin-packet 7) (.putline command) (.end-packet))) ;; Opcode: 10 (defn report-abuse [stream username] (let [name (.substring username 12) l5 (Util/long-for-name name)] (doto stream (.begin-packet 10) (.put-int64 l5) (.end-packet)))) ;; Opcode: 26 (defn add-friend [stream name] ; name is string represenation of username (doto stream (.begin-packet 26) (.put-int64 (Util/long-for-name name) (.end-packet))) ;; Opcode: 27 (defn remove-friend [stream name] ; name is long represenation of username (i.e Util/long-for-name username) (doto stream (.begin-packet 27) (.put-int64 name) (.end-packet))) ;; Opcode: 28 ;; name is long representation of username, message is byte representation of message (.getBytes message), length is length of message (maximum length is 200) (defn send-message [stream name message length] (doto stream (.begin-packet 28) (.put-int64 username) (.read-bytes message 0 length) (.end-packet))) ;; Opcode: 29 (defn add-ignore [stream username] ; username is string representation of username (let [name (Util/long-for-name username)] (doto stream (.begin-packet 29) (.put-int64 name) (.end-packet)))) ;; Opcode: 251 (defn drop-item [stream slot] (doto stream (.begin-packet 251) (.put-int16 slot) (.end-packet))) ;; Opcode: 220 (defn cast-inv [stream slot spell] (doto stream (.begin-packet 220) (.put-int16 slot) (.put-int16 spell) (.end-packet))) ;; Opcode: 240 (defn use2-items [stream slot1 slot2] (doto stream (.begin-packet 240) (.put-int16 slot1) (.put-int16 slot2) (.end-packet))) ;; Opcode: 248 (defn remove-item [stream slot] (doto stream (.begin-packet 248) (.put-int16 slot) (.end-packet))) ;; Opcode: 249 (defn equip-item [stream slot] (doto stream (.begin-packet 249) (.put-int16 slot) (.end-packet))) ;; Opcode: 246 (defn item-cmd [stream slot] (doto stream (.begin-packet 246) (.put-int16 slot) (.end-packet))) ;; Opcode: 237 (defn dialog-select [stream index] (doto stream (.begin-packet 237) (.put-int8 index) (.end-packet))) ;; Opcode: 231 (defn combat-select [stream index] (doto stream (.begin-packet 231) (.put-int8 index) (.end-packet))) ;; Opcode: 207 (defn closebank [stream] (doto stream (.begin-packet 207) (.end-packet))) ;; Opcode: 206 (defn withdraw [stream id amount] (doto stream (.begin-packet 206) (.put-int16 id) (.put-int16 amount) (.end-packet))) ;; Opcode: 205 (defn deposit [stream id amount] (doto stream (.begin-packet 205) (.put-int16 id) (.put-int16 amount) (.end-packet))) ;; Opcode: 211 (defn prayer-off [stream id] (doto stream (.begin-packet 211) (.put-int8 id) (.end-packet))) ;; Opcode: 212 (defn prayer-on [stream id] (doto stream (.begin-packet 212) (.put-int8 id) (.end-packet))) </pre> {| class="wikitable" |+ Outgoing Packets |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client revision number (135) * Long - Long represenation of username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers | Registers a new user (probably not used in private servers) |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Execute Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long represenation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Inventory | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use Two Inventory Items | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified item |- ! Inventory Command | 246 || * Short - The slot of the item to use | Burys, eats, etc the specified item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Select Combat Style | 231 || * Byte - The position of the combat style in the list | Selects the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |} 748 2012-11-12T22:32:28Z .S. 122 its swag time [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} {| class="wikitable" |- ! Login Response ! Description |- |} {| class="wikitable" |- ! Newplayer Response ! Description |- |} === '''Outgoing Data''' === '''TODO: Dueling, document 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by 215. 749 2012-11-12T22:52:51Z .S. 122 error reporting: there's always something [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} {| class="wikitable" |- ! Login Response ! Description |- |} {| class="wikitable" |- ! Newplayer Response ! Description |- |} === '''Outgoing Data''' === '''TODO: Dueling, document 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by 215. 750 2012-11-13T00:01:08Z .S. 122 responses [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == ? == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} Login and newplayer responses are sent by the server like a typical frame. The first byte (the opcode) is skipped by the client. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area |} {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} === '''Outgoing Data''' === '''TODO: Dueling, password recovery, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by Walk to Entity. 751 2012-11-13T11:30:55Z .S. 122 note on endianness [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == RSC-135 uses big-endian byte order exclusively. == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} Login and newplayer responses are sent by the server like a typical frame. The first byte (the opcode) is skipped by the client. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area |} {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} === '''Outgoing Data''' === '''TODO: Dueling, password recovery, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by Walk to Entity. 752 2012-11-13T22:28:21Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. == '''Packet structure''' == RSC-135 uses big-endian byte order exclusively. == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} Login and newplayer responses are sent by the server like a typical frame. The first byte (the opcode) is skipped by the client. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area |} {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} === '''Outgoing Data''' === '''TODO: Dueling, password recovery, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by Walk to Entity. 753 2012-11-13T22:53:48Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == RSC-135 uses big-endian byte order exclusively. == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} Login and newplayer responses are sent by the server like a typical frame. The first byte (the opcode) is skipped by the client. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area |} {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} === '''Outgoing Data''' === '''TODO: Dueling, password recovery, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by Walk to Entity. 755 2012-11-14T22:38:19Z .S. 122 Outdoing duelling stuff [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == RSC-135 uses big-endian byte order exclusively. == '''Login''' == ? == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- |} Login and newplayer responses are sent by the server like a typical frame. The first byte (the opcode) is skipped by the client. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area |} {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 or 19 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. The opcode is 19 when the player is reconnecting after being disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |} Notes: * "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 756 2012-11-14T23:43:47Z .S. 122 incoming shit [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Initialize Client | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 758 2012-11-15T23:52:41Z .S. 122 236 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Initialize Client | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - A value that is not used in the player update process. * Byte - The player's hair style. * Byte - The player's gender. 4 = Female, 1 = Male * Byte - Constant 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. The first byte appears to be unused. The constant value is used in the update process, but why? * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 762 2012-11-25T15:10:56Z .S. 122 more accurate name for s>c 244? [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Init Map Region | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - A value that is not used in the player update process. * Byte - The player's hair style. * Byte - The player's gender. 4 = Female, 1 = Male * Byte - Constant 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. The first byte appears to be unused. The constant value is used in the update process, but why? * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 780 2012-11-29T09:58:18Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Init Map Region | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - ? * Byte - The player's hair style. * Byte - The player's gender. 4 = Female, 1 = Male * Byte - The player's 'leg type' (always 2) * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. The first byte appears to be unused. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 781 2012-11-29T10:01:18Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Init Map Region | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - ? * Byte - The player's hair style * Byte - The player's 'body type' 4 = Female, 1 = Male * Byte - The player's 'leg type' - Always 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. The first byte appears to be unused. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 782 2012-11-29T10:07:22Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Init Map Region | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - The player's gender - 2=Female, 1=Male * Byte - The player's hair style * Byte - The player's 'body type' - 4=Female, 1=Male * Byte - The player's 'leg type' - Always 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. The first byte appears to be unused. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 783 2012-11-29T10:14:35Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == TODO. RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames can be encoded and decoded as a long with the following methods: <pre> public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Player usernames are encoded like so exclusively in the account recovery process: <pre> public static long encode47(String arg0) { arg0 = arg0.trim(); arg0 = arg0.toLowerCase(); long l = 0L; int i = 0; for (int j = 0; j < arg0.length(); j++) { char c = arg0.charAt(j); if (c >= 'a' && c <= 'z' || c >= '0' && c <= '9') { char c1 = c; l = l * 47L * (l - (long) (c1 * 6) - (long) (i * 7)); l += (c1 - 32) + i * c1; i++; } } return l; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Password Recovery''' == Firstly, an integer is read from the stream. Then, the previous password and the new password are formatted and stored locally. The client begins a packet with opcode 8. The username is encoded and the long is written. Next, the client session ID is written. RSA line is put (old password + new password) (Presumably) The username is written as RSA long 5 times encoded with a special method used exclusively in the account recovery process (documented above). One byte is read and discarded. The next byte is the recovery response. The possible values: {| class="wikitable" |- ! Response Code ! Meaning |- | 0 || Sorry, recovery failed! You may try again in one hour. |- | 1 || Your pass has been reset. You may now use the new pass to login. |} Literally any other value results in a recovery failure and the following error message: "Recovery failed! Attempts exceeded?" == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Initialize Ignore List | 26 || * ? | ? |- ! Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Items | 254 || * ? | ? |- ! Objects | 253 || * ? | ? |- ! Inventory | 252 || * ? | ? |- ! Players | 250 || * ? | ? |- ! Boundaries | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs | 247 || * ? | ? |- ! Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Init Map Region | 244 || * ? | ? |- ! Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Environment | 240 || * ? | ? |- ! Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Game Settings | 228 || * ? | ? |- ! Prayers | 227 || * ? | ? |- ! Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username of the user to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username of the user to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username of the user to send the message to * Byte[] - A byte array containing the bytes of the message to send to the user | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username of the user to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - The player's gender - 2=Female, 1=Male * Byte - The player's hair style * Byte - The player's 'body type' - 4=Female, 1=Male * Byte - The player's 'leg type' - Always 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 792 2012-12-22T12:57:30Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>byte tempbuf[]; if (in.available() >= 2) { len = in.read(); if (len >= 160) len = (len - 160) * 256 + in.read(); } if (len > 0 && in.available() >= len) { if (len >= 160) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); } else { byte lastbyte = (byte) in.read(); len--; if (len > 0) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); put(lastbyte); } else { opcode = (lastbyte & 0xff); } } } </pre> RSC-135 uses big-endian byte order exclusively. == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO:''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Display Message | 8 || * ? | ? |- ! Close Connection | 9 || * ? | ? |- ! Logout Failed | 10 || * ? | ? |- ! Initialize Friends List | 23 || * ? | ? |- ! Update Friends List | 24 || * ? | ? |- ! Ignore List | 26 || * ? | ? |- ! Initialize Privacy Settings | 27 || * ? | ? |- ! Private Message | 28 || * ? | ? |- ! Player Positions | 255 || * ? | ? |- ! Ground Item Positions | 254 || * ? | ? |- ! Object Positions | 253 || * ? | ? |- ! Whole Inventory | 252 || * ? | ? |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * ? | ? |- ! NPC Positions | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * ? | ? |- ! Hide Dialog | 245 || * ? | ? |- ! Initialize World | 244 || * ? | ? |- ! All Skills | 243 || * ? | ? |- ! Equipment Bonuses | 242 || * ? | ? |- ! Player Death | 241 || * ? | ? |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * ? | ? |- ! Display Trade Offer | 238 || * ? | ? |- ! Hide Trade | 237 || * ? | ? |- ! Update Trade Offer | 236 || * ? | ? |- ! Other's Trade Status | 235 || * ? | ? |- ! Display Shop | 234 || * ? | ? |- ! Hide Shop | 233 || * ? | ? |- ! Our Trade Status | 229 || * ? | ? |- ! Init Game Settings | 228 || * ? | ? |- ! Set Prayers | 227 || * ? | ? |- ! Set Quests | 226 || * ? | ? |- ! Display Bank | 222 || * ? | ? |- ! Hide Bank | 221 || * ? | ? |- ! Bank Update | 214 || * ? | ? |- ! Single XP Update | 220 || * ? | ? |- ! Update InvItem | 213 || * ? | ? |- ! Remove InvItem | 212 || * ? | ? |- ! Single Skill Update | 211 || * ? | ? |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! Name ! Opcode ! Payload ! Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * Short - The client's revision number (135) * Long - Long representation of the username * Short - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Registers a new user. |- ! Login | 0 || * Short - The client's revision number (135) * Long - Long representation of the username * Line-RSA - Password, server session ID, bigintegers * Int - The "ranseed" value | Logs the player in. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * Long - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * Long - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * Long - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * Long - The long representation of the username to send the message to * String - The message | Sends a message to the specified user |- ! Ignore User | 29 || * Long - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * Short - (start_x + area_x). The initial position. * Short - (start_y + area_y) * Byte... - (route_x[i] - start_x) * Byte... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * Short - Size? * Short... - The player's server index * Short... - ??? | Variable length. Informs the server of new players. Why? |- ! Drop Item | 251 || * Short - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * Short - The slot of the item to cast a spell on * Short - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * Short - The slot of the first item to use * Short - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * Short - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * Short - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * Short - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * Byte - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * Byte - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * Short - The ID of the item to withdraw * Short - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * Short - The ID of the item to deposit * Short - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * Byte - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * Byte - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * Byte - The amount of traded items to send to the server * Short... - The id of the item * Int... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID * Short - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * Short - The item's X coordinate * Short - The item's Y coordinate * Short - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction * Short - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * Short - The bound's X coordinate * Short - The bound's Y coordinate * Byte - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate * Short - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * Short - The object's X coordinate * Short - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * Short - The NPC's server index * Short - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * Short - The NPC's server index * Short - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * Short - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * Short - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * Short - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * Short - The player's server index * Short - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * Short - The player's server index * Short - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * Short - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * Short - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * Short - The player's server index | Starts following another player. |- ! Duel Player | 204 || * Short - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * Byte - No retreating, 0 or 1 * Byte - No magic, 0 or 1 * Byte - No prayers, 0 or 1 * Byte - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * Byte - The total number of offered items * Short... - Offered item ID * Int... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * Byte - The player's gender - 2=Female, 1=Male * Byte - The player's hair style * Byte - The player's 'body type' - 4=Female, 1=Male * Byte - The player's 'leg type' - Always 2 * Byte - The player's hair colour * Byte - The player's top colour * Byte - The player's leg colour * Byte - The player's skin colour * Byte - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 795 2012-12-22T15:23:01Z .S. 122 wow so update [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>byte tempbuf[]; if (in.available() >= 2) { len = in.read(); if (len >= 160) len = (len - 160) * 256 + in.read(); } if (len > 0 && in.available() >= len) { if (len >= 160) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); } else { byte lastbyte = (byte) in.read(); len--; if (len > 0) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); put(lastbyte); } else { opcode = (lastbyte & 0xff); } } } </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs, player appearance update ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's absx position. * bits[12] - The player's absy position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (abs_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 (so small!) - The number of items in the player's bank. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 796 2012-12-22T15:34:45Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>byte tempbuf[]; if (in.available() >= 2) { len = in.read(); if (len >= 160) len = (len - 160) * 256 + in.read(); } if (len > 0 && in.available() >= len) { if (len >= 160) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); } else { byte lastbyte = (byte) in.read(); len--; if (len > 0) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); put(lastbyte); } else { opcode = (lastbyte & 0xff); } } } </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs, player appearance update ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 (so small!) - The number of items in the player's bank. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 797 2012-12-22T21:24:38Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>byte tempbuf[]; if (in.available() >= 2) { len = in.read(); if (len >= 160) len = (len - 160) * 256 + in.read(); } if (len > 0 && in.available() >= len) { if (len >= 160) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); } else { byte lastbyte = (byte) in.read(); len--; if (len > 0) { opcode = in.read() & 0xff; len--; tempbuf = new byte[len]; in.read(tempbuf, 0, len); put(tempbuf); put(lastbyte); } else { opcode = (lastbyte & 0xff); } } } </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs, player appearance update ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 798 2012-12-23T00:13:20Z .S. 122 simplify dat structure [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len - 1] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs, player appearance update ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 799 2012-12-23T01:02:18Z .S. 122 ,,, [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs, player appearance update ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * ? | ? |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 800 2012-12-23T15:25:54Z .S. 122 Player appearance update [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Player Appearance Update''' == First, create a new packet with the opcode 250. Add the total number of expected updates ([u]int16). Then, for each 'thing' to update, write the (server) index of the player the update applies to ([u]int16), and the 'update type' (int8) followed by whatever data that update type expects. '''Update type 1 - Public chat messages''' * [u]int8 - The length of the chat message. * string (raw) - The chat message, scrambled by the sender's client. '''Update type 2 - Combat damage''' * [u]int8 - The damage recieved. * [u]int8 - That player's 'current' hitpoints level. * [u]int8 - That player's 'base' hitpoints '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * [u]int16 - The projectile's id. * [u]int16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * [u]int16 - The player's status? Doesn't appear to do anything. Jagex's server sends 9144. * [u]int64 - The player's username encoded with mod37. * [u]int8 - The size of the sub-update (but it reads by order so what's the point?) ** [u]int8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** [u]int8 - The player's body type + 1, or 0 if they are wearing a platebody ** [u]int8 - The player's leg type + 1, or 0 if they are wearing legs ** [u]int8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** [u]int8 - The animation id + 1 of the player's hand item or 0. ** [u]int8 - The animation id + 1 of the player's head item or 0. ** [u]int8 - The animation id + 1 of the player's body item or 0. ** [u]int8 - The animation id + 1 of the player's leg item or 0. ** [u]int8 - The animation id + 1 of the player's neck item or 0. ** [u]int8 - The animation id + 1 of the player's shoes or 0. ** [u]int8 - The animation id + 1 of the player's gloves or 0. ** [u]int8 - The animation id + 1 of the player's cape or 0. * [u]int8 - The player's hair colour. * [u]int8 - The player's top colour. * [u]int8 - The player's leg colour. * [u]int8 - The player's skin colour. * [u]int8 - The player's combat level. * [u]int8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * See [[135_Protocol#Player_Appearance_Update|Player Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 801 2012-12-23T15:27:21Z .S. 122 I get the point. [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Player Appearance Update''' == First, create a new packet with the opcode 250. Add the total number of expected updates ([u]int16). Then, for each 'thing' to update, write the (server) index of the player the update applies to ([u]int16), and the 'update type' (int8) followed by whatever data that update type expects. '''Update type 1 - Public chat messages''' * [u]int8 - The length of the chat message. * string (raw) - The chat message, scrambled by the sender's client. '''Update type 2 - Combat damage''' * [u]int8 - The damage recieved. * [u]int8 - That player's 'current' hitpoints level. * [u]int8 - That player's 'base' hitpoints '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * [u]int16 - The projectile's id. * [u]int16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * [u]int16 - The player's status? Doesn't appear to do anything. Jagex's server sends 9144. * [u]int64 - The player's username encoded with mod37. * [u]int8 - The size of the sub-update. ** [u]int8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** [u]int8 - The player's body type + 1, or 0 if they are wearing a platebody ** [u]int8 - The player's leg type + 1, or 0 if they are wearing legs ** [u]int8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** [u]int8 - The animation id + 1 of the player's hand item or 0. ** [u]int8 - The animation id + 1 of the player's head item or 0. ** [u]int8 - The animation id + 1 of the player's body item or 0. ** [u]int8 - The animation id + 1 of the player's leg item or 0. ** [u]int8 - The animation id + 1 of the player's neck item or 0. ** [u]int8 - The animation id + 1 of the player's shoes or 0. ** [u]int8 - The animation id + 1 of the player's gloves or 0. ** [u]int8 - The animation id + 1 of the player's cape or 0. * [u]int8 - The player's hair colour. * [u]int8 - The player's top colour. * [u]int8 - The player's leg colour. * [u]int8 - The player's skin colour. * [u]int8 - The player's combat level. * [u]int8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, fully document 244, 240, NPCs ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - The player's x position. * bits[12] - The player's y position. * bits[4] - The player's direction. * bits[8] - The number of players to update. * bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1 * bits[1]... - 1 if the player has not moved, but new dir * bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4). | Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Players (Appearance) | 250 || * See [[135_Protocol#Player_Appearance_Update|Player Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * ? | ? |- ! NPCs (Appearance) | 247 || * ? | ? |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Update Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - Long representation of the username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - Long representation of the username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The long representation of the username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - long representation of username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The long representation of the username to report | Removes a user from your friends list |- ! Send Message | 28 || * int64 - The long representation of the username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The long representation of the username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Acknowledge Players | 254 || * int16 - Size? * int16... - The player's server index * int16... - ??? | Variable length. Informs the server of players. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing) |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 802 2012-12-23T19:24:41Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Add the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The chat message, scrambled. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240, 244 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11] - The new NPC's (server) index. * bits[5] - The new NPC's offset x position. * bits[5] - The new NPC's offset y position. * bits[4] - The new NPC's direction. * bits[9] - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players after a movement/positions update packet. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 803 2012-12-23T19:25:41Z .S. 122 forgot dem dots [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Add the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The chat message, scrambled. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240, 244 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players after a movement/positions update packet. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 804 2012-12-23T19:27:17Z .S. 122 s/add/write/ [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The chat message, scrambled. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240, 244 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize World | 244 || * uint16 - The player's server index. * uint16 - ? (2304) * uint16 - ? (1776) * uint16 - The player's height level (player_y / 944). * uint16 - ? (944) | Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | ? |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players after a movement/positions update packet. Why? |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 805 2012-12-23T19:39:29Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The chat message, scrambled. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions, 254''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 806 2012-12-23T19:40:10Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - [[Data_Types#Non_Standard_Data_Types|Special A]]<br> '''[[Data_Types#Bit_Access|Bit access]]''' == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The chat message, scrambled. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The message, scrambled by the sender's client. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The message, scrambled. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 807 2012-12-23T20:11:30Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte msgdata[] = new byte[100]; public static char msgchars[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String dec_msg(byte buffer[], int off, int len) { try { int i = 0; int j = -1; for (int k = 0; k < len; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) msgchars[i++] = charmap[i1]; else j = i1; } else { msgchars[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) msgchars[i++] = charmap[i1]; else j = i1; } else { msgchars[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = msgchars[j1]; if (j1 > 4 && c == '@') msgchars[j1] = ' '; if (c == '%') msgchars[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { msgchars[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(msgchars, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int enc_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int len = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else msgdata[len++] = (byte) k; } else if (k < 13) { msgdata[len++] = (byte) ((i << 4) + k); i = -1; } else { msgdata[len++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) msgdata[len++] = (byte) (i << 4); return len; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 808 2012-12-26T02:32:21Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 809 2012-12-27T00:53:49Z .S. 122 just realized i forgot this [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Add Ignore | 30 || * int64 - mod37 encoded username | Adds a user to your ignore list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 810 2012-12-27T00:54:43Z .S. 122 lol im silly [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len [byte] data[len] // last byte len--; // skip it } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a hemlet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Disconnect | 1 || * None | Sends the disconnect packet |- ! Newplayer (Registration) | 2 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * int16 - Referrer ID ** Integer.parseInt(getParameter("referrerid")); * The password encrypted with RSA * int32 - The "ranseed" value | Registers a new user. |- ! Login | 0 || * int16 - The client's revision number (135) * int64 - mod37 encoded username * The password encrypted with RSA * int32 - The "ranseed" value | Logs the player in. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Reconnect | 19 || * Same as 0 | Reconnects the player after they are disconnected. |- ! Logout | 6 || * None | Sends the logout packet to the server |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. Unused? |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 0 or 1 * int8 - No magic, 0 or 1 * int8 - No prayers, 0 or 1 * int8 - No weapons, 0 or 1 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - Always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 811 2013-01-03T14:45:11Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * uint32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * uint32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * uint32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * uint32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * uint32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * uint32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * uint32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * uint32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 820 2013-01-18T15:59:41Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * uint64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * uint64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * uint64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * uint64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 821 2013-01-18T16:00:48Z .S. 122 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * int64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * int64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * int64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 1344 2014-08-14T19:48:28Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * int64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * int64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * int64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Ping | 5 || * None | Ping |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 1346 2014-08-15T22:06:32Z Protocol 120 [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * int64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * int64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * int64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- ! Play Sound | 207 || * byte[] - The name of the sound. | Plays a sound/audio file in the client. |- ! Open Character Design Panel | 203 || * None. | Open the character design panel. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Ping | 5 || * None | Ping |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 1464 2014-10-03T16:17:22Z Fabrice l 621 /* Outgoing Data */ [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * int64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * int64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * int64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- ! Play Sound | 207 || * byte[] - The name of the sound. | Plays a sound/audio file in the client. |- ! Open Character Design Panel | 203 || * None. | Open the character design panel. |- |} === '''Outgoing Data''' === '''TODO: Password recovery & recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Ping | 5 || * None | Ping |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Change Password | 25 || * RSAString - Your old password + new password encoded with RSA * Old password substring - RSAString.substring(0,20).trim() * New password substring - RSAString.substring(20, RSAString.length()).trim(); | Is used to change your password ingame |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 1465 2014-10-03T16:17:39Z Fabrice l 621 /* Outgoing Data */ [[Category:RSC]] This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here]. == '''Packet structure''' == <pre>if (len >= 160 { [byte] (160 + (len / 256)) [byte] (len & 0xff) } else { [byte] len if (len > 0) { len--; // skip it [byte] data[len] // last byte } } [byte] opcode for (int i = 0; i < len; i++) [byte] data[i] </pre> RSC-135 uses big-endian byte order exclusively. '''Data types''' int8 - an 8-bit integer, or byte.<br> int16 - a 16-bit integer, or short, or WORD.<br> int32 - a 32-bit integer, or int, or DWORD.<br> int64 - a 64-bit integer, or long, or QWORD.<br> u - unsigned<br> a - when writing, increment the MSB (most significant byte, or first byte) by 128. When reading, if the first byte unsigned is lower than 128, that's your value, otherwise decrement the first byte by 128 and read as normally.<br> '''Bit Access''' <pre>private static final int bitmasks[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 }; public void start_bit_access() { bitpos = offset * 8; } public void write_bits(int num, int val) { int bytepos = bitpos >> 3; int bitoffset = 8 - (bitpos & 7); bitpos += num; for (; num > bitoffset; bitoffset = 8) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos++] |= (val >> (num - bitoffset)) & bitmasks[bitoffset]; num -= bitoffset; } if (num == bitoffset) { buffer[bytepos] &= ~bitmasks[bitoffset]; buffer[bytepos] |= val & bitmasks[bitoffset]; } else { buffer[bytepos] &= ~(bitmasks[num] << (bitoffset - num)); buffer[bytepos] |= (val & bitmasks[num]) << (bitoffset - num); } } public void end_bit_access() { offset = (bitpos + 7) / 8; }</pre> == '''Reference''' == Player usernames are encoded and decoded with the following methods: <pre>public static long encode_37(String s) { String s1 = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c >= 'a' && c <= 'z') s1 = s1 + c; else if (c >= 'A' && c <= 'Z') s1 = s1 + (char) ((c + 97) - 65); else if (c >= '0' && c <= '9') s1 = s1 + c; else s1 = s1 + ' '; } s1 = s1.trim(); if (s1.length() > 12) s1 = s1.substring(0, 12); long l = 0L; for (int j = 0; j < s1.length(); j++) { char c1 = s1.charAt(j); l *= 37L; if (c1 >= 'a' && c1 <= 'z') l += (1 + c1) - 97; else if (c1 >= '0' && c1 <= '9') l += (27 + c1) - 48; } return l; } public static String decode_37(long l) { String s = ""; while (l != 0L) { int i = (int) (l % 37L); l /= 37L; if (i == 0) { s = " " + s; } else if (i < 27) { if (l % 37L == 0L) s = (char) ((i + 65) - 1) + s; else s = (char) ((i + 97) - 1) + s; } else { s = (char) ((i + 48) - 27) + s; } } return s; } </pre> Chat messages are encoded and decoded with the following methods: <pre>public static byte encodedmsg[] = new byte[100]; public static char decodedmsg[] = new char[100]; private static char charmap[] = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']' }; public static String decode_msg(byte buffer[], int off, int enclen) { try { int i = 0; int j = -1; for (int k = 0; k < enclen; k++) { int l = buffer[off++] & 0xff; int i1 = l >> 4 & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } i1 = l & 0xf; if (j == -1) { if (i1 < 13) decodedmsg[i++] = charmap[i1]; else j = i1; } else { decodedmsg[i++] = charmap[((j << 4) + i1) - 195]; j = -1; } } boolean flag = true; for (int j1 = 0; j1 < i; j1++) { char c = decodedmsg[j1]; if (j1 > 4 && c == '@') decodedmsg[j1] = ' '; if (c == '%') decodedmsg[j1] = ' '; if (flag && c >= 'a' && c <= 'z') { decodedmsg[j1] += '\uFFE0'; flag = false; } if (c == '.' || c == '!') flag = true; } return new String(decodedmsg, 0, i); } catch (Exception ex) { return "Cabbage"; } } public static int encode_msg(String str) { if (str.length() > 80) str = str.substring(0, 80); str = str.toLowerCase(); int enclen = 0; int i = -1; for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); int k = 0; for (int l = 0; l < charmap.length; l++) { if (c != charmap[l]) continue; k = l; break; } if (k > 12) k += 195; if (i == -1) { if (k < 13) i = k; else encodedmsg[enclen++] = (byte) k; } else if (k < 13) { encodedmsg[enclen++] = (byte) ((i << 4) + k); i = -1; } else { encodedmsg[enclen++] = (byte) ((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) encodedmsg[enclen++] = (byte) (i << 4); return enclen; }</pre> == '''Login''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 0 or 19 if the player is reconnecting. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the login response code from the server. {| class="wikitable" |- ! Login Resp. ! Description |- | 0 | Successful login |- | 1 |? |- | 3 | Invalid username or password |- | 4 | Username already in use |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Login attempts exceeded |- | 11 | Account temporarily disabled |- | 12 | Account permanently disabled |- | 15 | Server is currently full |- | 16 | Members-only server |- | 17 | Members-only area? |} == '''Registration''' == * The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20. * The connection with the server is established. * The client reads a raw long from the server, this is the "session id". * The client creates a new frame, opcode 2. * A short, the client's revision number (135) is placed in the buffer. * A long, the player's username encoded with mod37 (see above) is placed in the buffer. * A short, the applet's "referid" parameter is placed in the buffer. * A string encoded with RSA and the player's session id (the password) is placed in the buffer. * An integer, the player's "ranseed" value is placed in the buffer. ** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer. * The stream is then flushed. * A byte is read from the stream and discarded. * Another byte is read, this is the newplayer response code from the server. {| class="wikitable" |- ! Newp Resp. ! Description |- | 2 | Successful registration |- | 3 | Username already taken |- | 5 | Client has been updated |- | 6 | IP address is already in use |- | 7 | Registration attempts exceeded? |} == '''Mob Appearance Update''' == Firstly, create a new packet with the opcode 250. Write the total number of expected updates (uint16). Secondly, for each 'thing' to update, write the (server) index of the mob the update applies to (uint16), and the 'update type' (int8) followed by whatever data that type expects. '''Update type 1 - Public chat messages''' * uint8 - The length of the chat message. * string (raw) - The encoded chat message. '''Update type 2 - Combat damage''' * uint8 - The damage recieved. * uint8 - That mob's 'current' hitpoints level. * uint8 - That mob's 'base' hitpoints. '''Update type 3/4 - Projectiles''' The update type is 3 when the target is a NPC, or 4 is the target is a player. The standard magic projectile id is 1, and the standard ranged projectile id is 2. * uint16 - The projectile's id. * uint16 - The (server) index of the projectile's target entity. '''Update type 5 - Appearance''' Hair style, body type, leg type, and colours are as they are sent by the client's character design packet. * uint16 - The player's status? Doesn't appear to do anything. * int64 - The player's username encoded with mod37. * uint8 - The size of the sub-update. ** uint8 - The player's hair style + 1, or 0 if they are wearing a helmet ** uint8 - The player's body type + 1, or 0 if they are wearing a platebody ** uint8 - The player's leg type + 1, or 0 if they are wearing legs ** uint8 - The animation id + 1 (look in the client) of the player's offhand item or 0. ** uint8 - The animation id + 1 of the player's hand item or 0. ** uint8 - The animation id + 1 of the player's head item or 0. ** uint8 - The animation id + 1 of the player's body item or 0. ** uint8 - The animation id + 1 of the player's leg item or 0. ** uint8 - The animation id + 1 of the player's neck item or 0. ** uint8 - The animation id + 1 of the player's shoes or 0. ** uint8 - The animation id + 1 of the player's gloves or 0. ** uint8 - The animation id + 1 of the player's cape or 0. * uint8 - The player's hair colour. * uint8 - The player's top colour. * uint8 - The player's leg colour. * uint8 - The player's skin colour. * uint8 - The player's combat level. * uint8 - 1 if the player is skulled. == '''Packets''' == The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions. === '''Incoming Data''' === '''TODO: Duelling stuff, 240 ''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Display Message | 8 || * string - A raw string, the message. | Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box. |- ! Close Connection | 9 || * None | Forces the client to log out. |- ! Logout Failed | 10 || * None | You can't log out now! |- ! Initialize Friends List | 23 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. * uint8... - The world the friend is logged in to. 0 indicates the player is logged out. | Initializes the player's friends list. Variable length. |- ! Update Friends List | 24 || * int64 - The friend's username, encoded with mod37. * uint8 - 0 if the friend is logged in, 1 if the friend is logged out. | Informs the client that a friend has logged in/out or that a new friend has been added to the list. |- ! Initialize Ignore List | 26 || * uint8 - The total number of players in the list. * int64... - The friend's username, encoded with mod37. | Initializes the player's ignore list. Variable length. |- ! Initialize Privacy Settings | 27 || * int8 - 0/1. Block public chat messages. * int8 - 0/1. Block private chat messages. * int8 - 0/1. Block trade requests. * int8 - 0/1. Block duel requests. | Initializes the player's privacy settings. |- ! Private Message | 28 || * int64 - The sender's username, encoded with mod37. * string - The encoded message. | Sends a private message to the client. |- ! Player Movement | 255 || * bits[10] - This player's x position. * bits[12] - This player's y position. * bits[4] - This player's direction. * bits[8] - The number of players the client already knows about to be sent (but it reads them in order?) ** bits[1]... - If the player has not moved & does not need to be removed, 0 & don't send the next 2 lots of bits, otherwise 1. ** bits[1]... - 1 if the player is to be removed. ** bits[3/4]... - The player's direction. 4 bits with a value of 12 if the player is to be removed, otherwise 3 bits. * bits[11]... - The new player's (server) index. * bits[5]... - The new player's offset x position. * bits[5]... - The new player's offset y position. * bits[4]... - The new player's direction. * bits[1]... - something to do with c>s 254? 0 | Updates the position/movement of the client's player and nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are this_x - player_x and are incremented by 32 if less than zero. Variable length. |- ! Ground Item Positions | 254 || * uint16 - The id of the item to update * int8 - The x position of the item relative to the player (item_x - player_x) * int8 - The y position of the item relative to the player (item_y - player_y) | Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length. |- ! Object Positions | 253 || * uint16 - The id of the object to update * int8 - The x position of the object relative to the player (object_x - player_x) * int8 - The y position of the object relative to the player (object_y - player_y) | Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it. |- ! Whole Inventory | 252 || * uint8 - The number of items in the player's inventory. * uint16... - The item's id. If equipped, increment by 0x8000. * int32a... - The item's stack size. Only sent when the item is stackable. | Sends over the player's whole inventory. Variable length. |- ! Player Appearance | 250 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]] | Updates things to do with nearby players that aren't related to movement. |- ! Boundary Positions | 249 || * uint16 - The id of the bound to update * int8 - The x position of the bound relative to the player (object_x - player_x) * int8 - The y position of the bound relative to the player (object_y - player_y) * int8 - The bound's direction | Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it. |- ! NPC Movement | 248 || * bits[8] - The number of NPCs the client already knows about to be sent (but it reads them in order?). ** bits[1]... - 1 if the NPC has moved, otherwise 0 & don't send the next 2 lots of bits. ** bits[1]... - 1 if the NPC is to be removed, otherwise 0. ** bits[3/4]... - The NPC's direction, 4 bits with a value of 12 if the NPC is to be removed, otherwise 3 bits. * bits[11]... - The new NPC's (server) index. * bits[5]... - The new NPC's offset x position. * bits[5]... - The new NPC's offset y position. * bits[4]... - The new NPC's direction. * bits[9]... - The new NPC's id. | Updates the positions/movement of nearby NPCs. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Offset positions are player_x - npc_x and are incremented by 32 if less than zero. Variable length. |- ! NPC Appearance | 247 || * See [[135_Protocol#Mob_Appearance_Update|Mob Appearance Update]]. | Updates things to do with nearby NPCs that aren't related to movement. Only the first two update types apply (NPCs cannot send projectiles or have changed sprites). NPC server index is used instead of player server index, obviously. |- ! Display Dialog | 246 || * uint8 - The total number of options. * uint8... - The length of the option string. * string... - The option string. | Displays a NPC chat dialog. Variable length. |- ! Hide Dialog | 245 || * None | Hides the NPC chat dialog. |- ! Initialize Plane | 244 || * uint16 - The player's server index. * uint16 - The width of the plane. (2304) * uint16 - The height of the plane. (1776) * uint16 - The index of the plane. (player_y / multiplier) * uint16 - The plane multiplier. (944) | Initializes the plane. Sent when the player first logs in, and when the player is teleported or moves up/down a height. |- ! All Skills | 243 || * for (int i = 0; i < skill_count; i++) * uint8... - The skill's current level. * for (int i = 0; i < skill_count; i++) * uint8... - The skill's base level. * for (int i = 0; i < skill_count; i++) * int32... - The skill's xp points. * uint8 - The player's quest points. | Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving. |- ! Equipment Bonuses | 242 || * uint8 - The armour's bonus. * uint8 - The weapon's accuracy bonus. * uint8 - The weapon's strength bonus. * uint8 - The magic bonus. * unit8 - The prayer bonus. | Updates the player's equipment bonuses. Variable length. |- ! Player Death | 241 || * None | Displays the "Oh dear! You are dead..." screen. |- ! Environment | 240 || * ? | Doesn't appear to be important when you have everything else. It might be useful to have though, so why don't you be kind and document it? :) |- ! Display Character Design | 239 || * None | Displays the character design interface. |- ! Display Trade Offer | 238 || * uint16 - The server index of the player we are trading with. | Displays the trade offer interface. |- ! Hide Trade | 237 || * None | Hides the trade offer and confirm interfaces. |- ! Update Trade Offer | 236 || * int8 - The number of items the other player has traded. * uint16... - The item's id. * int32a... - The item's stack size. | Updates the other player's trade offer. |- ! Other's Trade Status | 235 || * int8 - 1 = yes, anything else = no | Has the other player accepted the trade offer? |- ! Display Shop | 234 || * uint8 - The number of items in the shop. * int8 - 1 if the shop is a general store. * uint8 - This shop's selling price modifier. * uint8 - This shop's buying price modifier. * uint16... - The item's id. * uint16... - The item's stack size. * uint8... - The item's price. | Displays the shop interface. Variable length. |- ! Hide Shop | 233 || * None | Hides the shop interface. |- ! Our Trade Status | 229 || * int8 - 1 = yes, anything else = no | Have we accepted the trade offer? |- ! Init Game Settings | 228 || * int8 - Automatic camera rotation. 1 = enabled, anything else is disabled. * int8 - Single mouse button. 1 = enabled, anything else is disabled. * int8 - Sound effects. 1 = disabled, anything else is enabled. | Sets the player's gameplay settings. |- ! Set Prayers | 227 || * int8... - The prayer's status. 1 = enabled, anything else is disabled. | Sets the status of every prayer. Variable length. |- ! Set Quests | 226 || * int8... - The quest's completion status. 1 = completed, anything else is incomplete. | Sets the player's quest completion status. Variable length. |- ! Display Bank | 222 || * uint8 - The number of items in the player's bank. * uint8 - The maximum number of items the player is allowed to store. * uint16... - The item's id. * int32a... - The item's stack size. | Displays the bank interface. Variable length. |- ! Hide Bank | 221 || * None | Hides the bank interface. |- ! Bank Update | 214 || * uint8 - The item's slot. * uint16 - The item's id. * int32a - The item's stack size. 0 to remove. | Updates/adds/removes a single item in the bank interface to save bytes. |- ! Single XP Update | 220 || * uint8 - The skill's id. * int32 - The skill's xp. | Updates a single skill's XP to save bytes. |- ! Update InvItem | 213 || * uint8 - The item's slot. * uint16 - The item's id. Increment by 0x7fff to change stack size. * int32a - The item's stack size. May not be read. | Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped. |- ! Remove InvItem | 212 || * uint8 - The item's slot. | Removes a single item from the player's inventory to save bytes. |- ! Single Skill Update | 211 || * uint8 - The skill's id. * uint8 - The skill's current level. * uint8 - The skill's base level. * int32 - The skill's experience points. | Updates a single skill to save bytes. |- ! Play Sound | 207 || * byte[] - The name of the sound. | Plays a sound/audio file in the client. |- ! Open Character Design Panel | 203 || * None. | Open the character design panel. |- |} === '''Outgoing Data''' === '''TODO: recovery questions''' {| class="wikitable" |- ! scope="col" width="140px" | Name ! scope="col" width="50px" | Opcode ! scope="col" width="350px" | Payload ! scope="col" width="300px" | Description |- ! Login | 0 || * See [[135_Protocol#Login|Login]] | Logs the player in. |- ! Reconnect | 19 || * See [[135_Protocol#Login|Login]] | Reconnects the player after they are disconnected. |- ! Disconnect | 1 || * None | Sent after the server sends Close Connection (opcode 9), possibly to notify the server that the player is to be removed. |- ! Newplayer (Registration) | 2 || * See [[135_Protocol#Registration|Registration]] | Registers a new user. |- ! Public Chat | 3 || * String - The encoded message. | Sends a message to public chat. |- ! Ping | 5 || * None | Ping |- ! Attempt Logout | 6 || * None | Inform the server that the client is attempting to log out |- ! Admin Command | 7 || * String - The command | Sends a command to the server to be executed |- ! Report Abuse | 10 || * int64 - The mod37 encoded username to report | Sends an abuse report to the server |- ! Change Password | 25 || * RSAString - Your old password + new password encoded with RSA * Old password substring - RSAString.substring(0,20).trim() * New password substring - RSAString.substring(20, RSAString.length()).trim(); | Is used to change your password ingame |- ! Add Friend | 26 || * int64 - mod37 encoded username | Adds a user to your friends list |- ! Remove Friend | 27 || * int64 - The mod37 encoded username to report | Removes a user from your friends list |- ! Private Message | 28 || * int64 - The mod37 encoded username to send the message to * String - The message, scrambed | Sends a message to the specified user |- ! Ignore User | 29 || * int64 - The mod37 encoded username to ignore | Adds a user to your ignore list |- ! Remove Ignore | 30 || * int64 - mod37 encoded username | Removes a user from your ignore list |- ! Update Privacy Settings | 31 || * int8 - 1 to block public chat * int8 - 1 to block private chat * int8 - 1 to block trade requests * int8 - 1 to block duel requests | Updates the privacy settings |- ! Walk to Tile | 255 || * int16 - (start_x + area_x). The initial position. * int16 - (start_y + area_y) * int8... - (route_x[i] - start_x) * int8... - (route_y[i] - start_y) | Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2. |- ! Walk to Entity | 215 || * The same as 255. | Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2. |- ! Player Response | 254 || * int16 - The number of players sent * int16... - The player's server index * int16... - The player's status, as sent with the appearance update packet | Variable length. Informs the server of players the client knows about after a positions/movement update packet. |- ! Drop Item | 251 || * int16 - The slot of the item to drop | Drops the specified item on the ground |- ! Cast on Item | 220 || * int16 - The slot of the item to cast a spell on * int16 - The id of the spell to cast | Casts a spell (such as High Alchemy) on the specified item |- ! Use with Item | 240 || * int16 - The slot of the first item to use * int16 - The slot of the second item to use | Uses an item in the player's inventory with another item in the player's inventory |- ! Remove Item | 248 || * int16 - The slot of the item to unequip | Unequips the specified inventory item |- ! Wear Item | 249 || * int16 - The slot of the item to equip | Equips the specified inventory item |- ! Item Command | 246 || * int16 - The slot of the item to use | Buries, eats, etc the specified inventory item |- ! Select Option | 237 || * int8 - The position of the option in the dialog_options array | Selects an option in a NPC dialog |- ! Combat Style | 231 || * int8 - The position of the combat style in the list | Sets the player's combat style. * 0 - Controlled * 1 - Aggressive * 2 - Accurate * 3 - Defensive |- ! Close Bank | 207 || * None | Informs the server that the player has closed the banking interface. |- ! Withdraw Item | 206 || * int16 - The ID of the item to withdraw * int16 - The amount of the specified item to withdraw | Withdraws a single type of item from the player's bank. |- ! Deposit Item | 205 || * int16 - The ID of the item to deposit * int16 - The amount of the specified item to deposit | Deposits a single type of item into the player's bank. |- ! Disable Prayer | 211 || * int8 - The ID of the prayer to disable | Disables a prayer. |- ! Enable Prayer | 212 || * int8 - The ID of the prayer to enable | Enables a prayer. |- ! Update Game Setting | 213 || * int8 - The setting type * int8 - The setting value (1 or 0) | Setting types: * 0 - Camera angle mode (auto/manual) * 1 - Number of mouse buttons (1/2) * 2 - Sound effects (off/on) |- ! Confirm Trade | 202 || * None | Confirms the trade offer. |- ! Accept Trade | 232 || * None | Accepts the trade offer. |- ! Decline Trade | 233 || * None | Declines the trade offer. |- ! Trade Update | 234 || * int8 - The amount of traded items to send to the server * int16... - The id of the item * int32... - The amount/stack size of the item | Variable length. Updates the trade offer. |- ! Cast on GItem | 224* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The spell's ID | Casts a spell on an item on the ground. |- ! Use with GItem | 250* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID * int16 - The inventory slot | Uses an item in the player's inventory with an item on the ground. |- ! Take GItem | 252* || * int16 - The item's X coordinate * int16 - The item's Y coordinate * int16 - The item's ID | Picks up an item on the ground. |- ! Cast on Boundary | 223* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The spell's ID | Casts a spell on a boundary (or 'wall object'). |- ! Use with Boundary | 239* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction * int16 - The inventory slot | Uses an item in the player's inventory with a boundary (or 'wall object'). |- ! Boundary Cmd 1 | 238* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the primary action (usually 'open') on a boundary (or 'wall object'). |- ! Boundary Cmd 2 | 229* || * int16 - The bound's X coordinate * int16 - The bound's Y coordinate * int8 - The bound's direction | Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object'). |- ! Cast on Object | 222* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The spell's ID | Casts a spell on an object. |- ! Use with Object | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate * int16 - The inventory slot | Uses an item in the player's inventory with an object. |- ! Object Cmd 1 | 241* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the primary action on an object (for example, 'mine'). |- ! Object Cmd 2 | 230* || * int16 - The object's X coordinate * int16 - The object's Y coordinate | Performs the secondary action on an object (for example, 'prospect'). |- ! Cast on NPC | 225* || * int16 - The NPC's server index * int16 - The spell's ID | Casts a spell on a non-player character. |- ! Use with NPC | 243* || * int16 - The NPC's server index * int16 - The inventory slot | Uses an item in the player's inventory with a non-player character. |- ! Talk to NPC | 245* || * int16 - The NPC's server index | Starts talking to a non-player character. |- ! Attack NPC | 244* || * int16 - The NPC's server index | Starts attacking a non-player character. |- ! NPC Cmd 2 | 195* || * int16 - The NPC's server index | Performs the secondary action on a non-player character, usually 'pickpocket'. |- ! Cast on Self | 227 || * int16 - The spell's ID | Cast a teleport or charge spell on the local player. |- ! Cast on Player | 226* || * int16 - The player's server index * int16 - The spell's ID | Casts a spell on another player. |- ! Use with Player | 219* || * int16 - The player's server index * int16 - The inventory slot | Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player. |- ! Attack Player | 228* || * int16 - The player's server index | Starts attacking another player. |- ! Trade Player | 235 || * int16 - The player's server index | Sends a trade request to another player. |- ! Follow Player | 214 || * int16 - The player's server index | Starts following another player. |- ! Duel Player | 204 || * int16 - The player's server index | Sends a duel request to another player. |- ! RuntimeException | 17 || * String - The text of the error. | Sent when the client throws an exception while processing data sent by the server. |- ! Confirm Duel Offer | 198 || * None | Confirms the duel offer. |- ! Accept Duel Offer | 199 || * None | Accepts the duel offer. |- ! Duel Settings | 200 || * int8 - No retreating, 1 or 0 * int8 - No magic, 1 or 0 * int8 - No prayers, 1 or 0 * int8 - No weapons, 1 or 0 | Updates the duel settings. |- ! Duel Items | 201 || * int8 - The total number of offered items * int16... - Offered item ID * int32... - Offered item stack size | Variable length. Updates the stake. |- ! Decline Duel Offer | 203 || * None | Declines the duel offer. |- ! Character Design | 236 || * int8 - The player's gender - 2=Female, 1=Male * int8 - The player's hair style * int8 - The player's 'body type' - 4=Female, 1=Male * int8 - The player's 'leg type' - always 2 * int8 - The player's hair colour * int8 - The player's top colour * int8 - The player's leg colour * int8 - The player's skin colour * int8 - The player's class | Submits the player's chosen design when they log in for the first time. * 0 - Adventurer class * 1 - Warrior class * 2 - Wizard class * 3 - Ranger class * 4 - Miner class |} Notes: * Opcodes marked with * are preceded by Walk to Entity. * When closing the duel confirm screen, it may send the decline trade packet, for some reason. 202 Protocol 0 19 nu79a0bp6iah5eurhgja07gjonmhmt5 55 2011-06-18T04:45:52Z Admin 1 Created page with "{{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204." {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. 59 2011-06-18T04:54:06Z Admin 1 {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 78 2011-06-18T05:52:38Z Admin 1 /* Incoming Data */ {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 79 2011-06-18T05:52:47Z Admin 1 /* Outgoing Data */ {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 96 2011-06-20T04:18:54Z Admin 1 /* Outgoing Data */ {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 97 2011-06-20T04:20:06Z Admin 1 /* Incoming Data */ {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 98 2011-06-20T04:20:44Z Admin 1 {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) - it is said that #202's protocol is identical to #204. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 99 2011-06-20T04:21:45Z Admin 1 {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 121 2011-06-20T04:53:47Z Admin 1 [[Category:RSC]] This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 255 2011-07-11T13:54:53Z Moparisthebest 8 /* Packet structure */ [[Category:RSC]] This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet struc ture''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 256 2011-07-11T13:55:07Z Moparisthebest 8 /* Packet struc ture */ [[Category:RSC]] This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 39 // acknowledge logout command from server #define IDO_PING 153 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 25 // add name to ignore list #define IDO_IGNORE_REMOVE 108 // remove name from ignore list #define IDO_FRIENDS_ADD 168 // add name to friends list #define IDO_FRIENDS_REMOVE 52 // remove name from friends list #define IDO_PM_FRIEND 254 // send pm to someone in friends list #define IDO_SEND_CHAT 145 #define IDO_SEND_SERVER_CMD 90 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 176 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 129 #define IDO_CHAR_DESIGN 218 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 72 #define IDO_NEW_PLAYER_ACK 83 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 156 #define IDO_WALKCMD_1 246 #define IDO_WALKCMD_2 132 #define IDO_CLICKDIALOGITEM 154 #define IDO_SETCOMBATSTYLE 41 #define IDO_WITHDRAW 183 #define IDO_DEPOSIT 198 #define IDO_CLOSE_BANK 48 #define IDO_BUYITEM 128 #define IDO_SELLITEM 255 #define IDO_CLOSE_SHOP 253 #define IDO_CANCEL_TRADE 216 #define IDO_CONFIRM_TRADE 53 #define IDO_TRADE_UPDATE 70 #define IDO_ACCEPT_TRADE 211 #define IDO_DUEL_CONFIRM_1 87 #define IDO_DUEL_UPDATE 123 #define IDO_DUEL_FLAG_1 225 #define IDO_DUEL_FLAG_2 252 #define IDO_CANCEL_DUEL 35 #define IDO_PRAYER_OFF 248 #define IDO_PRAYER_ON 56 #define IDO_CHANGE_SETTINGS 157 // action commands... #define IDO_CAST_GR_ITEM 104 #define IDO_USEWITH_GR_ITEM 34 #define IDO_TAKE_ITEM 245 #define IDO_CAST_WALLOBJ 67 #define IDO_USEWITH_WALLOBJ 36 #define IDO_WALLOBJ_CMD1 126 #define IDO_WALLOBJ_CMD2 235 #define IDO_CAST_OBJECT 17 #define IDO_USEWITH_OBJECT 94 #define IDO_OBJECT_CMD1 51 #define IDO_OBJECT_CMD2 40 #define IDO_CAST_INVITEM 49 #define IDO_USEWITH_INVITEM 27 #define IDO_REMOVE_ITEM 92 #define IDO_WEAR_ITEM 181 #define IDO_INVITEM_CMD 89 #define IDO_DROP_ITEM 147 #define IDO_CAST_NPC 71 #define IDO_USEWITH_NPC 142 #define IDO_TALK_NPC 177 #define IDO_NPC_CMD 74 #define IDO_ATTACK_NPC 73 #define IDO_CAST_PLAYER 55 #define IDO_USEWITH_PLAYER 16 #define IDO_ATTACK_PLAYER 57 #define IDO_DUEL_PLAYER 222 #define IDO_TRADE_PLAYER 166 #define IDO_FOLLOW_PLAYER 68 #define IDO_CAST_GROUND 232 #define IDO_CAST_SELF 206 #define IDO_REPORT_ABUSE 7 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 48 // (game) messages from server #define IDI_LOGOUT 222 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 136 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 249 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 25 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 2 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 158 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 170 // someone pm'd us #define IDI_PLAYER_MOVEMENT 145 // player movement update #define IDI_GRITEMS_UPDATE 109 // update ground items #define IDI_OBJECTS_UPDATE 27 #define IDI_INV_LOAD 114 // load inventory #define IDI_PLAYER_UPDATE 53 #define IDI_WALLOBJ_UPDATE 95 #define IDI_NPC_MOVEMENT 77 // npc movement update #define IDI_NPC_UPDATE 190 #define IDI_DIALOG_SHOW 223 #define IDI_DIALOG_CLOSE 127 #define IDI_LOAD_NEWMAPAREA 131 // entering a new region (maparea) #define IDI_XP_LOAD 180 // load xp and stats #define IDI_EQUIP_UPDATE 177 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 165 #define IDI_LOADWORLD 115 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 207 #define IDI_OPEN_TRADE_1 4 #define IDI_CLOSE_TRADE 187 #define IDI_TRADE_UPDATE 250 // opponents offer was updated #define IDI_TRADE_B_UPDATE 92 // update of opponents acception status #define IDI_SHOP_OPEN 253 #define IDI_SHOP_CLOSE 220 #define IDI_TRADE_A_UPDATE 18 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 152 // camera angle, sound, mousebutton settings #define IDI_PRAYER 209 #define IDI_QUESTS 224 #define IDI_BANK_OPEN 93 #define IDI_BANK_CLOSE 171 #define IDI_XP_UPDATE 211 #define IDI_OPEN_DUEL_1 229 #define IDI_CLOSE_DUEL 160 #define IDI_OPEN_TRADE_2 251 // trade confirmation window #define IDI_DUEL_UPDATE 63 // opponents offer was updated #define IDI_DUELOPT_UPDATE 198 // update duel options #define IDI_BANK_UPDATE 139 #define IDI_INV_ADD 228 #define IDI_INV_REMOVE 191 #define IDI_STAT_UPDATE 208 #define IDI_DUEL_B_UPDATE 65 // update of opponents acception status #define IDI_DUEL_A_UPDATE 197 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 147 // duel confirmation window #define IDI_SOUND 11 #define IDI_SPLASH 23 #define IDI_WELCOMEWINDOW 248 #define IDI_MESSAGE_1 148 #define IDI_MESSAGE_2 64 #define IDI_FATIGUE_UPDATE 126 #define IDI_NEW_SLEEPWORD 219 #define IDI_FATIGUE_SLEEPN 168 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 103 #define IDI_SLEEP_FAILED 15 #define IDI_SYSTEM_UPDATE 172 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 204 Items 0 24 nv0fgeetl0uus9c4f7elijk4smtl2g5 111 2011-06-20T04:45:32Z Admin 1 Created page with "<table border="1" cellpadding="3" cellspacing="3"> <tr><td></td><td>id</td><td>item name</td><td>description</td><td>wieldable</td><td>stackable</td></tr> <tr><td><0.png></td><..." <table border="1" cellpadding="3" cellspacing="3"> <tr><td></td><td>id</td><td>item name</td><td>description</td><td>wieldable</td><td>stackable</td></tr> <tr><td><0.png></td><td>0</td><td>Iron Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><1.png></td><td>1</td><td>Iron Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><2.png></td><td>2</td><td>Iron Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><3.png></td><td>3</td><td>Iron Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><4.png></td><td>4</td><td>Wooden Shield</td><td>A solid wooden shield</td><td>X</td><td>-</td></tr> <tr><td><5.png></td><td>5</td><td>Medium Iron Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><6.png></td><td>6</td><td>Large Iron Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><7.png></td><td>7</td><td>Iron Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><8.png></td><td>8</td><td>Iron Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><9.png></td><td>9</td><td>Iron Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><10.png></td><td>10</td><td>Coins</td><td>Lovely money!</td><td>-</td><td>X</td></tr> <tr><td><11.png></td><td>11</td><td>Bronze Arrows</td><td>Arrows with bronze heads</td><td>-</td><td>X</td></tr> <tr><td><12.png></td><td>12</td><td>Iron Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><13.png></td><td>13</td><td>Knife</td><td>A dangerous looking knife</td><td>-</td><td>-</td></tr> <tr><td><14.png></td><td>14</td><td>Logs</td><td>A number of wooden logs</td><td>-</td><td>-</td></tr> <tr><td><15.png></td><td>15</td><td>Leather Armour</td><td>Better than no armour!</td><td>X</td><td>-</td></tr> <tr><td><16.png></td><td>16</td><td>Leather Gloves</td><td>These will keep my hands warm!</td><td>X</td><td>-</td></tr> <tr><td><17.png></td><td>17</td><td>Boots</td><td>Comfortable leather boots</td><td>X</td><td>-</td></tr> <tr><td><18.png></td><td>18</td><td>Cabbage</td><td>Yuck I don't like cabbage</td><td>-</td><td>-</td></tr> <tr><td><19.png></td><td>19</td><td>Egg</td><td>A nice fresh egg</td><td>-</td><td>-</td></tr> <tr><td><20.png></td><td>20</td><td>Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><21.png></td><td>21</td><td>Bucket</td><td>It's a wooden bucket</td><td>-</td><td>-</td></tr> <tr><td><22.png></td><td>22</td><td>Milk</td><td>It's a bucket of milk</td><td>-</td><td>-</td></tr> <tr><td><23.png></td><td>23</td><td>Flour</td><td>A little heap of flour</td><td>-</td><td>-</td></tr> <tr><td><24.png></td><td>24</td><td>Amulet of GhostSpeak</td><td>It lets me talk to ghosts</td><td>X</td><td>-</td></tr> <tr><td><25.png></td><td>25</td><td>Silverlight key 1</td><td>A key given to me by Wizard Traiborn</td><td>-</td><td>-</td></tr> <tr><td><26.png></td><td>26</td><td>Silverlight key 2</td><td>A key given to me by Captain Rovin</td><td>-</td><td>-</td></tr> <tr><td><27.png></td><td>27</td><td>skull</td><td>A spooky looking skull</td><td>-</td><td>-</td></tr> <tr><td><28.png></td><td>28</td><td>Iron dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><29.png></td><td>29</td><td>grain</td><td>Some wheat heads</td><td>-</td><td>-</td></tr> <tr><td><30.png></td><td>30</td><td>Book</td><td></td><td>-</td><td>-</td></tr> <tr><td><31.png></td><td>31</td><td>Fire-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><32.png></td><td>32</td><td>Water-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><33.png></td><td>33</td><td>Air-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><34.png></td><td>34</td><td>Earth-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><35.png></td><td>35</td><td>Mind-Rune</td><td>Used for low level missile spells</td><td>-</td><td>X</td></tr> <tr><td><36.png></td><td>36</td><td>Body-Rune</td><td>Used for curse spells</td><td>-</td><td>X</td></tr> <tr><td><37.png></td><td>37</td><td>Life-Rune</td><td>Used for summon spells</td><td>-</td><td>X</td></tr> <tr><td><38.png></td><td>38</td><td>Death-Rune</td><td>Used for high level missile spells</td><td>-</td><td>X</td></tr> <tr><td><39.png></td><td>39</td><td>Needle</td><td>Used with a thread to make clothes</td><td>-</td><td>X</td></tr> <tr><td><40.png></td><td>40</td><td>Nature-Rune</td><td>Used for alchemy spells</td><td>-</td><td>X</td></tr> <tr><td><41.png></td><td>41</td><td>Chaos-Rune</td><td>Used for mid level missile spells</td><td>-</td><td>X</td></tr> <tr><td><42.png></td><td>42</td><td>Law-Rune</td><td>Used for teleport spells</td><td>-</td><td>X</td></tr> <tr><td><43.png></td><td>43</td><td>Thread</td><td>Used with a needle to make clothes</td><td>-</td><td>X</td></tr> <tr><td><44.png></td><td>44</td><td>Holy Symbol of saradomin</td><td>This needs a string putting on it</td><td>-</td><td>-</td></tr> <tr><td><45.png></td><td>45</td><td>Unblessed Holy Symbol</td><td>This needs blessing</td><td>X</td><td>-</td></tr> <tr><td><46.png></td><td>46</td><td>Cosmic-Rune</td><td>Used for enchant spells</td><td>-</td><td>X</td></tr> <tr><td><47.png></td><td>47</td><td>key</td><td>The key to get into the phoenix gang</td><td>-</td><td>-</td></tr> <tr><td><48.png></td><td>48</td><td>key</td><td>The key to the phoenix gang's weapons store</td><td>-</td><td>-</td></tr> <tr><td><49.png></td><td>49</td><td>scroll</td><td>An intelligence Report</td><td>-</td><td>-</td></tr> <tr><td><50.png></td><td>50</td><td>Water</td><td>It's a bucket of water</td><td>-</td><td>-</td></tr> <tr><td><51.png></td><td>51</td><td>Silverlight key 3</td><td>A key I found in a drain</td><td>-</td><td>-</td></tr> <tr><td><52.png></td><td>52</td><td>Silverlight</td><td>A magic sword</td><td>X</td><td>-</td></tr> <tr><td><53.png></td><td>53</td><td>Broken shield</td><td>Half of the shield of Arrav</td><td>-</td><td>-</td></tr> <tr><td><54.png></td><td>54</td><td>Broken shield</td><td>Half of the shield of Arrav</td><td>-</td><td>-</td></tr> <tr><td><55.png></td><td>55</td><td>Cadavaberries</td><td>Poisonous berries</td><td>-</td><td>-</td></tr> <tr><td><56.png></td><td>56</td><td>message</td><td>A message from Juliet to Romeo</td><td>-</td><td>-</td></tr> <tr><td><57.png></td><td>57</td><td>Cadava</td><td>I'm meant to give this to Juliet</td><td>-</td><td>-</td></tr> <tr><td><58.png></td><td>58</td><td>potion</td><td>this is meant to be good for spots</td><td>-</td><td>-</td></tr> <tr><td><59.png></td><td>59</td><td>Phoenix Crossbow</td><td>Former property of the phoenix gang</td><td>X</td><td>-</td></tr> <tr><td><60.png></td><td>60</td><td>Crossbow</td><td>This fires crossbow bolts</td><td>X</td><td>-</td></tr> <tr><td><61.png></td><td>61</td><td>Certificate</td><td>I can use this to claim a reward from the king</td><td>-</td><td>-</td></tr> <tr><td><62.png></td><td>62</td><td>bronze dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><63.png></td><td>63</td><td>Steel dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><64.png></td><td>64</td><td>Mithril dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><65.png></td><td>65</td><td>Adamantite dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><66.png></td><td>66</td><td>Bronze Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><67.png></td><td>67</td><td>Steel Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><68.png></td><td>68</td><td>Mithril Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><69.png></td><td>69</td><td>Adamantite Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><70.png></td><td>70</td><td>Bronze Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><71.png></td><td>71</td><td>Iron Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><72.png></td><td>72</td><td>Steel Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><73.png></td><td>73</td><td>Mithril Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><74.png></td><td>74</td><td>Adamantite Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><75.png></td><td>75</td><td>Rune long sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><76.png></td><td>76</td><td>Bronze 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><77.png></td><td>77</td><td>Iron 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><78.png></td><td>78</td><td>Steel 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><79.png></td><td>79</td><td>Mithril 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><80.png></td><td>80</td><td>Adamantite 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><81.png></td><td>81</td><td>rune 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><82.png></td><td>82</td><td>Bronze Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><83.png></td><td>83</td><td>Iron Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><84.png></td><td>84</td><td>Steel Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><85.png></td><td>85</td><td>Mithril Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><86.png></td><td>86</td><td>Adamantite Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><87.png></td><td>87</td><td>bronze Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><88.png></td><td>88</td><td>Steel Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><89.png></td><td>89</td><td>Iron battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><90.png></td><td>90</td><td>Steel battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><91.png></td><td>91</td><td>Mithril battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><92.png></td><td>92</td><td>Adamantite battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><93.png></td><td>93</td><td>Rune battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><94.png></td><td>94</td><td>Bronze Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><95.png></td><td>95</td><td>Steel Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><96.png></td><td>96</td><td>Mithril Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><97.png></td><td>97</td><td>Adamantite Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><98.png></td><td>98</td><td>Rune Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><99.png></td><td>99</td><td>Brass key</td><td>I wonder what this is the key to</td><td>-</td><td>-</td></tr> <tr><td><100.png></td><td>100</td><td>staff</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><101.png></td><td>101</td><td>Staff of Air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><102.png></td><td>102</td><td>Staff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><103.png></td><td>103</td><td>Staff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><104.png></td><td>104</td><td>Medium Bronze Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><105.png></td><td>105</td><td>Medium Steel Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><106.png></td><td>106</td><td>Medium Mithril Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><107.png></td><td>107</td><td>Medium Adamantite Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><108.png></td><td>108</td><td>Large Bronze Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><109.png></td><td>109</td><td>Large Steel Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><110.png></td><td>110</td><td>Large Mithril Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><111.png></td><td>111</td><td>Large Adamantite Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><112.png></td><td>112</td><td>Large Rune Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><113.png></td><td>113</td><td>Bronze Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><114.png></td><td>114</td><td>Steel Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><115.png></td><td>115</td><td>Mithril Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><116.png></td><td>116</td><td>Adamantite Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><117.png></td><td>117</td><td>Bronze Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><118.png></td><td>118</td><td>Steel Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><119.png></td><td>119</td><td>Mithril Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><120.png></td><td>120</td><td>Adamantite Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><121.png></td><td>121</td><td>Steel Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><122.png></td><td>122</td><td>Mithril Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><123.png></td><td>123</td><td>Adamantite Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><124.png></td><td>124</td><td>Bronze Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><125.png></td><td>125</td><td>Steel Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><126.png></td><td>126</td><td>Mithril Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><127.png></td><td>127</td><td>Adamantite Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><128.png></td><td>128</td><td>Bronze Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><129.png></td><td>129</td><td>Steel Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><130.png></td><td>130</td><td>Mithril Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><131.png></td><td>131</td><td>Adamantite Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><132.png></td><td>132</td><td>cookedmeat</td><td>Mmm this looks tasty</td><td>-</td><td>-</td></tr> <tr><td><133.png></td><td>133</td><td>raw chicken</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><134.png></td><td>134</td><td>burntmeat</td><td>Oh dear</td><td>-</td><td>-</td></tr> <tr><td><135.png></td><td>135</td><td>pot</td><td>This pot is empty</td><td>-</td><td>-</td></tr> <tr><td><136.png></td><td>136</td><td>flour</td><td>There is flour in this pot</td><td>-</td><td>-</td></tr> <tr><td><137.png></td><td>137</td><td>bread dough</td><td>Some uncooked dough</td><td>-</td><td>-</td></tr> <tr><td><138.png></td><td>138</td><td>bread</td><td>Nice crispy bread</td><td>-</td><td>-</td></tr> <tr><td><139.png></td><td>139</td><td>burntbread</td><td>This bread is ruined!</td><td>-</td><td>-</td></tr> <tr><td><140.png></td><td>140</td><td>jug</td><td>This jug is empty</td><td>-</td><td>-</td></tr> <tr><td><141.png></td><td>141</td><td>water</td><td>It's full of water</td><td>-</td><td>-</td></tr> <tr><td><142.png></td><td>142</td><td>wine</td><td>It's full of wine</td><td>-</td><td>-</td></tr> <tr><td><143.png></td><td>143</td><td>grapes</td><td>Good grapes for wine making</td><td>-</td><td>-</td></tr> <tr><td><144.png></td><td>144</td><td>shears</td><td>For shearing sheep</td><td>-</td><td>-</td></tr> <tr><td><145.png></td><td>145</td><td>wool</td><td>I think this came from a sheep</td><td>-</td><td>-</td></tr> <tr><td><146.png></td><td>146</td><td>fur</td><td>This would make warm clothing</td><td>-</td><td>-</td></tr> <tr><td><147.png></td><td>147</td><td>cow hide</td><td>I should take this to the tannery</td><td>-</td><td>-</td></tr> <tr><td><148.png></td><td>148</td><td>leather</td><td>It's a piece of leather</td><td>-</td><td>-</td></tr> <tr><td><149.png></td><td>149</td><td>clay</td><td>Some hard dry clay</td><td>-</td><td>-</td></tr> <tr><td><150.png></td><td>150</td><td>copper ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><151.png></td><td>151</td><td>iron ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><152.png></td><td>152</td><td>gold</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><153.png></td><td>153</td><td>mithril ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><154.png></td><td>154</td><td>adamantite ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><155.png></td><td>155</td><td>coal</td><td>hmm a non-renewable energy source!</td><td>-</td><td>-</td></tr> <tr><td><156.png></td><td>156</td><td>Bronze Pickaxe</td><td>Used for mining</td><td>-</td><td>-</td></tr> <tr><td><157.png></td><td>157</td><td>uncut diamond</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><158.png></td><td>158</td><td>uncut ruby</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><159.png></td><td>159</td><td>uncut emerald</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><160.png></td><td>160</td><td>uncut sapphire</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><161.png></td><td>161</td><td>diamond</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><162.png></td><td>162</td><td>ruby</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><163.png></td><td>163</td><td>emerald</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><164.png></td><td>164</td><td>sapphire</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><165.png></td><td>165</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><166.png></td><td>166</td><td>tinderbox</td><td>useful for lighting a fire</td><td>-</td><td>-</td></tr> <tr><td><167.png></td><td>167</td><td>chisel</td><td>good for detailed crafting</td><td>-</td><td>-</td></tr> <tr><td><168.png></td><td>168</td><td>hammer</td><td>good for hitting things!</td><td>-</td><td>-</td></tr> <tr><td><169.png></td><td>169</td><td>bronze bar</td><td>it's a bar of bronze</td><td>-</td><td>-</td></tr> <tr><td><170.png></td><td>170</td><td>iron bar</td><td>it's a bar of iron</td><td>-</td><td>-</td></tr> <tr><td><171.png></td><td>171</td><td>steel bar</td><td>it's a bar of steel</td><td>-</td><td>-</td></tr> <tr><td><172.png></td><td>172</td><td>gold bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><173.png></td><td>173</td><td>mithril bar</td><td>it's a bar of mithril</td><td>-</td><td>-</td></tr> <tr><td><174.png></td><td>174</td><td>adamantite bar</td><td>it's a bar of adamantite</td><td>-</td><td>-</td></tr> <tr><td><175.png></td><td>175</td><td>Pressure gauge</td><td>It looks like part of a machine</td><td>-</td><td>-</td></tr> <tr><td><176.png></td><td>176</td><td>Fish Food</td><td>Keeps your pet fish strong and healthy</td><td>-</td><td>-</td></tr> <tr><td><177.png></td><td>177</td><td>Poison</td><td>This stuff looks nasty</td><td>-</td><td>-</td></tr> <tr><td><178.png></td><td>178</td><td>Poisoned fish food</td><td>Doesn't seem very nice to the poor fishes</td><td>-</td><td>-</td></tr> <tr><td><179.png></td><td>179</td><td>spinach roll</td><td>A home made spinach thing</td><td>-</td><td>-</td></tr> <tr><td><180.png></td><td>180</td><td>Bad wine</td><td>Oh dear</td><td>-</td><td>-</td></tr> <tr><td><181.png></td><td>181</td><td>Ashes</td><td>A heap of ashes</td><td>-</td><td>-</td></tr> <tr><td><182.png></td><td>182</td><td>Apron</td><td>A mostly clean apron</td><td>X</td><td>-</td></tr> <tr><td><183.png></td><td>183</td><td>Cape</td><td>A bright red cape</td><td>X</td><td>-</td></tr> <tr><td><184.png></td><td>184</td><td>Wizards robe</td><td>I can do magic better in this</td><td>X</td><td>-</td></tr> <tr><td><185.png></td><td>185</td><td>wizardshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><186.png></td><td>186</td><td>Brass necklace</td><td>I'd prefer a gold one</td><td>X</td><td>-</td></tr> <tr><td><187.png></td><td>187</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><188.png></td><td>188</td><td>Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><189.png></td><td>189</td><td>Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><190.png></td><td>190</td><td>Crossbow bolts</td><td>Good if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><191.png></td><td>191</td><td>Apron</td><td>this will help keep my clothes clean</td><td>X</td><td>-</td></tr> <tr><td><192.png></td><td>192</td><td>Chef's hat</td><td>What a silly hat</td><td>X</td><td>-</td></tr> <tr><td><193.png></td><td>193</td><td>Beer</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><194.png></td><td>194</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><195.png></td><td>195</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><196.png></td><td>196</td><td>Black Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><197.png></td><td>197</td><td>Staff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><198.png></td><td>198</td><td>Magic Staff</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><199.png></td><td>199</td><td>wizardshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><200.png></td><td>200</td><td>silk</td><td>It's a sheet of silk</td><td>-</td><td>-</td></tr> <tr><td><201.png></td><td>201</td><td>flier</td><td>Get your axes from Bob's axes</td><td>-</td><td>-</td></tr> <tr><td><202.png></td><td>202</td><td>tin ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><203.png></td><td>203</td><td>Mithril Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><204.png></td><td>204</td><td>Adamantite Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><205.png></td><td>205</td><td>bronze battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><206.png></td><td>206</td><td>Bronze Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><207.png></td><td>207</td><td>Ball of wool</td><td>Spun from sheeps wool</td><td>-</td><td>-</td></tr> <tr><td><208.png></td><td>208</td><td>Oil can</td><td>Its pretty full</td><td>-</td><td>-</td></tr> <tr><td><209.png></td><td>209</td><td>Cape</td><td>A warm black cape</td><td>X</td><td>-</td></tr> <tr><td><210.png></td><td>210</td><td>Kebab</td><td>A meaty Kebab</td><td>-</td><td>-</td></tr> <tr><td><211.png></td><td>211</td><td>Spade</td><td>A fairly small spade</td><td>-</td><td>-</td></tr> <tr><td><212.png></td><td>212</td><td>Closet Key</td><td>A slightly smelly key</td><td>-</td><td>-</td></tr> <tr><td><213.png></td><td>213</td><td>rubber tube</td><td>Its slightly charred</td><td>-</td><td>-</td></tr> <tr><td><214.png></td><td>214</td><td>Bronze Plated Skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><215.png></td><td>215</td><td>Iron Plated Skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><216.png></td><td>216</td><td>Black robe</td><td>I can do magic better in this</td><td>X</td><td>-</td></tr> <tr><td><217.png></td><td>217</td><td>stake</td><td>A very pointy stick</td><td>X</td><td>-</td></tr> <tr><td><218.png></td><td>218</td><td>Garlic</td><td>A clove of garlic</td><td>-</td><td>-</td></tr> <tr><td><219.png></td><td>219</td><td>Red spiders eggs</td><td>eewww</td><td>-</td><td>-</td></tr> <tr><td><220.png></td><td>220</td><td>Limpwurt root</td><td>the root of a limpwurt plant</td><td>-</td><td>-</td></tr> <tr><td><221.png></td><td>221</td><td>Strength Potion</td><td>4 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><222.png></td><td>222</td><td>Strength Potion</td><td>3 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><223.png></td><td>223</td><td>Strength Potion</td><td>2 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><224.png></td><td>224</td><td>Strength Potion</td><td>1 dose of strength potion</td><td>-</td><td>-</td></tr> <tr><td><225.png></td><td>225</td><td>Steel Plated skirt</td><td>designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><226.png></td><td>226</td><td>Mithril Plated skirt</td><td>Designer Leg protection</td><td>X</td><td>-</td></tr> <tr><td><227.png></td><td>227</td><td>Adamantite Plated skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><228.png></td><td>228</td><td>Cabbage</td><td>Yuck I don't like cabbage</td><td>-</td><td>-</td></tr> <tr><td><229.png></td><td>229</td><td>Cape</td><td>A thick blue cape</td><td>X</td><td>-</td></tr> <tr><td><230.png></td><td>230</td><td>Large Black Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><231.png></td><td>231</td><td>Red Bead</td><td>A small round red bead</td><td>-</td><td>-</td></tr> <tr><td><232.png></td><td>232</td><td>Yellow Bead</td><td>A small round yellow bead</td><td>-</td><td>-</td></tr> <tr><td><233.png></td><td>233</td><td>Black Bead</td><td>A small round black bead</td><td>-</td><td>-</td></tr> <tr><td><234.png></td><td>234</td><td>White Bead</td><td>A small round white bead</td><td>-</td><td>-</td></tr> <tr><td><235.png></td><td>235</td><td>Amulet of accuracy</td><td>It increases my aim</td><td>X</td><td>-</td></tr> <tr><td><236.png></td><td>236</td><td>Redberries</td><td>Very bright red berries</td><td>-</td><td>-</td></tr> <tr><td><237.png></td><td>237</td><td>Rope</td><td>A Coil of rope</td><td>-</td><td>-</td></tr> <tr><td><238.png></td><td>238</td><td>Reddye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><239.png></td><td>239</td><td>Yellowdye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><240.png></td><td>240</td><td>Paste</td><td>A bottle off skin coloured paste</td><td>-</td><td>-</td></tr> <tr><td><241.png></td><td>241</td><td>Onion</td><td>A strong smelling onion</td><td>-</td><td>-</td></tr> <tr><td><242.png></td><td>242</td><td>Bronze key</td><td>A heavy key</td><td>-</td><td>-</td></tr> <tr><td><243.png></td><td>243</td><td>Soft Clay</td><td>Clay that's ready to be used</td><td>-</td><td>-</td></tr> <tr><td><244.png></td><td>244</td><td>wig</td><td>A blonde wig</td><td>-</td><td>-</td></tr> <tr><td><245.png></td><td>245</td><td>wig</td><td>A wig made from wool</td><td>-</td><td>-</td></tr> <tr><td><246.png></td><td>246</td><td>Half full wine jug</td><td>It's half full of wine</td><td>-</td><td>-</td></tr> <tr><td><247.png></td><td>247</td><td>Keyprint</td><td>An imprint of a key in a lump of clay</td><td>-</td><td>-</td></tr> <tr><td><248.png></td><td>248</td><td>Black Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><249.png></td><td>249</td><td>banana</td><td>Mmm this looks tasty</td><td>-</td><td>-</td></tr> <tr><td><250.png></td><td>250</td><td>pastry dough</td><td>Some uncooked dough</td><td>-</td><td>-</td></tr> <tr><td><251.png></td><td>251</td><td>Pie dish</td><td>For making pies in</td><td>-</td><td>-</td></tr> <tr><td><252.png></td><td>252</td><td>cooking apple</td><td>I wonder what i can make with this</td><td>-</td><td>-</td></tr> <tr><td><253.png></td><td>253</td><td>pie shell</td><td>I need to find a filling for this pie</td><td>-</td><td>-</td></tr> <tr><td><254.png></td><td>254</td><td>Uncooked apple pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><255.png></td><td>255</td><td>Uncooked meat pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><256.png></td><td>256</td><td>Uncooked redberry pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><257.png></td><td>257</td><td>apple pie</td><td>Mmm Apple pie</td><td>-</td><td>-</td></tr> <tr><td><258.png></td><td>258</td><td>Redberry pie</td><td>Looks tasty</td><td>-</td><td>-</td></tr> <tr><td><259.png></td><td>259</td><td>meat pie</td><td>Mighty and meaty</td><td>-</td><td>-</td></tr> <tr><td><260.png></td><td>260</td><td>burntpie</td><td>Oops</td><td>-</td><td>-</td></tr> <tr><td><261.png></td><td>261</td><td>Half a meat pie</td><td>Mighty and meaty</td><td>-</td><td>-</td></tr> <tr><td><262.png></td><td>262</td><td>Half a Redberry pie</td><td>Looks tasty</td><td>-</td><td>-</td></tr> <tr><td><263.png></td><td>263</td><td>Half an apple pie</td><td>Mmm Apple pie</td><td>-</td><td>-</td></tr> <tr><td><264.png></td><td>264</td><td>Portrait</td><td>It's a picture of a knight</td><td>-</td><td>-</td></tr> <tr><td><265.png></td><td>265</td><td>Faladian Knight's sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><266.png></td><td>266</td><td>blurite ore</td><td>What Strange stuff</td><td>-</td><td>-</td></tr> <tr><td><267.png></td><td>267</td><td>Asgarnian Ale</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><268.png></td><td>268</td><td>Wizard's Mind Bomb</td><td>It's got strange bubbles in it</td><td>-</td><td>-</td></tr> <tr><td><269.png></td><td>269</td><td>Dwarven Stout</td><td>A Pint of thick dark beer</td><td>-</td><td>-</td></tr> <tr><td><270.png></td><td>270</td><td>Eye of newt</td><td>It seems to be looking at me</td><td>-</td><td>-</td></tr> <tr><td><271.png></td><td>271</td><td>Rat's tail</td><td>A bit of rat</td><td>-</td><td>-</td></tr> <tr><td><272.png></td><td>272</td><td>Bluedye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><273.png></td><td>273</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><274.png></td><td>274</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><275.png></td><td>275</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><276.png></td><td>276</td><td>unstrung Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><277.png></td><td>277</td><td>unstrung shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><278.png></td><td>278</td><td>Unfired Pie dish</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><279.png></td><td>279</td><td>unfired pot</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><280.png></td><td>280</td><td>arrow shafts</td><td>I need to attach feathers to these</td><td>-</td><td>X</td></tr> <tr><td><281.png></td><td>281</td><td>Woad Leaf</td><td>slightly bluish leaves</td><td>-</td><td>X</td></tr> <tr><td><282.png></td><td>282</td><td>Orangedye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><283.png></td><td>283</td><td>Gold ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><284.png></td><td>284</td><td>Sapphire ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><285.png></td><td>285</td><td>Emerald ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><286.png></td><td>286</td><td>Ruby ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><287.png></td><td>287</td><td>Diamond ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><288.png></td><td>288</td><td>Gold necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><289.png></td><td>289</td><td>Sapphire necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><290.png></td><td>290</td><td>Emerald necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><291.png></td><td>291</td><td>Ruby necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><292.png></td><td>292</td><td>Diamond necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><293.png></td><td>293</td><td>ring mould</td><td>Used to make gold rings</td><td>-</td><td>-</td></tr> <tr><td><294.png></td><td>294</td><td>Amulet mould</td><td>Used to make gold amulets</td><td>-</td><td>-</td></tr> <tr><td><295.png></td><td>295</td><td>Necklace mould</td><td>Used to make gold necklaces</td><td>-</td><td>-</td></tr> <tr><td><296.png></td><td>296</td><td>Gold Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><297.png></td><td>297</td><td>Sapphire Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><298.png></td><td>298</td><td>Emerald Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><299.png></td><td>299</td><td>Ruby Amulet</td><td>It needs a string so I can make wear it</td><td>-</td><td>-</td></tr> <tr><td><300.png></td><td>300</td><td>Diamond Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><301.png></td><td>301</td><td>Gold Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><302.png></td><td>302</td><td>Sapphire Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><303.png></td><td>303</td><td>Emerald Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><304.png></td><td>304</td><td>Ruby Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><305.png></td><td>305</td><td>Diamond Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><306.png></td><td>306</td><td>superchisel</td><td>I wonder if I can get this enchanted</td><td>-</td><td>-</td></tr> <tr><td><307.png></td><td>307</td><td>Mace of Zamorak</td><td>This mace gives me the creeps</td><td>X</td><td>-</td></tr> <tr><td><308.png></td><td>308</td><td>Bronze Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><309.png></td><td>309</td><td>Steel Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><310.png></td><td>310</td><td>Mithril Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><311.png></td><td>311</td><td>Adamantite Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><312.png></td><td>312</td><td>Iron Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><313.png></td><td>313</td><td>Black Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><314.png></td><td>314</td><td>Sapphire Amulet of magic</td><td>It improves my magic</td><td>X</td><td>-</td></tr> <tr><td><315.png></td><td>315</td><td>Emerald Amulet of protection</td><td>It improves my defense</td><td>X</td><td>-</td></tr> <tr><td><316.png></td><td>316</td><td>Ruby Amulet of strength</td><td>It improves my damage</td><td>X</td><td>-</td></tr> <tr><td><317.png></td><td>317</td><td>Diamond Amulet of power</td><td>A powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><318.png></td><td>318</td><td>Karamja Rum</td><td>A very strong spirit brewed in Karamja</td><td>-</td><td>-</td></tr> <tr><td><319.png></td><td>319</td><td>Cheese</td><td>It's got holes in it</td><td>-</td><td>-</td></tr> <tr><td><320.png></td><td>320</td><td>Tomato</td><td>This would make good ketchup</td><td>-</td><td>-</td></tr> <tr><td><321.png></td><td>321</td><td>Pizza Base</td><td>I need to add some tomato next</td><td>-</td><td>-</td></tr> <tr><td><322.png></td><td>322</td><td>Burnt Pizza</td><td>Oh dear!</td><td>-</td><td>-</td></tr> <tr><td><323.png></td><td>323</td><td>Incomplete Pizza</td><td>I need to add some cheese next</td><td>-</td><td>-</td></tr> <tr><td><324.png></td><td>324</td><td>Uncooked Pizza</td><td>This needs cooking</td><td>-</td><td>-</td></tr> <tr><td><325.png></td><td>325</td><td>Plain Pizza</td><td>A cheese and tomato pizza</td><td>-</td><td>-</td></tr> <tr><td><326.png></td><td>326</td><td>Meat Pizza</td><td>A pizza with bits of meat on it</td><td>-</td><td>-</td></tr> <tr><td><327.png></td><td>327</td><td>Anchovie Pizza</td><td>A Pizza with Anchovies</td><td>-</td><td>-</td></tr> <tr><td><328.png></td><td>328</td><td>Half Meat Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><329.png></td><td>329</td><td>Half Anchovie Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><330.png></td><td>330</td><td>Cake</td><td>A plain sponge cake</td><td>-</td><td>-</td></tr> <tr><td><331.png></td><td>331</td><td>Burnt Cake</td><td>Argh what a mess!</td><td>-</td><td>-</td></tr> <tr><td><332.png></td><td>332</td><td>Chocolate Cake</td><td>This looks very tasty!</td><td>-</td><td>-</td></tr> <tr><td><333.png></td><td>333</td><td>Partial Cake</td><td>Someone has eaten a big chunk of this cake</td><td>-</td><td>-</td></tr> <tr><td><334.png></td><td>334</td><td>Partial Chocolate Cake</td><td>Someone has eaten a big chunk of this cake</td><td>-</td><td>-</td></tr> <tr><td><335.png></td><td>335</td><td>Slice of Cake</td><td>I'd rather have a whole cake!</td><td>-</td><td>-</td></tr> <tr><td><336.png></td><td>336</td><td>Chocolate Slice</td><td>A slice of chocolate cake</td><td>-</td><td>-</td></tr> <tr><td><337.png></td><td>337</td><td>Chocolate Bar</td><td>It's a bar of chocolate</td><td>-</td><td>-</td></tr> <tr><td><338.png></td><td>338</td><td>Cake Tin</td><td>Useful for baking cakes</td><td>-</td><td>-</td></tr> <tr><td><339.png></td><td>339</td><td>Uncooked cake</td><td>Now all I need to do is cook it</td><td>-</td><td>-</td></tr> <tr><td><340.png></td><td>340</td><td>Unfired bowl</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><341.png></td><td>341</td><td>Bowl</td><td>Useful for mixing things</td><td>-</td><td>-</td></tr> <tr><td><342.png></td><td>342</td><td>Bowl of water</td><td>It's a bowl of water</td><td>-</td><td>-</td></tr> <tr><td><343.png></td><td>343</td><td>Incomplete stew</td><td>I need to add some meat too</td><td>-</td><td>-</td></tr> <tr><td><344.png></td><td>344</td><td>Incomplete stew</td><td>I need to add some potato too</td><td>-</td><td>-</td></tr> <tr><td><345.png></td><td>345</td><td>Uncooked stew</td><td>I need to cook this</td><td>-</td><td>-</td></tr> <tr><td><346.png></td><td>346</td><td>Stew</td><td>It's a meat and potato stew</td><td>-</td><td>-</td></tr> <tr><td><347.png></td><td>347</td><td>Burnt Stew</td><td>Eew it's horribly burnt</td><td>-</td><td>-</td></tr> <tr><td><348.png></td><td>348</td><td>Potato</td><td>Can be used to make stew</td><td>-</td><td>-</td></tr> <tr><td><349.png></td><td>349</td><td>Raw Shrimp</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><350.png></td><td>350</td><td>Shrimp</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><351.png></td><td>351</td><td>Raw Anchovies</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><352.png></td><td>352</td><td>Anchovies</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><353.png></td><td>353</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><354.png></td><td>354</td><td>Raw Sardine</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><355.png></td><td>355</td><td>Sardine</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><356.png></td><td>356</td><td>Raw Salmon</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><357.png></td><td>357</td><td>Salmon</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><358.png></td><td>358</td><td>Raw Trout</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><359.png></td><td>359</td><td>Trout</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><360.png></td><td>360</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><361.png></td><td>361</td><td>Raw Herring</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><362.png></td><td>362</td><td>Herring</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><363.png></td><td>363</td><td>Raw Pike</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><364.png></td><td>364</td><td>Pike</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><365.png></td><td>365</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><366.png></td><td>366</td><td>Raw Tuna</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><367.png></td><td>367</td><td>Tuna</td><td>Wow this is a big fish</td><td>-</td><td>-</td></tr> <tr><td><368.png></td><td>368</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><369.png></td><td>369</td><td>Raw Swordfish</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><370.png></td><td>370</td><td>Swordfish</td><td>I'd better be careful eating this!</td><td>-</td><td>-</td></tr> <tr><td><371.png></td><td>371</td><td>Burnt Swordfish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><372.png></td><td>372</td><td>Raw Lobster</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><373.png></td><td>373</td><td>Lobster</td><td>This looks tricky to eat</td><td>-</td><td>-</td></tr> <tr><td><374.png></td><td>374</td><td>Burnt Lobster</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><375.png></td><td>375</td><td>Lobster Pot</td><td>Useful for catching lobsters</td><td>-</td><td>-</td></tr> <tr><td><376.png></td><td>376</td><td>Net</td><td>Useful for catching small fish</td><td>-</td><td>-</td></tr> <tr><td><377.png></td><td>377</td><td>Fishing Rod</td><td>Useful for catching sardine or herring</td><td>-</td><td>-</td></tr> <tr><td><378.png></td><td>378</td><td>Fly Fishing Rod</td><td>Useful for catching salmon or trout</td><td>-</td><td>-</td></tr> <tr><td><379.png></td><td>379</td><td>Harpoon</td><td>Useful for catching really big fish</td><td>-</td><td>-</td></tr> <tr><td><380.png></td><td>380</td><td>Fishing Bait</td><td>For use with a fishing rod</td><td>-</td><td>X</td></tr> <tr><td><381.png></td><td>381</td><td>Feather</td><td>Used for fly-fishing</td><td>-</td><td>X</td></tr> <tr><td><382.png></td><td>382</td><td>Chest key</td><td>A key to One eyed Hector's chest</td><td>-</td><td>-</td></tr> <tr><td><383.png></td><td>383</td><td>Silver</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><384.png></td><td>384</td><td>silver bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><385.png></td><td>385</td><td>Holy Symbol of saradomin</td><td>This improves my prayer</td><td>X</td><td>-</td></tr> <tr><td><386.png></td><td>386</td><td>Holy symbol mould</td><td>Used to make Holy Symbols</td><td>-</td><td>-</td></tr> <tr><td><387.png></td><td>387</td><td>Disk of Returning</td><td>Used to get out of Thordur's blackhole</td><td>-</td><td>-</td></tr> <tr><td><388.png></td><td>388</td><td>Monks robe</td><td>I feel closer to the God's when I am wearing this</td><td>X</td><td>-</td></tr> <tr><td><389.png></td><td>389</td><td>Monks robe</td><td>Keeps a monk's legs nice and warm</td><td>X</td><td>-</td></tr> <tr><td><390.png></td><td>390</td><td>Red key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><391.png></td><td>391</td><td>Orange Key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><392.png></td><td>392</td><td>yellow key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><393.png></td><td>393</td><td>Blue key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><394.png></td><td>394</td><td>Magenta key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><395.png></td><td>395</td><td>black key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><396.png></td><td>396</td><td>rune dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><397.png></td><td>397</td><td>Rune short sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><398.png></td><td>398</td><td>rune Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><399.png></td><td>399</td><td>Medium Rune Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><400.png></td><td>400</td><td>Rune Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><401.png></td><td>401</td><td>Rune Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><402.png></td><td>402</td><td>Rune Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><403.png></td><td>403</td><td>Rune Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><404.png></td><td>404</td><td>Rune Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><405.png></td><td>405</td><td>rune Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><406.png></td><td>406</td><td>Rune skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><407.png></td><td>407</td><td>Rune Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><408.png></td><td>408</td><td>Runite bar</td><td>it's a bar of runite</td><td>-</td><td>-</td></tr> <tr><td><409.png></td><td>409</td><td>runite ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><410.png></td><td>410</td><td>Plank</td><td>This doesn't look very useful</td><td>-</td><td>-</td></tr> <tr><td><411.png></td><td>411</td><td>Tile</td><td>This doesn't look very useful</td><td>-</td><td>-</td></tr> <tr><td><412.png></td><td>412</td><td>skull</td><td>A spooky looking skull</td><td>-</td><td>-</td></tr> <tr><td><413.png></td><td>413</td><td>Big Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><414.png></td><td>414</td><td>Muddy key</td><td>It looks like a key to a chest</td><td>-</td><td>-</td></tr> <tr><td><415.png></td><td>415</td><td>Map</td><td>A map showing the way to the Isle of Crandor</td><td>-</td><td>-</td></tr> <tr><td><416.png></td><td>416</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><417.png></td><td>417</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><418.png></td><td>418</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><419.png></td><td>419</td><td>Nails</td><td>Nails made from steel</td><td>-</td><td>X</td></tr> <tr><td><420.png></td><td>420</td><td>Anti dragon breath Shield</td><td>Helps prevent damage from dragons</td><td>X</td><td>-</td></tr> <tr><td><421.png></td><td>421</td><td>Maze key</td><td>The key to the entrance of Melzar's maze</td><td>-</td><td>-</td></tr> <tr><td><422.png></td><td>422</td><td>Pumpkin</td><td>Happy halloween</td><td>-</td><td>-</td></tr> <tr><td><423.png></td><td>423</td><td>Black dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><424.png></td><td>424</td><td>Black Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><425.png></td><td>425</td><td>Black Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><426.png></td><td>426</td><td>Black 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><427.png></td><td>427</td><td>Black Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><428.png></td><td>428</td><td>Black Axe</td><td>A sinister looking axe</td><td>X</td><td>-</td></tr> <tr><td><429.png></td><td>429</td><td>Black battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><430.png></td><td>430</td><td>Black Mace</td><td>A spikey mace</td><td>X</td><td>-</td></tr> <tr><td><431.png></td><td>431</td><td>Black Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><432.png></td><td>432</td><td>Black Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><433.png></td><td>433</td><td>Black Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><434.png></td><td>434</td><td>Black Plated skirt</td><td>designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><435.png></td><td>435</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><436.png></td><td>436</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><437.png></td><td>437</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><438.png></td><td>438</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><439.png></td><td>439</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><440.png></td><td>440</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><441.png></td><td>441</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><442.png></td><td>442</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><443.png></td><td>443</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><444.png></td><td>444</td><td>Guam leaf</td><td>A herb used in attack potion making</td><td>-</td><td>-</td></tr> <tr><td><445.png></td><td>445</td><td>Marrentill</td><td>A herb used in poison cures</td><td>-</td><td>-</td></tr> <tr><td><446.png></td><td>446</td><td>Tarromin</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><447.png></td><td>447</td><td>Harralander</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><448.png></td><td>448</td><td>Ranarr Weed</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><449.png></td><td>449</td><td>Irit Leaf</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><450.png></td><td>450</td><td>Avantoe</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><451.png></td><td>451</td><td>Kwuarm</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><452.png></td><td>452</td><td>Cadantine</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><453.png></td><td>453</td><td>Dwarf Weed</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><454.png></td><td>454</td><td>Unfinished potion</td><td>I need another ingredient to finish this Guam potion</td><td>-</td><td>-</td></tr> <tr><td><455.png></td><td>455</td><td>Unfinished potion</td><td>I need another ingredient to finish this Marrentill potion</td><td>-</td><td>-</td></tr> <tr><td><456.png></td><td>456</td><td>Unfinished potion</td><td>I need another ingredient to finish this Tarromin potion</td><td>-</td><td>-</td></tr> <tr><td><457.png></td><td>457</td><td>Unfinished potion</td><td>I need another ingredient to finish this Harralander potion</td><td>-</td><td>-</td></tr> <tr><td><458.png></td><td>458</td><td>Unfinished potion</td><td>I need another ingredient to finish this Ranarr potion</td><td>-</td><td>-</td></tr> <tr><td><459.png></td><td>459</td><td>Unfinished potion</td><td>I need another ingredient to finish this Irit potion</td><td>-</td><td>-</td></tr> <tr><td><460.png></td><td>460</td><td>Unfinished potion</td><td>I need another ingredient to finish this Avantoe potion</td><td>-</td><td>-</td></tr> <tr><td><461.png></td><td>461</td><td>Unfinished potion</td><td>I need another ingredient to finish this Kwuarm potion</td><td>-</td><td>-</td></tr> <tr><td><462.png></td><td>462</td><td>Unfinished potion</td><td>I need another ingredient to finish this Cadantine potion</td><td>-</td><td>-</td></tr> <tr><td><463.png></td><td>463</td><td>Unfinished potion</td><td>I need another ingredient to finish this Dwarfweed potion</td><td>-</td><td>-</td></tr> <tr><td><464.png></td><td>464</td><td>Vial</td><td>It's full of water</td><td>-</td><td>-</td></tr> <tr><td><465.png></td><td>465</td><td>Vial</td><td>This vial is empty</td><td>-</td><td>-</td></tr> <tr><td><466.png></td><td>466</td><td>Unicorn horn</td><td>Poor unicorn</td><td>-</td><td>-</td></tr> <tr><td><467.png></td><td>467</td><td>Blue dragon scale</td><td>A large shiny scale</td><td>-</td><td>-</td></tr> <tr><td><468.png></td><td>468</td><td>Pestle and mortar</td><td>I can grind things for potions in this</td><td>-</td><td>-</td></tr> <tr><td><469.png></td><td>469</td><td>Snape grass</td><td>Strange spikey grass</td><td>-</td><td>-</td></tr> <tr><td><470.png></td><td>470</td><td>Medium black Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><471.png></td><td>471</td><td>White berries</td><td>Poisonous berries</td><td>-</td><td>-</td></tr> <tr><td><472.png></td><td>472</td><td>Ground blue dragon scale</td><td>This stuff isn't good for you</td><td>-</td><td>-</td></tr> <tr><td><473.png></td><td>473</td><td>Ground unicorn horn</td><td>A useful potion ingredient</td><td>-</td><td>-</td></tr> <tr><td><474.png></td><td>474</td><td>attack Potion</td><td>3 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><475.png></td><td>475</td><td>attack Potion</td><td>2 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><476.png></td><td>476</td><td>attack Potion</td><td>1 dose of attack potion</td><td>-</td><td>-</td></tr> <tr><td><477.png></td><td>477</td><td>stat restoration Potion</td><td>3 doses of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><478.png></td><td>478</td><td>stat restoration Potion</td><td>2 doses of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><479.png></td><td>479</td><td>stat restoration Potion</td><td>1 dose of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><480.png></td><td>480</td><td>defense Potion</td><td>3 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><481.png></td><td>481</td><td>defense Potion</td><td>2 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><482.png></td><td>482</td><td>defense Potion</td><td>1 dose of defense potion</td><td>-</td><td>-</td></tr> <tr><td><483.png></td><td>483</td><td>restore prayer Potion</td><td>3 doses of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><484.png></td><td>484</td><td>restore prayer Potion</td><td>2 doses of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><485.png></td><td>485</td><td>restore prayer Potion</td><td>1 dose of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><486.png></td><td>486</td><td>Super attack Potion</td><td>3 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><487.png></td><td>487</td><td>Super attack Potion</td><td>2 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><488.png></td><td>488</td><td>Super attack Potion</td><td>1 dose of attack potion</td><td>-</td><td>-</td></tr> <tr><td><489.png></td><td>489</td><td>fishing Potion</td><td>3 doses of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><490.png></td><td>490</td><td>fishing Potion</td><td>2 doses of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><491.png></td><td>491</td><td>fishing Potion</td><td>1 dose of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><492.png></td><td>492</td><td>Super strength Potion</td><td>3 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><493.png></td><td>493</td><td>Super strength Potion</td><td>2 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><494.png></td><td>494</td><td>Super strength Potion</td><td>1 dose of strength potion</td><td>-</td><td>-</td></tr> <tr><td><495.png></td><td>495</td><td>Super defense Potion</td><td>3 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><496.png></td><td>496</td><td>Super defense Potion</td><td>2 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><497.png></td><td>497</td><td>Super defense Potion</td><td>1 dose of defense potion</td><td>-</td><td>-</td></tr> <tr><td><498.png></td><td>498</td><td>ranging Potion</td><td>3 doses of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><499.png></td><td>499</td><td>ranging Potion</td><td>2 doses of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><500.png></td><td>500</td><td>ranging Potion</td><td>1 dose of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><501.png></td><td>501</td><td>wine of Zamorak</td><td>It's full of wine</td><td>-</td><td>-</td></tr> <tr><td><502.png></td><td>502</td><td>raw bear meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><503.png></td><td>503</td><td>raw rat meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><504.png></td><td>504</td><td>raw beef</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><505.png></td><td>505</td><td>enchanted bear meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><506.png></td><td>506</td><td>enchanted rat meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><507.png></td><td>507</td><td>enchanted beef</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><508.png></td><td>508</td><td>enchanted chicken meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><509.png></td><td>509</td><td>Dramen Staff</td><td>A magical staff cut from the dramen tree</td><td>X</td><td>-</td></tr> <tr><td><510.png></td><td>510</td><td>Dramen Branch</td><td>I need to make this into a staff</td><td>-</td><td>-</td></tr> <tr><td><511.png></td><td>511</td><td>Cape</td><td>A thick Green cape</td><td>X</td><td>-</td></tr> <tr><td><512.png></td><td>512</td><td>Cape</td><td>A thick yellow cape</td><td>X</td><td>-</td></tr> <tr><td><513.png></td><td>513</td><td>Cape</td><td>A thick Orange cape</td><td>X</td><td>-</td></tr> <tr><td><514.png></td><td>514</td><td>Cape</td><td>A thick purple cape</td><td>X</td><td>-</td></tr> <tr><td><515.png></td><td>515</td><td>Greendye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><516.png></td><td>516</td><td>Purpledye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><517.png></td><td>517</td><td>Iron ore certificate</td><td>Each certificate exchangable at draynor market for 5 iron ore</td><td>-</td><td>X</td></tr> <tr><td><518.png></td><td>518</td><td>Coal certificate</td><td>Each certificate exchangable at draynor market for 5 coal</td><td>-</td><td>X</td></tr> <tr><td><519.png></td><td>519</td><td>Mithril ore certificate</td><td>Each certificate exchangable at draynor market for 5 mithril ore</td><td>-</td><td>X</td></tr> <tr><td><520.png></td><td>520</td><td>silver certificate</td><td>Each certificate exchangable at draynor market for 5 silver nuggets</td><td>-</td><td>X</td></tr> <tr><td><521.png></td><td>521</td><td>Gold certificate</td><td>Each certificate exchangable at draynor market for 5 gold nuggets</td><td>-</td><td>X</td></tr> <tr><td><522.png></td><td>522</td><td>Dragonstone Amulet</td><td>A very powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><523.png></td><td>523</td><td>Dragonstone</td><td>This looks very valuable</td><td>-</td><td>-</td></tr> <tr><td><524.png></td><td>524</td><td>Dragonstone Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><525.png></td><td>525</td><td>Crystal key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><526.png></td><td>526</td><td>Half of a key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><527.png></td><td>527</td><td>Half of a key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><528.png></td><td>528</td><td>Iron bar certificate</td><td>Each certificate exchangable at draynor market for 5 iron bars</td><td>-</td><td>X</td></tr> <tr><td><529.png></td><td>529</td><td>steel bar certificate</td><td>Each certificate exchangable at draynor market for 5 steel bars</td><td>-</td><td>X</td></tr> <tr><td><530.png></td><td>530</td><td>Mithril bar certificate</td><td>Each certificate exchangable at draynor market for 5 mithril bars</td><td>-</td><td>X</td></tr> <tr><td><531.png></td><td>531</td><td>silver bar certificate</td><td>Each certificate exchangable at draynor market for 5 silver bars</td><td>-</td><td>X</td></tr> <tr><td><532.png></td><td>532</td><td>Gold bar certificate</td><td>Each certificate exchangable at draynor market for 5 gold bars</td><td>-</td><td>X</td></tr> <tr><td><533.png></td><td>533</td><td>Lobster certificate</td><td>Each certificate exchangable at draynor market for 5 lobsters</td><td>-</td><td>X</td></tr> <tr><td><534.png></td><td>534</td><td>Raw lobster certificate</td><td>Each certificate exchangable at draynor market for 5 raw lobsters</td><td>-</td><td>X</td></tr> <tr><td><535.png></td><td>535</td><td>Swordfish certificate</td><td>Each certificate exchangable at draynor market for 5 swordfish</td><td>-</td><td>X</td></tr> <tr><td><536.png></td><td>536</td><td>Raw swordfish certificate</td><td>Each certificate exchangable at draynor market for 5 raw swordfish</td><td>-</td><td>X</td></tr> <tr><td><537.png></td><td>537</td><td>Diary</td><td>Property of Nora.T.Hag</td><td>-</td><td>-</td></tr> <tr><td><538.png></td><td>538</td><td>Front door key</td><td>A house key</td><td>-</td><td>-</td></tr> <tr><td><539.png></td><td>539</td><td>Ball</td><td>A child's ball</td><td>-</td><td>-</td></tr> <tr><td><540.png></td><td>540</td><td>magnet</td><td>A very attractive magnet</td><td>-</td><td>-</td></tr> <tr><td><541.png></td><td>541</td><td>Grey wolf fur</td><td>This would make warm clothing</td><td>-</td><td>-</td></tr> <tr><td><542.png></td><td>542</td><td>uncut dragonstone</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><543.png></td><td>543</td><td>Dragonstone ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><544.png></td><td>544</td><td>Dragonstone necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><545.png></td><td>545</td><td>Raw Shark</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><546.png></td><td>546</td><td>Shark</td><td>I'd better be careful eating this!</td><td>-</td><td>-</td></tr> <tr><td><547.png></td><td>547</td><td>Burnt Shark</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><548.png></td><td>548</td><td>Big Net</td><td>Useful for catching lots of fish</td><td>-</td><td>-</td></tr> <tr><td><549.png></td><td>549</td><td>Casket</td><td>I hope there is treasure in it</td><td>-</td><td>-</td></tr> <tr><td><550.png></td><td>550</td><td>Raw cod</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><551.png></td><td>551</td><td>Cod</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><552.png></td><td>552</td><td>Raw Mackerel</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><553.png></td><td>553</td><td>Mackerel</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><554.png></td><td>554</td><td>Raw Bass</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><555.png></td><td>555</td><td>Bass</td><td>Wow this is a big fish</td><td>-</td><td>-</td></tr> <tr><td><556.png></td><td>556</td><td>Ice Gloves</td><td>These will keep my hands cold!</td><td>X</td><td>-</td></tr> <tr><td><557.png></td><td>557</td><td>Firebird Feather</td><td>A red hot feather</td><td>-</td><td>-</td></tr> <tr><td><558.png></td><td>558</td><td>Firebird Feather</td><td>This is cool enough to hold now</td><td>-</td><td>-</td></tr> <tr><td><559.png></td><td>559</td><td>Poisoned Iron dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><560.png></td><td>560</td><td>Poisoned bronze dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><561.png></td><td>561</td><td>Poisoned Steel dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><562.png></td><td>562</td><td>Poisoned Mithril dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><563.png></td><td>563</td><td>Poisoned Rune dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><564.png></td><td>564</td><td>Poisoned Adamantite dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><565.png></td><td>565</td><td>Poisoned Black dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><566.png></td><td>566</td><td>Cure poison Potion</td><td>3 doses of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><567.png></td><td>567</td><td>Cure poison Potion</td><td>2 doses of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><568.png></td><td>568</td><td>Cure poison Potion</td><td>1 dose of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><569.png></td><td>569</td><td>Poison antidote</td><td>3 doses of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><570.png></td><td>570</td><td>Poison antidote</td><td>2 doses of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><571.png></td><td>571</td><td>Poison antidote</td><td>1 dose of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><572.png></td><td>572</td><td>weapon poison</td><td>For use on daggers and arrows</td><td>-</td><td>-</td></tr> <tr><td><573.png></td><td>573</td><td>ID Paper</td><td>ID of Hartigen the black knight</td><td>-</td><td>-</td></tr> <tr><td><574.png></td><td>574</td><td>Poison Bronze Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><575.png></td><td>575</td><td>Christmas cracker</td><td>Use on another player to pull it</td><td>-</td><td>-</td></tr> <tr><td><576.png></td><td>576</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><577.png></td><td>577</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><578.png></td><td>578</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><579.png></td><td>579</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><580.png></td><td>580</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><581.png></td><td>581</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><582.png></td><td>582</td><td>Miscellaneous key</td><td>I wonder what this unlocks</td><td>-</td><td>-</td></tr> <tr><td><583.png></td><td>583</td><td>Bunch of keys</td><td>Some keys on a keyring</td><td>-</td><td>-</td></tr> <tr><td><584.png></td><td>584</td><td>Whisky</td><td>A bottle of Draynor Malt</td><td>-</td><td>-</td></tr> <tr><td><585.png></td><td>585</td><td>Candlestick</td><td>A valuable candlestick</td><td>-</td><td>-</td></tr> <tr><td><586.png></td><td>586</td><td>Master thief armband</td><td>This denotes a great act of thievery</td><td>-</td><td>-</td></tr> <tr><td><587.png></td><td>587</td><td>Blamish snail slime</td><td>Yuck</td><td>-</td><td>-</td></tr> <tr><td><588.png></td><td>588</td><td>Blamish oil</td><td>made from the finest snail slime</td><td>-</td><td>-</td></tr> <tr><td><589.png></td><td>589</td><td>Oily Fishing Rod</td><td>A rod covered in Blamish oil</td><td>-</td><td>-</td></tr> <tr><td><590.png></td><td>590</td><td>lava eel</td><td>Strange it looks cooler now it's been cooked</td><td>-</td><td>-</td></tr> <tr><td><591.png></td><td>591</td><td>Raw lava eel</td><td>A very strange eel</td><td>-</td><td>-</td></tr> <tr><td><592.png></td><td>592</td><td>Poison Crossbow bolts</td><td>Good if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><593.png></td><td>593</td><td>Dragon sword</td><td>A Razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><594.png></td><td>594</td><td>Dragon axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><595.png></td><td>595</td><td>Jail keys</td><td>Keys to the black knight jail</td><td>-</td><td>-</td></tr> <tr><td><596.png></td><td>596</td><td>Dusty Key</td><td>A key given to me by Velrak</td><td>-</td><td>-</td></tr> <tr><td><597.png></td><td>597</td><td>Charged Dragonstone Amulet</td><td>A very powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><598.png></td><td>598</td><td>Grog</td><td>A murky glass of some sort of drink</td><td>-</td><td>-</td></tr> <tr><td><599.png></td><td>599</td><td>Candle</td><td>An unlit candle</td><td>-</td><td>-</td></tr> <tr><td><600.png></td><td>600</td><td>black Candle</td><td>A spooky but unlit candle</td><td>-</td><td>-</td></tr> <tr><td><601.png></td><td>601</td><td>Candle</td><td>A small slowly burning candle</td><td>-</td><td>-</td></tr> <tr><td><602.png></td><td>602</td><td>black Candle</td><td>A spooky candle</td><td>-</td><td>-</td></tr> <tr><td><603.png></td><td>603</td><td>insect repellant</td><td>Drives away all known 6 legged creatures</td><td>-</td><td>-</td></tr> <tr><td><604.png></td><td>604</td><td>Bat bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><605.png></td><td>605</td><td>wax Bucket</td><td>It's a wooden bucket</td><td>-</td><td>-</td></tr> <tr><td><606.png></td><td>606</td><td>Excalibur</td><td>This used to belong to king Arthur</td><td>X</td><td>-</td></tr> <tr><td><607.png></td><td>607</td><td>Druids robe</td><td>I feel closer to the Gods when I am wearing this</td><td>X</td><td>-</td></tr> <tr><td><608.png></td><td>608</td><td>Druids robe</td><td>Keeps a druids's knees nice and warm</td><td>X</td><td>-</td></tr> <tr><td><609.png></td><td>609</td><td>Eye patch</td><td>It makes me look very piratical</td><td>X</td><td>-</td></tr> <tr><td><610.png></td><td>610</td><td>Unenchanted Dragonstone Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><611.png></td><td>611</td><td>Unpowered orb</td><td>I'd prefer it if it was powered</td><td>-</td><td>-</td></tr> <tr><td><612.png></td><td>612</td><td>Fire orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><613.png></td><td>613</td><td>Water orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><614.png></td><td>614</td><td>Battlestaff</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><615.png></td><td>615</td><td>Battlestaff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><616.png></td><td>616</td><td>Battlestaff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><617.png></td><td>617</td><td>Battlestaff of air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><618.png></td><td>618</td><td>Battlestaff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><619.png></td><td>619</td><td>Blood-Rune</td><td>Used for high level missile spells</td><td>-</td><td>X</td></tr> <tr><td><620.png></td><td>620</td><td>Beer glass</td><td>I need to fill this with beer</td><td>-</td><td>-</td></tr> <tr><td><621.png></td><td>621</td><td>glassblowing pipe</td><td>Use on molten glass to make things</td><td>-</td><td>-</td></tr> <tr><td><622.png></td><td>622</td><td>seaweed</td><td>slightly damp seaweed</td><td>-</td><td>-</td></tr> <tr><td><623.png></td><td>623</td><td>molten glass</td><td>hot glass ready to be blown</td><td>-</td><td>-</td></tr> <tr><td><624.png></td><td>624</td><td>soda ash</td><td>one of the ingredients for making glass</td><td>-</td><td>-</td></tr> <tr><td><625.png></td><td>625</td><td>sand</td><td>one of the ingredients for making glass</td><td>-</td><td>-</td></tr> <tr><td><626.png></td><td>626</td><td>air orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><627.png></td><td>627</td><td>earth orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><628.png></td><td>628</td><td>bass certificate</td><td>Each certificate exchangable at Catherby for 5 bass</td><td>-</td><td>X</td></tr> <tr><td><629.png></td><td>629</td><td>Raw bass certificate</td><td>Each certificate exchangable at Catherby for 5 raw bass</td><td>-</td><td>X</td></tr> <tr><td><630.png></td><td>630</td><td>shark certificate</td><td>Each certificate exchangable at Catherby for 5 shark</td><td>-</td><td>X</td></tr> <tr><td><631.png></td><td>631</td><td>Raw shark certificate</td><td>Each certificate exchangable at Catherby for 5 raw shark</td><td>-</td><td>X</td></tr> <tr><td><632.png></td><td>632</td><td>Oak Logs</td><td>Logs cut from an oak tree</td><td>-</td><td>-</td></tr> <tr><td><633.png></td><td>633</td><td>Willow Logs</td><td>Logs cut from a willow tree</td><td>-</td><td>-</td></tr> <tr><td><634.png></td><td>634</td><td>Maple Logs</td><td>Logs cut from a maple tree</td><td>-</td><td>-</td></tr> <tr><td><635.png></td><td>635</td><td>Yew Logs</td><td>Logs cut from a yew tree</td><td>-</td><td>-</td></tr> <tr><td><636.png></td><td>636</td><td>Magic Logs</td><td>Logs made from magical wood</td><td>-</td><td>-</td></tr> <tr><td><637.png></td><td>637</td><td>Headless Arrows</td><td>I need to attach arrow heads to these</td><td>-</td><td>X</td></tr> <tr><td><638.png></td><td>638</td><td>Iron Arrows</td><td>Arrows with iron heads</td><td>-</td><td>X</td></tr> <tr><td><639.png></td><td>639</td><td>Poison Iron Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><640.png></td><td>640</td><td>Steel Arrows</td><td>Arrows with steel heads</td><td>-</td><td>X</td></tr> <tr><td><641.png></td><td>641</td><td>Poison Steel Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><642.png></td><td>642</td><td>Mithril Arrows</td><td>Arrows with mithril heads</td><td>-</td><td>X</td></tr> <tr><td><643.png></td><td>643</td><td>Poison Mithril Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><644.png></td><td>644</td><td>Adamantite Arrows</td><td>Arrows with adamantite heads</td><td>-</td><td>X</td></tr> <tr><td><645.png></td><td>645</td><td>Poison Adamantite Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><646.png></td><td>646</td><td>Rune Arrows</td><td>Arrows with rune heads</td><td>-</td><td>X</td></tr> <tr><td><647.png></td><td>647</td><td>Poison Rune Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><648.png></td><td>648</td><td>Oak Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><649.png></td><td>649</td><td>Oak Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><650.png></td><td>650</td><td>Willow Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><651.png></td><td>651</td><td>Willow Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><652.png></td><td>652</td><td>Maple Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><653.png></td><td>653</td><td>Maple Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><654.png></td><td>654</td><td>Yew Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><655.png></td><td>655</td><td>Yew Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><656.png></td><td>656</td><td>Magic Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><657.png></td><td>657</td><td>Magic Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><658.png></td><td>658</td><td>unstrung Oak Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><659.png></td><td>659</td><td>unstrung Oak Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><660.png></td><td>660</td><td>unstrung Willow Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><661.png></td><td>661</td><td>unstrung Willow Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><662.png></td><td>662</td><td>unstrung Maple Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><663.png></td><td>663</td><td>unstrung Maple Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><664.png></td><td>664</td><td>unstrung Yew Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><665.png></td><td>665</td><td>unstrung Yew Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><666.png></td><td>666</td><td>unstrung Magic Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><667.png></td><td>667</td><td>unstrung Magic Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><668.png></td><td>668</td><td>barcrawl card</td><td>The official Alfred Grimhand barcrawl</td><td>-</td><td>-</td></tr> <tr><td><669.png></td><td>669</td><td>bronze arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><670.png></td><td>670</td><td>iron arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><671.png></td><td>671</td><td>steel arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><672.png></td><td>672</td><td>mithril arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><673.png></td><td>673</td><td>adamantite arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><674.png></td><td>674</td><td>rune arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><675.png></td><td>675</td><td>flax</td><td>I should use this with a spinning wheel</td><td>-</td><td>-</td></tr> <tr><td><676.png></td><td>676</td><td>bow string</td><td>I need a bow handle to attach this too</td><td>-</td><td>-</td></tr> <tr><td><677.png></td><td>677</td><td>Easter egg</td><td>Happy Easter</td><td>-</td><td>-</td></tr> <tr><td><678.png></td><td>678</td><td>scorpion cage</td><td>I need to catch some scorpions in this</td><td>-</td><td>-</td></tr> <tr><td><679.png></td><td>679</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><680.png></td><td>680</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><681.png></td><td>681</td><td>scorpion cage</td><td>It has 3 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><682.png></td><td>682</td><td>Enchanted Battlestaff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><683.png></td><td>683</td><td>Enchanted Battlestaff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><684.png></td><td>684</td><td>Enchanted Battlestaff of air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><685.png></td><td>685</td><td>Enchanted Battlestaff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><686.png></td><td>686</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><687.png></td><td>687</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><688.png></td><td>688</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><689.png></td><td>689</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><690.png></td><td>690</td><td>gold</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><691.png></td><td>691</td><td>gold bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><692.png></td><td>692</td><td>Ruby ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><693.png></td><td>693</td><td>Ruby necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><694.png></td><td>694</td><td>Family crest</td><td>The crest of a varrocian noble family</td><td>-</td><td>-</td></tr> <tr><td><695.png></td><td>695</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><696.png></td><td>696</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><697.png></td><td>697</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><698.png></td><td>698</td><td>Steel gauntlets</td><td>Very handy armour</td><td>X</td><td>-</td></tr> <tr><td><699.png></td><td>699</td><td>gauntlets of goldsmithing</td><td>metal gloves for gold making</td><td>X</td><td>-</td></tr> <tr><td><700.png></td><td>700</td><td>gauntlets of cooking</td><td>Used for cooking fish</td><td>X</td><td>-</td></tr> <tr><td><701.png></td><td>701</td><td>gauntlets of chaos</td><td>improves bolt spells</td><td>X</td><td>-</td></tr> <tr><td><702.png></td><td>702</td><td>robe of Zamorak</td><td>A robe worn by worshippers of Zamorak</td><td>X</td><td>-</td></tr> <tr><td><703.png></td><td>703</td><td>robe of Zamorak</td><td>A robe worn by worshippers of Zamorak</td><td>X</td><td>-</td></tr> <tr><td><704.png></td><td>704</td><td>Address Label</td><td>To lord Handelmort- Handelmort mansion</td><td>-</td><td>-</td></tr> <tr><td><705.png></td><td>705</td><td>Tribal totem</td><td>It represents some sort of tribal god</td><td>-</td><td>-</td></tr> <tr><td><706.png></td><td>706</td><td>tourist guide</td><td>Your definitive guide to Ardougne</td><td>-</td><td>-</td></tr> <tr><td><707.png></td><td>707</td><td>spice</td><td>Put it in uncooked stew to make curry</td><td>-</td><td>-</td></tr> <tr><td><708.png></td><td>708</td><td>Uncooked curry</td><td>I need to cook this</td><td>-</td><td>-</td></tr> <tr><td><709.png></td><td>709</td><td>curry</td><td>It's a spicey hot curry</td><td>-</td><td>-</td></tr> <tr><td><710.png></td><td>710</td><td>Burnt curry</td><td>Eew it's horribly burnt</td><td>-</td><td>-</td></tr> <tr><td><711.png></td><td>711</td><td>yew logs certificate</td><td>Each certificate exchangable at Ardougne for 5 yew logs</td><td>-</td><td>X</td></tr> <tr><td><712.png></td><td>712</td><td>maple logs certificate</td><td>Each certificate exchangable at Ardougne for 5 maple logs</td><td>-</td><td>X</td></tr> <tr><td><713.png></td><td>713</td><td>willow logs certificate</td><td>Each certificate exchangable at Ardougne for 5 willow logs</td><td>-</td><td>X</td></tr> <tr><td><714.png></td><td>714</td><td>lockpick</td><td>It makes picking some locks easier</td><td>-</td><td>-</td></tr> <tr><td><715.png></td><td>715</td><td>Red vine worms</td><td>Strange little red worms</td><td>-</td><td>X</td></tr> <tr><td><716.png></td><td>716</td><td>Blanket</td><td>A child's blanket</td><td>-</td><td>-</td></tr> <tr><td><717.png></td><td>717</td><td>Raw giant carp</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><718.png></td><td>718</td><td>giant Carp</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><719.png></td><td>719</td><td>Fishing competition Pass</td><td>Admits one to the Hemenster fishing competition</td><td>-</td><td>-</td></tr> <tr><td><720.png></td><td>720</td><td>Hemenster fishing trophy</td><td>Hurrah you won a fishing competition</td><td>-</td><td>-</td></tr> <tr><td><721.png></td><td>721</td><td>Pendant of Lucien</td><td>Gets me through the chamber of fear</td><td>X</td><td>-</td></tr> <tr><td><722.png></td><td>722</td><td>Boots of lightfootedness</td><td>Wearing these makes me feel like I am floating</td><td>X</td><td>-</td></tr> <tr><td><723.png></td><td>723</td><td>Ice Arrows</td><td>Can only be fired with yew or magic bows</td><td>-</td><td>X</td></tr> <tr><td><724.png></td><td>724</td><td>Lever</td><td>This was once attached to something</td><td>-</td><td>-</td></tr> <tr><td><725.png></td><td>725</td><td>Staff of Armadyl</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><726.png></td><td>726</td><td>Pendant of Armadyl</td><td>Allows me to fight Lucien</td><td>X</td><td>-</td></tr> <tr><td><727.png></td><td>727</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><728.png></td><td>728</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><729.png></td><td>729</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><730.png></td><td>730</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><731.png></td><td>731</td><td>Rat Poison</td><td>This stuff looks nasty</td><td>-</td><td>-</td></tr> <tr><td><732.png></td><td>732</td><td>shiny Key</td><td>Quite a small key</td><td>-</td><td>-</td></tr> <tr><td><733.png></td><td>733</td><td>khazard Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><734.png></td><td>734</td><td>khazard chainmail</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><735.png></td><td>735</td><td>khali brew</td><td>A bottle of khazard's worst brew</td><td>-</td><td>-</td></tr> <tr><td><736.png></td><td>736</td><td>khazard cell keys</td><td>Keys for General Khazard's cells</td><td>-</td><td>-</td></tr> <tr><td><737.png></td><td>737</td><td>Poison chalice</td><td>A strange looking drink</td><td>-</td><td>-</td></tr> <tr><td><738.png></td><td>738</td><td>magic whistle</td><td>A small tin whistle</td><td>-</td><td>-</td></tr> <tr><td><739.png></td><td>739</td><td>Cup of tea</td><td>A nice cup of tea</td><td>-</td><td>-</td></tr> <tr><td><740.png></td><td>740</td><td>orb of protection</td><td>a strange glowing green orb</td><td>-</td><td>-</td></tr> <tr><td><741.png></td><td>741</td><td>orbs of protection</td><td>two strange glowing green orbs</td><td>-</td><td>-</td></tr> <tr><td><742.png></td><td>742</td><td>Holy table napkin</td><td>a cloth given to me by sir Galahad</td><td>-</td><td>-</td></tr> <tr><td><743.png></td><td>743</td><td>bell</td><td>I wonder what happens when i ring it</td><td>-</td><td>-</td></tr> <tr><td><744.png></td><td>744</td><td>Gnome Emerald Amulet of protection</td><td>It improves my defense</td><td>X</td><td>-</td></tr> <tr><td><745.png></td><td>745</td><td>magic golden feather</td><td>It will point the way for me</td><td>-</td><td>-</td></tr> <tr><td><746.png></td><td>746</td><td>Holy grail</td><td>A holy and powerful artifact</td><td>-</td><td>-</td></tr> <tr><td><747.png></td><td>747</td><td>Script of Hazeel</td><td>An old scroll with strange ancient text</td><td>-</td><td>-</td></tr> <tr><td><748.png></td><td>748</td><td>Pineapple</td><td>It can be cut up with a knife</td><td>-</td><td>-</td></tr> <tr><td><749.png></td><td>749</td><td>Pineapple ring</td><td>Exotic fruit</td><td>-</td><td>-</td></tr> <tr><td><750.png></td><td>750</td><td>Pineapple Pizza</td><td>A tropicana pizza</td><td>-</td><td>-</td></tr> <tr><td><751.png></td><td>751</td><td>Half pineapple Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><752.png></td><td>752</td><td>Magic scroll</td><td>Maybe I should read it</td><td>-</td><td>-</td></tr> <tr><td><753.png></td><td>753</td><td>Mark of Hazeel</td><td>A large metal amulet</td><td>-</td><td>-</td></tr> <tr><td><754.png></td><td>754</td><td>bloody axe of zamorak</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><755.png></td><td>755</td><td>carnillean armour</td><td>the carnillean family armour</td><td>-</td><td>-</td></tr> <tr><td><756.png></td><td>756</td><td>Carnillean Key</td><td>An old rusty key</td><td>-</td><td>-</td></tr> <tr><td><757.png></td><td>757</td><td>Cattle prod</td><td>An old cattle prod</td><td>-</td><td>-</td></tr> <tr><td><758.png></td><td>758</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><759.png></td><td>759</td><td>Poisoned animal feed</td><td>This looks nasty</td><td>-</td><td>-</td></tr> <tr><td><760.png></td><td>760</td><td>Protective jacket</td><td>A thick heavy leather top</td><td>X</td><td>-</td></tr> <tr><td><761.png></td><td>761</td><td>Protective trousers</td><td>A thick pair of leather trousers</td><td>X</td><td>-</td></tr> <tr><td><762.png></td><td>762</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><763.png></td><td>763</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><764.png></td><td>764</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><765.png></td><td>765</td><td>dwellberries</td><td>some rather pretty blue berries</td><td>-</td><td>-</td></tr> <tr><td><766.png></td><td>766</td><td>Gasmask</td><td>Stops me breathing nasty stuff</td><td>X</td><td>-</td></tr> <tr><td><767.png></td><td>767</td><td>picture</td><td>A picture of a lady called Elena</td><td>-</td><td>-</td></tr> <tr><td><768.png></td><td>768</td><td>Book</td><td>Turnip growing for beginners</td><td>-</td><td>-</td></tr> <tr><td><769.png></td><td>769</td><td>Seaslug</td><td>a rather nasty looking crustacean</td><td>-</td><td>-</td></tr> <tr><td><770.png></td><td>770</td><td>chocolaty milk</td><td>Milk with chocolate in it</td><td>-</td><td>-</td></tr> <tr><td><771.png></td><td>771</td><td>Hangover cure</td><td>It doesn't look very tasty</td><td>-</td><td>-</td></tr> <tr><td><772.png></td><td>772</td><td>Chocolate dust</td><td>I prefer it in a bar shape</td><td>-</td><td>-</td></tr> <tr><td><773.png></td><td>773</td><td>Torch</td><td>A unlit home made torch</td><td>-</td><td>-</td></tr> <tr><td><774.png></td><td>774</td><td>Torch</td><td>A lit home made torch</td><td>-</td><td>-</td></tr> <tr><td><775.png></td><td>775</td><td>warrant</td><td>A search warrant for a house in Ardougne</td><td>-</td><td>-</td></tr> <tr><td><776.png></td><td>776</td><td>Damp sticks</td><td>Some damp wooden sticks</td><td>-</td><td>-</td></tr> <tr><td><777.png></td><td>777</td><td>Dry sticks</td><td>Some dry wooden sticks</td><td>-</td><td>-</td></tr> <tr><td><778.png></td><td>778</td><td>Broken glass</td><td>Glass from a broken window pane</td><td>-</td><td>-</td></tr> <tr><td><779.png></td><td>779</td><td>oyster pearls</td><td>I could work wonders with these and a chisel</td><td>-</td><td>-</td></tr> <tr><td><780.png></td><td>780</td><td>little key</td><td>Quite a small key</td><td>-</td><td>-</td></tr> <tr><td><781.png></td><td>781</td><td>Scruffy note</td><td>It seems to say hongorer lure</td><td>-</td><td>-</td></tr> <tr><td><782.png></td><td>782</td><td>Glarial's amulet</td><td>A bright green gem set in a necklace</td><td>X</td><td>-</td></tr> <tr><td><783.png></td><td>783</td><td>Swamp tar</td><td>A foul smelling thick tar like substance</td><td>-</td><td>X</td></tr> <tr><td><784.png></td><td>784</td><td>Uncooked Swamp paste</td><td>A thick tar like substance mixed with flour</td><td>-</td><td>X</td></tr> <tr><td><785.png></td><td>785</td><td>Swamp paste</td><td>A tar like substance mixed with flour and warmed</td><td>-</td><td>X</td></tr> <tr><td><786.png></td><td>786</td><td>Oyster pearl bolts</td><td>Great if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><787.png></td><td>787</td><td>Glarials pebble</td><td>A small pebble with elven inscription</td><td>-</td><td>-</td></tr> <tr><td><788.png></td><td>788</td><td>book on baxtorian</td><td>A book on elven history in north runescape</td><td>-</td><td>-</td></tr> <tr><td><789.png></td><td>789</td><td>large key</td><td>I wonder what this is the key to</td><td>-</td><td>-</td></tr> <tr><td><790.png></td><td>790</td><td>Oyster pearl bolt tips</td><td>Can be used to improve crossbow bolts</td><td>-</td><td>X</td></tr> <tr><td><791.png></td><td>791</td><td>oyster</td><td>It's empty</td><td>-</td><td>-</td></tr> <tr><td><792.png></td><td>792</td><td>oyster pearls</td><td>I could work wonders with these and a chisel</td><td>-</td><td>-</td></tr> <tr><td><793.png></td><td>793</td><td>oyster</td><td>It's a rare oyster</td><td>-</td><td>-</td></tr> <tr><td><794.png></td><td>794</td><td>Soil</td><td>It's a bucket of fine soil</td><td>-</td><td>-</td></tr> <tr><td><795.png></td><td>795</td><td>Dragon medium Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><796.png></td><td>796</td><td>Mithril seed</td><td>Magical seeds in a mithril case</td><td>-</td><td>X</td></tr> <tr><td><797.png></td><td>797</td><td>An old key</td><td>A door key</td><td>-</td><td>-</td></tr> <tr><td><798.png></td><td>798</td><td>pigeon cage</td><td>It's for holding pigeons</td><td>-</td><td>-</td></tr> <tr><td><799.png></td><td>799</td><td>Messenger pigeons</td><td>some very plump birds</td><td>-</td><td>-</td></tr> <tr><td><800.png></td><td>800</td><td>Bird feed</td><td>A selection of mixed seeds</td><td>-</td><td>-</td></tr> <tr><td><801.png></td><td>801</td><td>Rotten apples</td><td>Yuck!</td><td>-</td><td>-</td></tr> <tr><td><802.png></td><td>802</td><td>Doctors gown</td><td>I do feel clever wearing this</td><td>X</td><td>-</td></tr> <tr><td><803.png></td><td>803</td><td>Bronze key</td><td>A heavy key</td><td>-</td><td>-</td></tr> <tr><td><804.png></td><td>804</td><td>Distillator</td><td>It's for seperating compounds</td><td>-</td><td>-</td></tr> <tr><td><805.png></td><td>805</td><td>Glarial's urn</td><td>An urn containing glarials ashes</td><td>-</td><td>-</td></tr> <tr><td><806.png></td><td>806</td><td>Glarial's urn</td><td>An empty metal urn</td><td>-</td><td>-</td></tr> <tr><td><807.png></td><td>807</td><td>Priest robe</td><td>I feel closer to saradomin in this</td><td>X</td><td>-</td></tr> <tr><td><808.png></td><td>808</td><td>Priest gown</td><td>I feel closer to saradomin in this</td><td>X</td><td>-</td></tr> <tr><td><809.png></td><td>809</td><td>Liquid Honey</td><td>This isn't worth much</td><td>-</td><td>-</td></tr> <tr><td><810.png></td><td>810</td><td>Ethenea</td><td>An expensive colourless liquid</td><td>-</td><td>-</td></tr> <tr><td><811.png></td><td>811</td><td>Sulphuric Broline</td><td>it's highly poisonous</td><td>-</td><td>-</td></tr> <tr><td><812.png></td><td>812</td><td>Plague sample</td><td>An air tight tin container</td><td>-</td><td>-</td></tr> <tr><td><813.png></td><td>813</td><td>Touch paper</td><td>For scientific testing</td><td>-</td><td>-</td></tr> <tr><td><814.png></td><td>814</td><td>Dragon Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><815.png></td><td>815</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><816.png></td><td>816</td><td>Snake Weed</td><td>A very rare jungle herb</td><td>-</td><td>-</td></tr> <tr><td><817.png></td><td>817</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><818.png></td><td>818</td><td>Ardrigal</td><td>An interesting</td><td>-</td><td>-</td></tr> <tr><td><819.png></td><td>819</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><820.png></td><td>820</td><td>Sito Foil</td><td>An rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><821.png></td><td>821</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><822.png></td><td>822</td><td>Volencia Moss</td><td>A very rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><823.png></td><td>823</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><824.png></td><td>824</td><td>Rogues Purse</td><td> A rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><825.png></td><td>825</td><td>Soul-Rune</td><td>Used for high level curse spells</td><td>-</td><td>X</td></tr> <tr><td><826.png></td><td>826</td><td>king lathas Amulet</td><td>The amulet is red</td><td>X</td><td>-</td></tr> <tr><td><827.png></td><td>827</td><td>Bronze Spear</td><td>A bronze tipped spear</td><td>X</td><td>-</td></tr> <tr><td><828.png></td><td>828</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><829.png></td><td>829</td><td>Dragon bitter</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><830.png></td><td>830</td><td>Greenmans ale</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><831.png></td><td>831</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><832.png></td><td>832</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><833.png></td><td>833</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><834.png></td><td>834</td><td>cocktail shaker</td><td>For mixing cocktails</td><td>-</td><td>-</td></tr> <tr><td><835.png></td><td>835</td><td>Bone Key</td><td>A key delicately carved key made from a single piece of bone</td><td>-</td><td>-</td></tr> <tr><td><836.png></td><td>836</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><837.png></td><td>837</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><838.png></td><td>838</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><839.png></td><td>839</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><840.png></td><td>840</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><841.png></td><td>841</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><842.png></td><td>842</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><843.png></td><td>843</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><844.png></td><td>844</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><845.png></td><td>845</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><846.png></td><td>846</td><td>gnome top</td><td>rometti - the ultimate in gnome design</td><td>X</td><td>-</td></tr> <tr><td><847.png></td><td>847</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><848.png></td><td>848</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><849.png></td><td>849</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><850.png></td><td>850</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><851.png></td><td>851</td><td>gnome cocktail guide</td><td>A book on tree gnome cocktails</td><td>-</td><td>-</td></tr> <tr><td><852.png></td><td>852</td><td>Beads of the dead</td><td>A curious looking neck ornament</td><td>X</td><td>-</td></tr> <tr><td><853.png></td><td>853</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><854.png></td><td>854</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><855.png></td><td>855</td><td>lemon</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><856.png></td><td>856</td><td>lemon slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><857.png></td><td>857</td><td>orange</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><858.png></td><td>858</td><td>orange slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><859.png></td><td>859</td><td>Diced orange</td><td>Fresh chunks of orange</td><td>-</td><td>-</td></tr> <tr><td><860.png></td><td>860</td><td>Diced lemon</td><td>Fresh chunks of lemon</td><td>-</td><td>-</td></tr> <tr><td><861.png></td><td>861</td><td>Fresh Pineapple</td><td>It can be cut up with a knife</td><td>-</td><td>-</td></tr> <tr><td><862.png></td><td>862</td><td>Pineapple chunks</td><td>Fresh chunks of pineapple</td><td>-</td><td>-</td></tr> <tr><td><863.png></td><td>863</td><td>lime</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><864.png></td><td>864</td><td>lime chunks</td><td>Fresh chunks of lime</td><td>-</td><td>-</td></tr> <tr><td><865.png></td><td>865</td><td>lime slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><866.png></td><td>866</td><td>fruit blast</td><td>A cool refreshing fruit mix</td><td>-</td><td>-</td></tr> <tr><td><867.png></td><td>867</td><td>odd looking cocktail</td><td>A cool refreshing mix</td><td>-</td><td>-</td></tr> <tr><td><868.png></td><td>868</td><td>Whisky</td><td>A locally brewed Malt</td><td>-</td><td>-</td></tr> <tr><td><869.png></td><td>869</td><td>vodka</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><870.png></td><td>870</td><td>gin</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><871.png></td><td>871</td><td>cream</td><td>Fresh cream</td><td>-</td><td>-</td></tr> <tr><td><872.png></td><td>872</td><td>Drunk dragon</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><873.png></td><td>873</td><td>Equa leaves</td><td>Small sweet smelling leaves</td><td>-</td><td>-</td></tr> <tr><td><874.png></td><td>874</td><td>SGG</td><td>A short green guy..looks good</td><td>-</td><td>-</td></tr> <tr><td><875.png></td><td>875</td><td>Chocolate saturday</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><876.png></td><td>876</td><td>brandy</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><877.png></td><td>877</td><td>blurberry special</td><td>Looks good..smells strong</td><td>-</td><td>-</td></tr> <tr><td><878.png></td><td>878</td><td>wizard blizzard</td><td>Looks like a strange mix</td><td>-</td><td>-</td></tr> <tr><td><879.png></td><td>879</td><td>pineapple punch</td><td>A fresh healthy fruit mix</td><td>-</td><td>-</td></tr> <tr><td><880.png></td><td>880</td><td>gnomebatta dough</td><td>Dough formed into a base</td><td>-</td><td>-</td></tr> <tr><td><881.png></td><td>881</td><td>gianne dough</td><td>It's made from a secret recipe</td><td>-</td><td>-</td></tr> <tr><td><882.png></td><td>882</td><td>gnomebowl dough</td><td>Dough formed into a bowl shape</td><td>-</td><td>-</td></tr> <tr><td><883.png></td><td>883</td><td>gnomecrunchie dough</td><td>Dough formed into cookie shapes</td><td>-</td><td>-</td></tr> <tr><td><884.png></td><td>884</td><td>gnomebatta</td><td>A baked dough base</td><td>-</td><td>-</td></tr> <tr><td><885.png></td><td>885</td><td>gnomebowl</td><td>A baked dough bowl</td><td>-</td><td>-</td></tr> <tr><td><886.png></td><td>886</td><td>gnomebatta</td><td>It's burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><887.png></td><td>887</td><td>gnomecrunchie</td><td>They're burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><888.png></td><td>888</td><td>gnomebowl</td><td>It's burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><889.png></td><td>889</td><td>Uncut Red Topaz</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><890.png></td><td>890</td><td>Uncut Jade</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><891.png></td><td>891</td><td>Uncut Opal</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><892.png></td><td>892</td><td>Red Topaz</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><893.png></td><td>893</td><td>Jade</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><894.png></td><td>894</td><td>Opal</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><895.png></td><td>895</td><td>Swamp Toad</td><td>Slippery little blighters</td><td>-</td><td>-</td></tr> <tr><td><896.png></td><td>896</td><td>Toad legs</td><td>Gnome delicacy apparently</td><td>-</td><td>-</td></tr> <tr><td><897.png></td><td>897</td><td>King worm</td><td>Gnome delicacy apparently</td><td>-</td><td>-</td></tr> <tr><td><898.png></td><td>898</td><td>Gnome spice</td><td>Aluft Giannes secret reciepe</td><td>-</td><td>-</td></tr> <tr><td><899.png></td><td>899</td><td>gianne cook book</td><td>Aluft Giannes favorite dishes</td><td>-</td><td>-</td></tr> <tr><td><900.png></td><td>900</td><td>gnomecrunchie</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><901.png></td><td>901</td><td>cheese and tomato batta</td><td>Smells really good</td><td>-</td><td>-</td></tr> <tr><td><902.png></td><td>902</td><td>toad batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><903.png></td><td>903</td><td>gnome batta</td><td>smells like pants</td><td>-</td><td>-</td></tr> <tr><td><904.png></td><td>904</td><td>worm batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><905.png></td><td>905</td><td>fruit batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><906.png></td><td>906</td><td>Veg batta</td><td>well..it looks healthy</td><td>-</td><td>-</td></tr> <tr><td><907.png></td><td>907</td><td>Chocolate bomb</td><td>Looks great</td><td>-</td><td>-</td></tr> <tr><td><908.png></td><td>908</td><td>Vegball</td><td>Looks pretty healthy</td><td>-</td><td>-</td></tr> <tr><td><909.png></td><td>909</td><td>worm hole</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><910.png></td><td>910</td><td>Tangled toads legs</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><911.png></td><td>911</td><td>Choc crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><912.png></td><td>912</td><td>Worm crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><913.png></td><td>913</td><td>Toad crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><914.png></td><td>914</td><td>Spice crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><915.png></td><td>915</td><td>Crushed Gemstone</td><td>A gemstone that has been smashed</td><td>-</td><td>-</td></tr> <tr><td><916.png></td><td>916</td><td>Blurberry badge</td><td>an official cocktail maker</td><td>-</td><td>-</td></tr> <tr><td><917.png></td><td>917</td><td>Gianne badge</td><td>an official gianne chef</td><td>-</td><td>-</td></tr> <tr><td><918.png></td><td>918</td><td>tree gnome translation</td><td>Translate the old gnome tounge</td><td>-</td><td>-</td></tr> <tr><td><919.png></td><td>919</td><td>Bark sample</td><td>A sample from the grand tree</td><td>-</td><td>-</td></tr> <tr><td><920.png></td><td>920</td><td>War ship</td><td>A model of a karamja warship</td><td>-</td><td>-</td></tr> <tr><td><921.png></td><td>921</td><td>gloughs journal</td><td>Glough's private notes</td><td>-</td><td>-</td></tr> <tr><td><922.png></td><td>922</td><td>invoice</td><td>A note with foreman's timber order</td><td>-</td><td>-</td></tr> <tr><td><923.png></td><td>923</td><td>Ugthanki Kebab</td><td>A strange smelling Kebab made from Ugthanki meat - it doesn't look too good</td><td>-</td><td>-</td></tr> <tr><td><924.png></td><td>924</td><td>special curry</td><td>It's a spicy hot curry</td><td>-</td><td>-</td></tr> <tr><td><925.png></td><td>925</td><td>glough's key</td><td>Glough left this at anita's</td><td>-</td><td>-</td></tr> <tr><td><926.png></td><td>926</td><td>glough's notes</td><td>Scribbled notes and diagrams</td><td>-</td><td>-</td></tr> <tr><td><927.png></td><td>927</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><928.png></td><td>928</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><929.png></td><td>929</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><930.png></td><td>930</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><931.png></td><td>931</td><td>Daconia rock</td><td>A magicaly crafted stone</td><td>-</td><td>-</td></tr> <tr><td><932.png></td><td>932</td><td>Sinister key</td><td>You get a sense of dread from this key</td><td>-</td><td>-</td></tr> <tr><td><933.png></td><td>933</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><934.png></td><td>934</td><td>Torstol</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><935.png></td><td>935</td><td>Unfinished potion</td><td>I need Jangerberries to finish this Torstol potion</td><td>-</td><td>-</td></tr> <tr><td><936.png></td><td>936</td><td>Jangerberries</td><td>They don't look very ripe</td><td>-</td><td>-</td></tr> <tr><td><937.png></td><td>937</td><td>fruit blast</td><td>A cool refreshing fruit mix</td><td>-</td><td>-</td></tr> <tr><td><938.png></td><td>938</td><td>blurberry special</td><td>Looks good..smells strong</td><td>-</td><td>-</td></tr> <tr><td><939.png></td><td>939</td><td>wizard blizzard</td><td>Looks like a strange mix</td><td>-</td><td>-</td></tr> <tr><td><940.png></td><td>940</td><td>pineapple punch</td><td>A fresh healthy fruit mix</td><td>-</td><td>-</td></tr> <tr><td><941.png></td><td>941</td><td>SGG</td><td>A short green guy..looks good</td><td>-</td><td>-</td></tr> <tr><td><942.png></td><td>942</td><td>Chocolate saturday</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><943.png></td><td>943</td><td>Drunk dragon</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><944.png></td><td>944</td><td>cheese and tomato batta</td><td>Smells really good</td><td>-</td><td>-</td></tr> <tr><td><945.png></td><td>945</td><td>toad batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><946.png></td><td>946</td><td>gnome batta</td><td>smells like pants</td><td>-</td><td>-</td></tr> <tr><td><947.png></td><td>947</td><td>worm batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><948.png></td><td>948</td><td>fruit batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><949.png></td><td>949</td><td>Veg batta</td><td>well..it looks healthy</td><td>-</td><td>-</td></tr> <tr><td><950.png></td><td>950</td><td>Chocolate bomb</td><td>Looks great</td><td>-</td><td>-</td></tr> <tr><td><951.png></td><td>951</td><td>Vegball</td><td>Looks pretty healthy</td><td>-</td><td>-</td></tr> <tr><td><952.png></td><td>952</td><td>worm hole</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><953.png></td><td>953</td><td>Tangled toads legs</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><954.png></td><td>954</td><td>Choc crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><955.png></td><td>955</td><td>Worm crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><956.png></td><td>956</td><td>Toad crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><957.png></td><td>957</td><td>Spice crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><958.png></td><td>958</td><td>Stone-Plaque</td><td>A stone plaque with carved letters in it</td><td>-</td><td>-</td></tr> <tr><td><959.png></td><td>959</td><td>Tattered Scroll</td><td>An ancient tattered scroll</td><td>-</td><td>-</td></tr> <tr><td><960.png></td><td>960</td><td>Crumpled Scroll</td><td>An ancient crumpled scroll</td><td>-</td><td>-</td></tr> <tr><td><961.png></td><td>961</td><td>Bervirius Tomb Notes</td><td>Notes taken from the tomb of Bervirius</td><td>-</td><td>-</td></tr> <tr><td><962.png></td><td>962</td><td>Zadimus Corpse</td><td>The remains of Zadimus</td><td>-</td><td>-</td></tr> <tr><td><963.png></td><td>963</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><964.png></td><td>964</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><965.png></td><td>965</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><966.png></td><td>966</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><967.png></td><td>967</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><968.png></td><td>968</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><969.png></td><td>969</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><970.png></td><td>970</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><971.png></td><td>971</td><td>Santa's hat</td><td>It's a santa claus' hat</td><td>X</td><td>-</td></tr> <tr><td><972.png></td><td>972</td><td>Locating Crystal</td><td>A magical crystal sphere</td><td>-</td><td>-</td></tr> <tr><td><973.png></td><td>973</td><td>Sword Pommel</td><td>An ivory sword pommel</td><td>-</td><td>-</td></tr> <tr><td><974.png></td><td>974</td><td>Bone Shard</td><td>A slender piece of bone</td><td>-</td><td>-</td></tr> <tr><td><975.png></td><td>975</td><td>Steel Wire</td><td>Useful for crafting items</td><td>-</td><td>-</td></tr> <tr><td><976.png></td><td>976</td><td>Bone Beads</td><td>Beads carved out of bone</td><td>-</td><td>-</td></tr> <tr><td><977.png></td><td>977</td><td>Rashiliya Corpse</td><td>The remains of the Zombie Queen</td><td>-</td><td>-</td></tr> <tr><td><978.png></td><td>978</td><td>ResetCrystal</td><td>Helps reset things in game</td><td>-</td><td>-</td></tr> <tr><td><979.png></td><td>979</td><td>Bronze Wire</td><td>Useful for crafting items</td><td>-</td><td>-</td></tr> <tr><td><980.png></td><td>980</td><td>Present</td><td>Click to use this on a friend</td><td>-</td><td>-</td></tr> <tr><td><981.png></td><td>981</td><td>Gnome Ball</td><td>Lets play</td><td>-</td><td>-</td></tr> <tr><td><982.png></td><td>982</td><td>Papyrus</td><td>Used for making notes</td><td>-</td><td>-</td></tr> <tr><td><983.png></td><td>983</td><td>A lump of Charcoal</td><td>a lump of cooked coal good for making marks.</td><td>-</td><td>-</td></tr> <tr><td><984.png></td><td>984</td><td>Arrow</td><td>linen wrapped around an arrow head</td><td>-</td><td>-</td></tr> <tr><td><985.png></td><td>985</td><td>Lit Arrow</td><td>A flamming arrow</td><td>-</td><td>X</td></tr> <tr><td><986.png></td><td>986</td><td>Rocks</td><td>A few Large rocks</td><td>-</td><td>-</td></tr> <tr><td><987.png></td><td>987</td><td>Paramaya Rest Ticket</td><td>Allows you to rest in the luxurius Paramaya Inn</td><td>-</td><td>-</td></tr> <tr><td><988.png></td><td>988</td><td>Ship Ticket</td><td>Allows you passage on the 'Lady of the Waves' ship.</td><td>-</td><td>-</td></tr> <tr><td><989.png></td><td>989</td><td>Damp cloth</td><td>It smells as if it's been doused in alcohol</td><td>-</td><td>-</td></tr> <tr><td><990.png></td><td>990</td><td>Desert Boots</td><td>Boots made specially for the desert</td><td>X</td><td>-</td></tr> <tr><td><991.png></td><td>991</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><992.png></td><td>992</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><993.png></td><td>993</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><994.png></td><td>994</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><995.png></td><td>995</td><td>Railing</td><td>A broken metal rod</td><td>-</td><td>-</td></tr> <tr><td><996.png></td><td>996</td><td>Randas's journal</td><td>An old journal with several pages missing</td><td>-</td><td>-</td></tr> <tr><td><997.png></td><td>997</td><td>Unicorn horn</td><td>Poor unicorn went splat!</td><td>-</td><td>-</td></tr> <tr><td><998.png></td><td>998</td><td>Coat of Arms</td><td>A symbol of truth and all that is good</td><td>-</td><td>-</td></tr> <tr><td><999.png></td><td>999</td><td>Coat of Arms</td><td>A symbol of truth and all that is good</td><td>-</td><td>-</td></tr> <tr><td><1000.png></td><td>1000</td><td>Staff of Iban</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><1001.png></td><td>1001</td><td>Dwarf brew</td><td>It's a bucket of home made brew</td><td>-</td><td>-</td></tr> <tr><td><1002.png></td><td>1002</td><td>Ibans Ashes</td><td>A heap of ashes</td><td>-</td><td>-</td></tr> <tr><td><1003.png></td><td>1003</td><td>Cat</td><td>She's sleeping..i think!</td><td>-</td><td>-</td></tr> <tr><td><1004.png></td><td>1004</td><td>A Doll of Iban</td><td>A strange doll made from sticks and cloth</td><td>-</td><td>-</td></tr> <tr><td><1005.png></td><td>1005</td><td>Old Journal</td><td>I wonder who wrote this!</td><td>-</td><td>-</td></tr> <tr><td><1006.png></td><td>1006</td><td>Klank's gauntlets</td><td>Heavy hand protection</td><td>X</td><td>-</td></tr> <tr><td><1007.png></td><td>1007</td><td>Iban's shadow</td><td>A dark mystical liquid</td><td>-</td><td>-</td></tr> <tr><td><1008.png></td><td>1008</td><td>Iban's conscience</td><td>The remains of a dove that died long ago</td><td>-</td><td>-</td></tr> <tr><td><1009.png></td><td>1009</td><td>Amulet of Othainian</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1010.png></td><td>1010</td><td>Amulet of Doomion</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1011.png></td><td>1011</td><td>Amulet of Holthion</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1012.png></td><td>1012</td><td>keep key</td><td>A small prison key</td><td>-</td><td>-</td></tr> <tr><td><1013.png></td><td>1013</td><td>Bronze Throwing Dart</td><td>A deadly throwing dart with a bronze tip.</td><td>X</td><td>X</td></tr> <tr><td><1014.png></td><td>1014</td><td>Prototype Throwing Dart</td><td>A proto type of a deadly throwing dart.</td><td>-</td><td>X</td></tr> <tr><td><1015.png></td><td>1015</td><td>Iron Throwing Dart</td><td>A deadly throwing dart with an iron tip.</td><td>X</td><td>X</td></tr> <tr><td><1016.png></td><td>1016</td><td>Full Water Skin</td><td>A skinful of water</td><td>-</td><td>-</td></tr> <tr><td><1017.png></td><td>1017</td><td>Lens mould</td><td>A peculiar mould in the shape of a disc</td><td>-</td><td>-</td></tr> <tr><td><1018.png></td><td>1018</td><td>Lens</td><td>A perfectly formed glass disc</td><td>-</td><td>-</td></tr> <tr><td><1019.png></td><td>1019</td><td>Desert Robe</td><td>Cool light robe to wear in the desert</td><td>X</td><td>-</td></tr> <tr><td><1020.png></td><td>1020</td><td>Desert Shirt</td><td>A light cool shirt to wear in the desert</td><td>X</td><td>-</td></tr> <tr><td><1021.png></td><td>1021</td><td>Metal Key</td><td>A large metalic key.</td><td>-</td><td>-</td></tr> <tr><td><1022.png></td><td>1022</td><td>Slaves Robe Bottom</td><td>A dirty desert skirt</td><td>X</td><td>-</td></tr> <tr><td><1023.png></td><td>1023</td><td>Slaves Robe Top</td><td>A dirty desert shirt</td><td>X</td><td>-</td></tr> <tr><td><1024.png></td><td>1024</td><td>Steel Throwing Dart</td><td>A deadly throwing dart with a steel tip.</td><td>X</td><td>X</td></tr> <tr><td><1025.png></td><td>1025</td><td>Astrology Book</td><td>A book on Astrology in runescape</td><td>-</td><td>-</td></tr> <tr><td><1026.png></td><td>1026</td><td>Unholy Symbol mould</td><td>use this with silver in a furnace</td><td>-</td><td>-</td></tr> <tr><td><1027.png></td><td>1027</td><td>Unholy Symbol of Zamorak</td><td>this needs stringing</td><td>-</td><td>-</td></tr> <tr><td><1028.png></td><td>1028</td><td>Unblessed Unholy Symbol of Zamorak</td><td>this needs blessing</td><td>X</td><td>-</td></tr> <tr><td><1029.png></td><td>1029</td><td>Unholy Symbol of Zamorak</td><td>a symbol indicating allegiance to Zamorak</td><td>X</td><td>-</td></tr> <tr><td><1030.png></td><td>1030</td><td>Shantay Desert Pass</td><td>Allows you into the desert through the Shantay pass worth 5 gold.</td><td>-</td><td>X</td></tr> <tr><td><1031.png></td><td>1031</td><td>Staff of Iban</td><td>The staff is damaged</td><td>-</td><td>-</td></tr> <tr><td><1032.png></td><td>1032</td><td>Dwarf cannon base</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1033.png></td><td>1033</td><td>Dwarf cannon stand</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1034.png></td><td>1034</td><td>Dwarf cannon barrels</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1035.png></td><td>1035</td><td>Dwarf cannon furnace</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1036.png></td><td>1036</td><td>Fingernails</td><td>Ugh gross!</td><td>-</td><td>-</td></tr> <tr><td><1037.png></td><td>1037</td><td>Powering crystal1</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1038.png></td><td>1038</td><td>Mining Barrel</td><td>A roughly constructed barrel for carrying rock.</td><td>-</td><td>-</td></tr> <tr><td><1039.png></td><td>1039</td><td>Ana in a Barrel</td><td>A roughly constructed barrel with an Ana in it!</td><td>-</td><td>-</td></tr> <tr><td><1040.png></td><td>1040</td><td>Stolen gold</td><td>I wish I could spend it</td><td>-</td><td>-</td></tr> <tr><td><1041.png></td><td>1041</td><td>multi cannon ball</td><td>A heavy metal spiked ball</td><td>-</td><td>X</td></tr> <tr><td><1042.png></td><td>1042</td><td>Railing</td><td>A metal railing replacement</td><td>-</td><td>-</td></tr> <tr><td><1043.png></td><td>1043</td><td>Ogre tooth</td><td>big sharp and nasty</td><td>-</td><td>-</td></tr> <tr><td><1044.png></td><td>1044</td><td>Ogre relic</td><td>A grotesque symbol of the ogres</td><td>-</td><td>-</td></tr> <tr><td><1045.png></td><td>1045</td><td>Skavid map</td><td>A map of cave locations</td><td>-</td><td>-</td></tr> <tr><td><1046.png></td><td>1046</td><td>dwarf remains</td><td>The remains of a dwarf savaged by goblins</td><td>-</td><td>-</td></tr> <tr><td><1047.png></td><td>1047</td><td>Key</td><td>A key for a chest</td><td>-</td><td>-</td></tr> <tr><td><1048.png></td><td>1048</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1049.png></td><td>1049</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1050.png></td><td>1050</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1051.png></td><td>1051</td><td>Ground bat bones</td><td>The ground bones of a bat</td><td>-</td><td>-</td></tr> <tr><td><1052.png></td><td>1052</td><td>Unfinished potion</td><td>I need another ingredient to finish the shaman potion</td><td>-</td><td>-</td></tr> <tr><td><1053.png></td><td>1053</td><td>Ogre potion</td><td>A strange liquid</td><td>-</td><td>-</td></tr> <tr><td><1054.png></td><td>1054</td><td>Magic ogre potion</td><td>A strange liquid that bubbles with power</td><td>-</td><td>-</td></tr> <tr><td><1055.png></td><td>1055</td><td>Tool kit</td><td>These could be handy!</td><td>-</td><td>-</td></tr> <tr><td><1056.png></td><td>1056</td><td>Nulodion's notes</td><td>Construction notes for dwarf cannon ammo</td><td>-</td><td>-</td></tr> <tr><td><1057.png></td><td>1057</td><td>cannon ammo mould</td><td>Used to make cannon ammo</td><td>-</td><td>-</td></tr> <tr><td><1058.png></td><td>1058</td><td>Tenti Pineapple</td><td>The most delicious in the whole of Kharid</td><td>-</td><td>-</td></tr> <tr><td><1059.png></td><td>1059</td><td>Bedobin Copy Key</td><td>A copy of a key for the captains of the mining camps chest</td><td>-</td><td>-</td></tr> <tr><td><1060.png></td><td>1060</td><td>Technical Plans</td><td>Very technical looking plans for making a thrown weapon of some sort</td><td>-</td><td>-</td></tr> <tr><td><1061.png></td><td>1061</td><td>Rock cake</td><td>Yum... I think!</td><td>-</td><td>-</td></tr> <tr><td><1062.png></td><td>1062</td><td>Bronze dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1063.png></td><td>1063</td><td>Iron dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1064.png></td><td>1064</td><td>Steel dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1065.png></td><td>1065</td><td>Mithril dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1066.png></td><td>1066</td><td>Adamantite dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1067.png></td><td>1067</td><td>Rune dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1068.png></td><td>1068</td><td>Mithril Throwing Dart</td><td>A deadly throwing dart with a mithril tip.</td><td>X</td><td>X</td></tr> <tr><td><1069.png></td><td>1069</td><td>Adamantite Throwing Dart</td><td>A deadly throwing dart with an adamantite tip.</td><td>X</td><td>X</td></tr> <tr><td><1070.png></td><td>1070</td><td>Rune Throwing Dart</td><td>A deadly throwing dart with a runite tip.</td><td>X</td><td>X</td></tr> <tr><td><1071.png></td><td>1071</td><td>Prototype dart tip</td><td>Dangerous looking dart tip - needs feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1072.png></td><td>1072</td><td>info document</td><td>read to access variable choices</td><td>-</td><td>-</td></tr> <tr><td><1073.png></td><td>1073</td><td>Instruction manual</td><td>An old note book</td><td>-</td><td>-</td></tr> <tr><td><1074.png></td><td>1074</td><td>Unfinished potion</td><td>I need another ingredient to finish this potion</td><td>-</td><td>-</td></tr> <tr><td><1075.png></td><td>1075</td><td>Iron throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1076.png></td><td>1076</td><td>Bronze throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1077.png></td><td>1077</td><td>Steel throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1078.png></td><td>1078</td><td>Mithril throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1079.png></td><td>1079</td><td>Adamantite throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1080.png></td><td>1080</td><td>Rune throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1081.png></td><td>1081</td><td>Black throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1082.png></td><td>1082</td><td>Water Skin mostly full</td><td>A half full skin of water</td><td>-</td><td>-</td></tr> <tr><td><1083.png></td><td>1083</td><td>Water Skin mostly empty</td><td>A half empty skin of water</td><td>-</td><td>-</td></tr> <tr><td><1084.png></td><td>1084</td><td>Water Skin mouthful left</td><td>A waterskin with a mouthful of water left</td><td>-</td><td>-</td></tr> <tr><td><1085.png></td><td>1085</td><td>Empty Water Skin</td><td>A completely empty waterskin</td><td>-</td><td>-</td></tr> <tr><td><1086.png></td><td>1086</td><td>nightshade</td><td>Deadly!</td><td>-</td><td>-</td></tr> <tr><td><1087.png></td><td>1087</td><td>Shaman robe</td><td>This has been left by one of the dead ogre shaman</td><td>-</td><td>-</td></tr> <tr><td><1088.png></td><td>1088</td><td>Iron Spear</td><td>An iron tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1089.png></td><td>1089</td><td>Steel Spear</td><td>A steel tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1090.png></td><td>1090</td><td>Mithril Spear</td><td>A mithril tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1091.png></td><td>1091</td><td>Adamantite Spear</td><td>An adamantite tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1092.png></td><td>1092</td><td>Rune Spear</td><td>A rune tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1093.png></td><td>1093</td><td>Cat</td><td>it's fluffs</td><td>-</td><td>-</td></tr> <tr><td><1094.png></td><td>1094</td><td>Seasoned Sardine</td><td>They don't smell any better</td><td>-</td><td>-</td></tr> <tr><td><1095.png></td><td>1095</td><td>Kittens</td><td>purrr</td><td>-</td><td>-</td></tr> <tr><td><1096.png></td><td>1096</td><td>Kitten</td><td>purrr</td><td>-</td><td>-</td></tr> <tr><td><1097.png></td><td>1097</td><td>Wrought iron key</td><td>This key clears unlocks a very sturdy gate of some sort.</td><td>-</td><td>-</td></tr> <tr><td><1098.png></td><td>1098</td><td>Cell Door Key</td><td>A roughly hewn key</td><td>-</td><td>-</td></tr> <tr><td><1099.png></td><td>1099</td><td>A free Shantay Disclaimer</td><td>Very important information.</td><td>-</td><td>-</td></tr> <tr><td><1100.png></td><td>1100</td><td>Doogle leaves</td><td>Small sweet smelling leaves</td><td>-</td><td>-</td></tr> <tr><td><1101.png></td><td>1101</td><td>Raw Ugthanki Meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><1102.png></td><td>1102</td><td>Tasty Ugthanki Kebab</td><td>A fresh Kebab made from Ugthanki meat</td><td>-</td><td>-</td></tr> <tr><td><1103.png></td><td>1103</td><td>Cooked Ugthanki Meat</td><td>Freshly cooked Ugthanki meat</td><td>-</td><td>-</td></tr> <tr><td><1104.png></td><td>1104</td><td>Uncooked Pitta Bread</td><td>I need to cook this.</td><td>-</td><td>-</td></tr> <tr><td><1105.png></td><td>1105</td><td>Pitta Bread</td><td>Mmmm I need to add some other ingredients yet.</td><td>-</td><td>-</td></tr> <tr><td><1106.png></td><td>1106</td><td>Tomato Mixture</td><td>A mixture of tomatoes in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1107.png></td><td>1107</td><td>Onion Mixture</td><td>A mixture of onions in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1108.png></td><td>1108</td><td>Onion and Tomato Mixture</td><td>A mixture of onions and tomatoes in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1109.png></td><td>1109</td><td>Onion and Tomato and Ugthanki Mix</td><td>A mixture of onions and tomatoes and Ugthanki meat in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1110.png></td><td>1110</td><td>Burnt Pitta Bread</td><td>Urgh - it's all burnt</td><td>-</td><td>-</td></tr> <tr><td><1111.png></td><td>1111</td><td>Panning tray</td><td>used for panning gold</td><td>-</td><td>-</td></tr> <tr><td><1112.png></td><td>1112</td><td>Panning tray</td><td>this tray contains gold nuggets</td><td>-</td><td>-</td></tr> <tr><td><1113.png></td><td>1113</td><td>Panning tray</td><td>this tray contains mud</td><td>-</td><td>-</td></tr> <tr><td><1114.png></td><td>1114</td><td>Rock pick</td><td>a sharp pick for cracking rocks</td><td>-</td><td>-</td></tr> <tr><td><1115.png></td><td>1115</td><td>Specimen brush</td><td>stiff brush for cleaning specimens</td><td>-</td><td>-</td></tr> <tr><td><1116.png></td><td>1116</td><td>Specimen jar</td><td>a jar for holding soil samples</td><td>-</td><td>-</td></tr> <tr><td><1117.png></td><td>1117</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1118.png></td><td>1118</td><td>gold Nuggets</td><td>Real gold pieces!</td><td>-</td><td>X</td></tr> <tr><td><1119.png></td><td>1119</td><td>cat</td><td>looks like a healthy one</td><td>-</td><td>-</td></tr> <tr><td><1120.png></td><td>1120</td><td>Scrumpled piece of paper</td><td>A piece of paper with barely legible writing - looks like a recipe!</td><td>-</td><td>-</td></tr> <tr><td><1121.png></td><td>1121</td><td>Digsite info</td><td>IAN ONLY</td><td>-</td><td>-</td></tr> <tr><td><1122.png></td><td>1122</td><td>Poisoned Bronze Throwing Dart</td><td>A venomous throwing dart with a bronze tip.</td><td>X</td><td>X</td></tr> <tr><td><1123.png></td><td>1123</td><td>Poisoned Iron Throwing Dart</td><td>A venomous throwing dart with an iron tip.</td><td>X</td><td>X</td></tr> <tr><td><1124.png></td><td>1124</td><td>Poisoned Steel Throwing Dart</td><td>A venomous throwing dart with a steel tip.</td><td>X</td><td>X</td></tr> <tr><td><1125.png></td><td>1125</td><td>Poisoned Mithril Throwing Dart</td><td>A venomous throwing dart with a mithril tip.</td><td>X</td><td>X</td></tr> <tr><td><1126.png></td><td>1126</td><td>Poisoned Adamantite Throwing Dart</td><td>A venomous throwing dart with an adamantite tip.</td><td>X</td><td>X</td></tr> <tr><td><1127.png></td><td>1127</td><td>Poisoned Rune Throwing Dart</td><td>A deadly venomous dart with a runite tip.</td><td>X</td><td>X</td></tr> <tr><td><1128.png></td><td>1128</td><td>Poisoned Bronze throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1129.png></td><td>1129</td><td>Poisoned Iron throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1130.png></td><td>1130</td><td>Poisoned Steel throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1131.png></td><td>1131</td><td>Poisoned Mithril throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1132.png></td><td>1132</td><td>Poisoned Black throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1133.png></td><td>1133</td><td>Poisoned Adamantite throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1134.png></td><td>1134</td><td>Poisoned Rune throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1135.png></td><td>1135</td><td>Poisoned Bronze Spear</td><td>A bronze tipped spear with added venom </td><td>X</td><td>-</td></tr> <tr><td><1136.png></td><td>1136</td><td>Poisoned Iron Spear</td><td>An iron tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1137.png></td><td>1137</td><td>Poisoned Steel Spear</td><td>A steel tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1138.png></td><td>1138</td><td>Poisoned Mithril Spear</td><td>A mithril tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1139.png></td><td>1139</td><td>Poisoned Adamantite Spear</td><td>An adamantite tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1140.png></td><td>1140</td><td>Poisoned Rune Spear</td><td>A rune tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1141.png></td><td>1141</td><td>Book of experimental chemistry</td><td>A book on experiments with volatile chemicals</td><td>-</td><td>-</td></tr> <tr><td><1142.png></td><td>1142</td><td>Level 1 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1143.png></td><td>1143</td><td>Level 2 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1144.png></td><td>1144</td><td>Level 3 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1145.png></td><td>1145</td><td>Trowel</td><td>A small device for digging</td><td>-</td><td>-</td></tr> <tr><td><1146.png></td><td>1146</td><td>Stamped letter of recommendation</td><td>A stamped scroll with a recommendation on it</td><td>-</td><td>-</td></tr> <tr><td><1147.png></td><td>1147</td><td>Unstamped letter of recommendation</td><td>I hereby recommend this student to undertake the Varrock City earth sciences exams</td><td>-</td><td>-</td></tr> <tr><td><1148.png></td><td>1148</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1149.png></td><td>1149</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1150.png></td><td>1150</td><td>Cracked rock Sample</td><td>It's been cracked open</td><td>-</td><td>-</td></tr> <tr><td><1151.png></td><td>1151</td><td>Belt buckle</td><td>been here some time</td><td>-</td><td>-</td></tr> <tr><td><1152.png></td><td>1152</td><td>Powering crystal2</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1153.png></td><td>1153</td><td>Powering crystal3</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1154.png></td><td>1154</td><td>Powering crystal4</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1155.png></td><td>1155</td><td>Old boot</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1156.png></td><td>1156</td><td>Bunny ears</td><td>Get another from the clothes shop if you die</td><td>X</td><td>-</td></tr> <tr><td><1157.png></td><td>1157</td><td>Damaged armour</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1158.png></td><td>1158</td><td>Damaged armour</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1159.png></td><td>1159</td><td>Rusty sword</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1160.png></td><td>1160</td><td>Ammonium Nitrate</td><td>An acrid chemical</td><td>-</td><td>-</td></tr> <tr><td><1161.png></td><td>1161</td><td>Nitroglycerin</td><td>A strong acidic formula</td><td>-</td><td>-</td></tr> <tr><td><1162.png></td><td>1162</td><td>Old tooth</td><td>a large single tooth</td><td>-</td><td>-</td></tr> tr><td><1163.png></td><td>1163</td><td>Radimus Scrolls</td><td>Scrolls that Radimus gave you</td><td>-</td><td>-</td></tr> <tr><td><1164.png></td><td>1164</td><td>chest key</td><td>A small key for a chest</td><td>-</td><td>-</td></tr> <tr><td><1165.png></td><td>1165</td><td>broken arrow</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1166.png></td><td>1166</td><td>buttons</td><td>they've been here some time</td><td>-</td><td>-</td></tr> <tr><td><1167.png></td><td>1167</td><td>broken staff</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1168.png></td><td>1168</td><td>vase</td><td>An old vase</td><td>-</td><td>-</td></tr> <tr><td><1169.png></td><td>1169</td><td>ceramic remains</td><td>some ancient pottery</td><td>-</td><td>-</td></tr> <tr><td><1170.png></td><td>1170</td><td>Broken glass</td><td>smashed glass</td><td>-</td><td>-</td></tr> <tr><td><1171.png></td><td>1171</td><td>Unidentified powder</td><td>who knows what this is for?</td><td>-</td><td>-</td></tr> <tr><td><1172.png></td><td>1172</td><td>Machette</td><td>A purpose built tool for cutting through thick jungle.</td><td>X</td><td>-</td></tr> <tr><td><1173.png></td><td>1173</td><td>Scroll</td><td>A letter written by the expert</td><td>-</td><td>-</td></tr> <tr><td><1174.png></td><td>1174</td><td>stone tablet</td><td>some ancient script is engraved on here</td><td>-</td><td>-</td></tr> <tr><td><1175.png></td><td>1175</td><td>Talisman of Zaros</td><td>an ancient item</td><td>-</td><td>-</td></tr> <tr><td><1176.png></td><td>1176</td><td>Explosive compound</td><td>A dark mystical powder</td><td>-</td><td>-</td></tr> <tr><td><1177.png></td><td>1177</td><td>Bull Roarer</td><td>A sound producing instrument - it may attract attention</td><td>-</td><td>-</td></tr> <tr><td><1178.png></td><td>1178</td><td>Mixed chemicals</td><td>A pungent mix of 2 chemicals</td><td>-</td><td>-</td></tr> <tr><td><1179.png></td><td>1179</td><td>Ground charcoal</td><td>Powdered charcoal!</td><td>-</td><td>-</td></tr> <tr><td><1180.png></td><td>1180</td><td>Mixed chemicals</td><td>A pungent mix of 3 chemicals</td><td>-</td><td>-</td></tr> <tr><td><1181.png></td><td>1181</td><td>Spell scroll</td><td>A magical scroll</td><td>-</td><td>-</td></tr> <tr><td><1182.png></td><td>1182</td><td>Yommi tree seed</td><td>A magical seed that grows into a Yommi tree - these need to be germinated</td><td>-</td><td>X</td></tr> <tr><td><1183.png></td><td>1183</td><td>Totem Pole</td><td>A well crafted totem pole</td><td>-</td><td>-</td></tr> <tr><td><1184.png></td><td>1184</td><td>Dwarf cannon base</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1185.png></td><td>1185</td><td>Dwarf cannon stand</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1186.png></td><td>1186</td><td>Dwarf cannon barrels</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1187.png></td><td>1187</td><td>Dwarf cannon furnace</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1188.png></td><td>1188</td><td>Golden Bowl</td><td>A specially made bowl constructed out of pure gold</td><td>-</td><td>-</td></tr> <tr><td><1189.png></td><td>1189</td><td>Golden Bowl with pure water</td><td>A golden bowl filled with pure water</td><td>-</td><td>-</td></tr> <tr><td><1190.png></td><td>1190</td><td>Raw Manta ray</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1191.png></td><td>1191</td><td>Manta ray</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1192.png></td><td>1192</td><td>Raw Sea turtle</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1193.png></td><td>1193</td><td>Sea turtle</td><td>Tasty!</td><td>-</td><td>-</td></tr> <tr><td><1194.png></td><td>1194</td><td>Annas Silver Necklace</td><td>A necklace coated with silver</td><td>X</td><td>-</td></tr> <tr><td><1195.png></td><td>1195</td><td>Bobs Silver Teacup</td><td>A tea cup coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1196.png></td><td>1196</td><td>Carols Silver Bottle</td><td>A little bottle coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1197.png></td><td>1197</td><td>Davids Silver Book</td><td>An ornamental book coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1198.png></td><td>1198</td><td>Elizabeths Silver Needle</td><td>An ornamental needle coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1199.png></td><td>1199</td><td>Franks Silver Pot</td><td>A small pot coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1200.png></td><td>1200</td><td>Thread</td><td>A piece of red thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1201.png></td><td>1201</td><td>Thread</td><td>A piece of green thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1202.png></td><td>1202</td><td>Thread</td><td>A piece of blue thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1203.png></td><td>1203</td><td>Flypaper</td><td>Sticky paper for catching flies</td><td>-</td><td>-</td></tr> <tr><td><1204.png></td><td>1204</td><td>Murder Scene Pot</td><td>The pot has a sickly smell of poison mixed with wine</td><td>-</td><td>-</td></tr> <tr><td><1205.png></td><td>1205</td><td>A Silver Dagger</td><td>Dagger Found at crime scene</td><td>X</td><td>-</td></tr> <tr><td><1206.png></td><td>1206</td><td>Murderers fingerprint</td><td>An impression of the murderers fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1207.png></td><td>1207</td><td>Annas fingerprint</td><td>An impression of Annas fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1208.png></td><td>1208</td><td>Bobs fingerprint</td><td>An impression of Bobs fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1209.png></td><td>1209</td><td>Carols fingerprint</td><td>An impression of Carols fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1210.png></td><td>1210</td><td>Davids fingerprint</td><td>An impression of Davids fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1211.png></td><td>1211</td><td>Elizabeths fingerprint</td><td>An impression of Elizabeths fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1212.png></td><td>1212</td><td>Franks fingerprint</td><td>An impression of Franks fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1213.png></td><td>1213</td><td>Zamorak Cape</td><td>A cape from the almighty zamorak</td><td>X</td><td>-</td></tr> <tr><td><1214.png></td><td>1214</td><td>Saradomin Cape</td><td>A cape from the almighty saradomin</td><td>X</td><td>-</td></tr> <tr><td><1215.png></td><td>1215</td><td>Guthix Cape</td><td>A cape from the almighty guthix</td><td>X</td><td>-</td></tr> <tr><td><1216.png></td><td>1216</td><td>Staff of zamorak</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1217.png></td><td>1217</td><td>Staff of guthix</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1218.png></td><td>1218</td><td>Staff of Saradomin</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1219.png></td><td>1219</td><td>A chunk of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1220.png></td><td>1220</td><td>A lump of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1221.png></td><td>1221</td><td>A hunk of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1222.png></td><td>1222</td><td>A red crystal</td><td>A heart shaped red crystal </td><td>-</td><td>-</td></tr> <tr><td><1223.png></td><td>1223</td><td>Unidentified fingerprint</td><td>An impression of the murderers fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1224.png></td><td>1224</td><td>Annas Silver Necklace</td><td>A silver necklace coated with flour</td><td>X</td><td>-</td></tr> <tr><td><1225.png></td><td>1225</td><td>Bobs Silver Teacup</td><td>A silver tea cup coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1226.png></td><td>1226</td><td>Carols Silver Bottle</td><td>A little silver bottle coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1227.png></td><td>1227</td><td>Davids Silver Book</td><td>An ornamental silver book coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1228.png></td><td>1228</td><td>Elizabeths Silver Needle</td><td>An ornamental silver needle coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1229.png></td><td>1229</td><td>Franks Silver Pot</td><td>A small silver pot coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1230.png></td><td>1230</td><td>A Silver Dagger</td><td>Dagger Found at crime scene coated with flour</td><td>X</td><td>-</td></tr> <tr><td><1231.png></td><td>1231</td><td>A glowing red crystal</td><td>A glowing heart shaped red crystal - great magic must be present in this item</td><td>-</td><td>-</td></tr> <tr><td><1232.png></td><td>1232</td><td>Unidentified liquid</td><td>A strong acidic formula</td><td>-</td><td>-</td></tr> <tr><td><1233.png></td><td>1233</td><td>Radimus Scrolls</td><td>Mission briefing and the completed map of Karamja - Sir Radimus will be pleased...</td><td>-</td><td>-</td></tr> <tr><td><1234.png></td><td>1234</td><td>Robe</td><td>A worn robe</td><td>X</td><td>-</td></tr> <tr><td><1235.png></td><td>1235</td><td>Armour</td><td>An unusually red armour</td><td>-</td><td>-</td></tr> <tr><td><1236.png></td><td>1236</td><td>Dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><1237.png></td><td>1237</td><td>eye patch</td><td>It makes me look very piratical</td><td>X</td><td>-</td></tr> <tr><td><1238.png></td><td>1238</td><td>Booking of Binding</td><td>An ancient tome on Demonology</td><td>-</td><td>-</td></tr> <tr><td><1239.png></td><td>1239</td><td>Holy Water Vial</td><td>A deadly potion against evil kin</td><td>X</td><td>-</td></tr> <tr><td><1240.png></td><td>1240</td><td>Enchanted Vial</td><td>This enchanted vial is empty - but is ready for magical liquids.</td><td>-</td><td>-</td></tr> <tr><td><1241.png></td><td>1241</td><td>Scribbled notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1242.png></td><td>1242</td><td>Scrawled notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1243.png></td><td>1243</td><td>Scatched notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1244.png></td><td>1244</td><td>Shamans Tome</td><td>An ancient tome on various subjects...</td><td>-</td><td>-</td></tr> <tr><td><1245.png></td><td>1245</td><td>Edible seaweed</td><td>slightly damp seaweed</td><td>-</td><td>-</td></tr> <tr><td><1246.png></td><td>1246</td><td>Rough Sketch of a bowl</td><td>A roughly sketched picture of a bowl made from metal</td><td>-</td><td>-</td></tr> <tr><td><1247.png></td><td>1247</td><td>Burnt Manta ray</td><td>oops!</td><td>-</td><td>-</td></tr> <tr><td><1248.png></td><td>1248</td><td>Burnt Sea turtle</td><td>oops!</td><td>-</td><td>-</td></tr> <tr><td><1249.png></td><td>1249</td><td>Cut reed plant</td><td>A narrow long tube - it might be useful for something</td><td>-</td><td>-</td></tr> <tr><td><1250.png></td><td>1250</td><td>Magical Fire Pass</td><td>A pass which allows you to cross the flaming walls into the Flaming Octagon</td><td>-</td><td>-</td></tr> <tr><td><1251.png></td><td>1251</td><td>Snakes Weed Solution</td><td>Snakes weed in water - part of a potion</td><td>-</td><td>-</td></tr> <tr><td><1252.png></td><td>1252</td><td>Ardrigal Solution</td><td>Ardrigal herb in water - part of a potion</td><td>-</td><td>-</td></tr> <tr><td><1253.png></td><td>1253</td><td>Gujuo Potion</td><td>A potion to help against fear of the supernatural</td><td>-</td><td>-</td></tr> <tr><td><1254.png></td><td>1254</td><td>Germinated Yommi tree seed</td><td>A magical seed that grows into a Yommi tree - these have been germinated.</td><td>-</td><td>X</td></tr> <tr><td><1255.png></td><td>1255</td><td>Dark Dagger</td><td>An unusual looking dagger made of dark shiny obsidian</td><td>X</td><td>-</td></tr> <tr><td><1256.png></td><td>1256</td><td>Glowing Dark Dagger</td><td>An unusual looking dagger made of dark shiny obsidian - it has an unnatural glow .</td><td>X</td><td>-</td></tr> <tr><td><1257.png></td><td>1257</td><td>Holy Force Spell</td><td>A powerful incantation - it affects spirits of the underworld</td><td>-</td><td>-</td></tr> <tr><td><1258.png></td><td>1258</td><td>Iron Pickaxe</td><td>Used for mining</td><td>-</td><td>-</td></tr> <tr><td><1259.png></td><td>1259</td><td>Steel Pickaxe</td><td>Requires level 6 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1260.png></td><td>1260</td><td>Mithril Pickaxe</td><td>Requires level 21 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1261.png></td><td>1261</td><td>Adamantite Pickaxe</td><td>Requires level 31 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1262.png></td><td>1262</td><td>Rune Pickaxe</td><td>Requires level 41 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1263.png></td><td>1263</td><td>Sleeping Bag</td><td>Not as comfy as a bed but better than nothing</td><td>-</td><td>-</td></tr> <tr><td><1264.png></td><td>1264</td><td>A blue wizards hat</td><td>An ancient wizards hat.</td><td>X</td><td>-</td></tr> <tr><td><1265.png></td><td>1265</td><td>Gilded Totem Pole</td><td>A well crafted totem pole - given to you as a gift from Gujuo</td><td>-</td><td>-</td></tr> <tr><td><1266.png></td><td>1266</td><td>Blessed Golden Bowl</td><td>A specially made bowl constructed out of pure gold - it looks magical somehow</td><td>-</td><td>-</td></tr> <tr><td><1267.png></td><td>1267</td><td>Blessed Golden Bowl with Pure Water</td><td>A golden bowl filled with pure water - it looks magical somehow</td><td>-</td><td>-</td></tr> <tr><td><1268.png></td><td>1268</td><td>Raw Oomlie Meat</td><td>Raw meat from the Oomlie bird</td><td>-</td><td>-</td></tr> <tr><td><1269.png></td><td>1269</td><td>Cooked Oomlie meat Parcel</td><td>Deliciously cooked Oomlie meat in a palm leaf pouch.</td><td>-</td><td>-</td></tr> <tr><td><1270.png></td><td>1270</td><td>Dragon Bone Certificate</td><td>Each certificate exchangable at Yanille for 5 Dragon Bones</td><td>-</td><td>X</td></tr> <tr><td><1271.png></td><td>1271</td><td>Limpwurt Root Certificate</td><td>Each certificate exchangable at Yanille for 5 Limpwort roots</td><td>-</td><td>X</td></tr> <tr><td><1272.png></td><td>1272</td><td>Prayer Potion Certificate</td><td>Each certificate exchangable at Yanille for 5 prayer potions</td><td>-</td><td>X</td></tr> <tr><td><1273.png></td><td>1273</td><td>Super Attack Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1274.png></td><td>1274</td><td>Super Defense Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1275.png></td><td>1275</td><td>Super Strength Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1276.png></td><td>1276</td><td>Half Dragon Square Shield</td><td>The Right Half of an ancient and powerful looking Dragon Square shield.</td><td>-</td><td>-</td></tr> <tr><td><1277.png></td><td>1277</td><td>Half Dragon Square Shield</td><td>Left Half of an ancient and powerful looking Dragon Square shield.</td><td>-</td><td>-</td></tr> <tr><td><1278.png></td><td>1278</td><td>Dragon Square Shield</td><td>An ancient and powerful looking Dragon Square shield.</td><td>X</td><td>-</td></tr> <tr><td><1279.png></td><td>1279</td><td>Palm tree leaf</td><td>A thick green plam leaf - natives use this to cook meat in</td><td>-</td><td>-</td></tr> <tr><td><1280.png></td><td>1280</td><td>Raw Oomlie Meat Parcel</td><td>Oomlie meat in a palm leaf pouch - just needs to be cooked.</td><td>-</td><td>-</td></tr> <tr><td><1281.png></td><td>1281</td><td>Burnt Oomlie Meat parcel</td><td>Oomlie meat in a palm leaf pouch - it's burnt.</td><td>-</td><td>-</td></tr> <tr><td><1282.png></td><td>1282</td><td>Bailing Bucket</td><td>It's a water tight bucket</td><td>-</td><td>-</td></tr> <tr><td><1283.png></td><td>1283</td><td>Plank</td><td>Damaged remains of the ship</td><td>-</td><td>-</td></tr> <tr><td><1284.png></td><td>1284</td><td>Arcenia root</td><td>the root of an arcenia plant</td><td>-</td><td>-</td></tr> <tr><td><1285.png></td><td>1285</td><td>display tea</td><td>A nice cup of tea - for display only</td><td>-</td><td>-</td></tr> <tr><td><1286.png></td><td>1286</td><td>Blessed Golden Bowl with plain water</td><td>A golden bowl filled with plain water</td><td>-</td><td>-</td></tr> <tr><td><1287.png></td><td>1287</td><td>Golden Bowl with plain water</td><td>A golden bowl filled with plain water</td><td>-</td><td>-</td></tr> <tr><td><1288.png></td><td>1288</td><td>Cape of legends</td><td>Shows I am a member of the legends guild</td><td>X</td><td>-</td></tr> <tr><td><1289.png></td><td>1289</td><td>Scythe</td><td>Get another from the clothes shop if you die</td><td>X</td><td>-</td></tr> </table> 122 2011-06-20T04:54:06Z Admin 1 [[Category:RSC]] <table border="1" cellpadding="3" cellspacing="3"> <tr><td></td><td>id</td><td>item name</td><td>description</td><td>wieldable</td><td>stackable</td></tr> <tr><td><0.png></td><td>0</td><td>Iron Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><1.png></td><td>1</td><td>Iron Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><2.png></td><td>2</td><td>Iron Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><3.png></td><td>3</td><td>Iron Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><4.png></td><td>4</td><td>Wooden Shield</td><td>A solid wooden shield</td><td>X</td><td>-</td></tr> <tr><td><5.png></td><td>5</td><td>Medium Iron Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><6.png></td><td>6</td><td>Large Iron Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><7.png></td><td>7</td><td>Iron Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><8.png></td><td>8</td><td>Iron Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><9.png></td><td>9</td><td>Iron Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><10.png></td><td>10</td><td>Coins</td><td>Lovely money!</td><td>-</td><td>X</td></tr> <tr><td><11.png></td><td>11</td><td>Bronze Arrows</td><td>Arrows with bronze heads</td><td>-</td><td>X</td></tr> <tr><td><12.png></td><td>12</td><td>Iron Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><13.png></td><td>13</td><td>Knife</td><td>A dangerous looking knife</td><td>-</td><td>-</td></tr> <tr><td><14.png></td><td>14</td><td>Logs</td><td>A number of wooden logs</td><td>-</td><td>-</td></tr> <tr><td><15.png></td><td>15</td><td>Leather Armour</td><td>Better than no armour!</td><td>X</td><td>-</td></tr> <tr><td><16.png></td><td>16</td><td>Leather Gloves</td><td>These will keep my hands warm!</td><td>X</td><td>-</td></tr> <tr><td><17.png></td><td>17</td><td>Boots</td><td>Comfortable leather boots</td><td>X</td><td>-</td></tr> <tr><td><18.png></td><td>18</td><td>Cabbage</td><td>Yuck I don't like cabbage</td><td>-</td><td>-</td></tr> <tr><td><19.png></td><td>19</td><td>Egg</td><td>A nice fresh egg</td><td>-</td><td>-</td></tr> <tr><td><20.png></td><td>20</td><td>Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><21.png></td><td>21</td><td>Bucket</td><td>It's a wooden bucket</td><td>-</td><td>-</td></tr> <tr><td><22.png></td><td>22</td><td>Milk</td><td>It's a bucket of milk</td><td>-</td><td>-</td></tr> <tr><td><23.png></td><td>23</td><td>Flour</td><td>A little heap of flour</td><td>-</td><td>-</td></tr> <tr><td><24.png></td><td>24</td><td>Amulet of GhostSpeak</td><td>It lets me talk to ghosts</td><td>X</td><td>-</td></tr> <tr><td><25.png></td><td>25</td><td>Silverlight key 1</td><td>A key given to me by Wizard Traiborn</td><td>-</td><td>-</td></tr> <tr><td><26.png></td><td>26</td><td>Silverlight key 2</td><td>A key given to me by Captain Rovin</td><td>-</td><td>-</td></tr> <tr><td><27.png></td><td>27</td><td>skull</td><td>A spooky looking skull</td><td>-</td><td>-</td></tr> <tr><td><28.png></td><td>28</td><td>Iron dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><29.png></td><td>29</td><td>grain</td><td>Some wheat heads</td><td>-</td><td>-</td></tr> <tr><td><30.png></td><td>30</td><td>Book</td><td></td><td>-</td><td>-</td></tr> <tr><td><31.png></td><td>31</td><td>Fire-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><32.png></td><td>32</td><td>Water-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><33.png></td><td>33</td><td>Air-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><34.png></td><td>34</td><td>Earth-Rune</td><td>One of the 4 basic elemental runes</td><td>-</td><td>X</td></tr> <tr><td><35.png></td><td>35</td><td>Mind-Rune</td><td>Used for low level missile spells</td><td>-</td><td>X</td></tr> <tr><td><36.png></td><td>36</td><td>Body-Rune</td><td>Used for curse spells</td><td>-</td><td>X</td></tr> <tr><td><37.png></td><td>37</td><td>Life-Rune</td><td>Used for summon spells</td><td>-</td><td>X</td></tr> <tr><td><38.png></td><td>38</td><td>Death-Rune</td><td>Used for high level missile spells</td><td>-</td><td>X</td></tr> <tr><td><39.png></td><td>39</td><td>Needle</td><td>Used with a thread to make clothes</td><td>-</td><td>X</td></tr> <tr><td><40.png></td><td>40</td><td>Nature-Rune</td><td>Used for alchemy spells</td><td>-</td><td>X</td></tr> <tr><td><41.png></td><td>41</td><td>Chaos-Rune</td><td>Used for mid level missile spells</td><td>-</td><td>X</td></tr> <tr><td><42.png></td><td>42</td><td>Law-Rune</td><td>Used for teleport spells</td><td>-</td><td>X</td></tr> <tr><td><43.png></td><td>43</td><td>Thread</td><td>Used with a needle to make clothes</td><td>-</td><td>X</td></tr> <tr><td><44.png></td><td>44</td><td>Holy Symbol of saradomin</td><td>This needs a string putting on it</td><td>-</td><td>-</td></tr> <tr><td><45.png></td><td>45</td><td>Unblessed Holy Symbol</td><td>This needs blessing</td><td>X</td><td>-</td></tr> <tr><td><46.png></td><td>46</td><td>Cosmic-Rune</td><td>Used for enchant spells</td><td>-</td><td>X</td></tr> <tr><td><47.png></td><td>47</td><td>key</td><td>The key to get into the phoenix gang</td><td>-</td><td>-</td></tr> <tr><td><48.png></td><td>48</td><td>key</td><td>The key to the phoenix gang's weapons store</td><td>-</td><td>-</td></tr> <tr><td><49.png></td><td>49</td><td>scroll</td><td>An intelligence Report</td><td>-</td><td>-</td></tr> <tr><td><50.png></td><td>50</td><td>Water</td><td>It's a bucket of water</td><td>-</td><td>-</td></tr> <tr><td><51.png></td><td>51</td><td>Silverlight key 3</td><td>A key I found in a drain</td><td>-</td><td>-</td></tr> <tr><td><52.png></td><td>52</td><td>Silverlight</td><td>A magic sword</td><td>X</td><td>-</td></tr> <tr><td><53.png></td><td>53</td><td>Broken shield</td><td>Half of the shield of Arrav</td><td>-</td><td>-</td></tr> <tr><td><54.png></td><td>54</td><td>Broken shield</td><td>Half of the shield of Arrav</td><td>-</td><td>-</td></tr> <tr><td><55.png></td><td>55</td><td>Cadavaberries</td><td>Poisonous berries</td><td>-</td><td>-</td></tr> <tr><td><56.png></td><td>56</td><td>message</td><td>A message from Juliet to Romeo</td><td>-</td><td>-</td></tr> <tr><td><57.png></td><td>57</td><td>Cadava</td><td>I'm meant to give this to Juliet</td><td>-</td><td>-</td></tr> <tr><td><58.png></td><td>58</td><td>potion</td><td>this is meant to be good for spots</td><td>-</td><td>-</td></tr> <tr><td><59.png></td><td>59</td><td>Phoenix Crossbow</td><td>Former property of the phoenix gang</td><td>X</td><td>-</td></tr> <tr><td><60.png></td><td>60</td><td>Crossbow</td><td>This fires crossbow bolts</td><td>X</td><td>-</td></tr> <tr><td><61.png></td><td>61</td><td>Certificate</td><td>I can use this to claim a reward from the king</td><td>-</td><td>-</td></tr> <tr><td><62.png></td><td>62</td><td>bronze dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><63.png></td><td>63</td><td>Steel dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><64.png></td><td>64</td><td>Mithril dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><65.png></td><td>65</td><td>Adamantite dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><66.png></td><td>66</td><td>Bronze Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><67.png></td><td>67</td><td>Steel Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><68.png></td><td>68</td><td>Mithril Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><69.png></td><td>69</td><td>Adamantite Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><70.png></td><td>70</td><td>Bronze Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><71.png></td><td>71</td><td>Iron Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><72.png></td><td>72</td><td>Steel Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><73.png></td><td>73</td><td>Mithril Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><74.png></td><td>74</td><td>Adamantite Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><75.png></td><td>75</td><td>Rune long sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><76.png></td><td>76</td><td>Bronze 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><77.png></td><td>77</td><td>Iron 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><78.png></td><td>78</td><td>Steel 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><79.png></td><td>79</td><td>Mithril 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><80.png></td><td>80</td><td>Adamantite 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><81.png></td><td>81</td><td>rune 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><82.png></td><td>82</td><td>Bronze Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><83.png></td><td>83</td><td>Iron Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><84.png></td><td>84</td><td>Steel Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><85.png></td><td>85</td><td>Mithril Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><86.png></td><td>86</td><td>Adamantite Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><87.png></td><td>87</td><td>bronze Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><88.png></td><td>88</td><td>Steel Axe</td><td>A woodcutters axe</td><td>X</td><td>-</td></tr> <tr><td><89.png></td><td>89</td><td>Iron battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><90.png></td><td>90</td><td>Steel battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><91.png></td><td>91</td><td>Mithril battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><92.png></td><td>92</td><td>Adamantite battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><93.png></td><td>93</td><td>Rune battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><94.png></td><td>94</td><td>Bronze Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><95.png></td><td>95</td><td>Steel Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><96.png></td><td>96</td><td>Mithril Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><97.png></td><td>97</td><td>Adamantite Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><98.png></td><td>98</td><td>Rune Mace</td><td>A spiky mace</td><td>X</td><td>-</td></tr> <tr><td><99.png></td><td>99</td><td>Brass key</td><td>I wonder what this is the key to</td><td>-</td><td>-</td></tr> <tr><td><100.png></td><td>100</td><td>staff</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><101.png></td><td>101</td><td>Staff of Air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><102.png></td><td>102</td><td>Staff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><103.png></td><td>103</td><td>Staff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><104.png></td><td>104</td><td>Medium Bronze Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><105.png></td><td>105</td><td>Medium Steel Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><106.png></td><td>106</td><td>Medium Mithril Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><107.png></td><td>107</td><td>Medium Adamantite Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><108.png></td><td>108</td><td>Large Bronze Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><109.png></td><td>109</td><td>Large Steel Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><110.png></td><td>110</td><td>Large Mithril Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><111.png></td><td>111</td><td>Large Adamantite Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><112.png></td><td>112</td><td>Large Rune Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><113.png></td><td>113</td><td>Bronze Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><114.png></td><td>114</td><td>Steel Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><115.png></td><td>115</td><td>Mithril Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><116.png></td><td>116</td><td>Adamantite Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><117.png></td><td>117</td><td>Bronze Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><118.png></td><td>118</td><td>Steel Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><119.png></td><td>119</td><td>Mithril Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><120.png></td><td>120</td><td>Adamantite Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><121.png></td><td>121</td><td>Steel Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><122.png></td><td>122</td><td>Mithril Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><123.png></td><td>123</td><td>Adamantite Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><124.png></td><td>124</td><td>Bronze Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><125.png></td><td>125</td><td>Steel Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><126.png></td><td>126</td><td>Mithril Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><127.png></td><td>127</td><td>Adamantite Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><128.png></td><td>128</td><td>Bronze Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><129.png></td><td>129</td><td>Steel Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><130.png></td><td>130</td><td>Mithril Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><131.png></td><td>131</td><td>Adamantite Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><132.png></td><td>132</td><td>cookedmeat</td><td>Mmm this looks tasty</td><td>-</td><td>-</td></tr> <tr><td><133.png></td><td>133</td><td>raw chicken</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><134.png></td><td>134</td><td>burntmeat</td><td>Oh dear</td><td>-</td><td>-</td></tr> <tr><td><135.png></td><td>135</td><td>pot</td><td>This pot is empty</td><td>-</td><td>-</td></tr> <tr><td><136.png></td><td>136</td><td>flour</td><td>There is flour in this pot</td><td>-</td><td>-</td></tr> <tr><td><137.png></td><td>137</td><td>bread dough</td><td>Some uncooked dough</td><td>-</td><td>-</td></tr> <tr><td><138.png></td><td>138</td><td>bread</td><td>Nice crispy bread</td><td>-</td><td>-</td></tr> <tr><td><139.png></td><td>139</td><td>burntbread</td><td>This bread is ruined!</td><td>-</td><td>-</td></tr> <tr><td><140.png></td><td>140</td><td>jug</td><td>This jug is empty</td><td>-</td><td>-</td></tr> <tr><td><141.png></td><td>141</td><td>water</td><td>It's full of water</td><td>-</td><td>-</td></tr> <tr><td><142.png></td><td>142</td><td>wine</td><td>It's full of wine</td><td>-</td><td>-</td></tr> <tr><td><143.png></td><td>143</td><td>grapes</td><td>Good grapes for wine making</td><td>-</td><td>-</td></tr> <tr><td><144.png></td><td>144</td><td>shears</td><td>For shearing sheep</td><td>-</td><td>-</td></tr> <tr><td><145.png></td><td>145</td><td>wool</td><td>I think this came from a sheep</td><td>-</td><td>-</td></tr> <tr><td><146.png></td><td>146</td><td>fur</td><td>This would make warm clothing</td><td>-</td><td>-</td></tr> <tr><td><147.png></td><td>147</td><td>cow hide</td><td>I should take this to the tannery</td><td>-</td><td>-</td></tr> <tr><td><148.png></td><td>148</td><td>leather</td><td>It's a piece of leather</td><td>-</td><td>-</td></tr> <tr><td><149.png></td><td>149</td><td>clay</td><td>Some hard dry clay</td><td>-</td><td>-</td></tr> <tr><td><150.png></td><td>150</td><td>copper ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><151.png></td><td>151</td><td>iron ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><152.png></td><td>152</td><td>gold</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><153.png></td><td>153</td><td>mithril ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><154.png></td><td>154</td><td>adamantite ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><155.png></td><td>155</td><td>coal</td><td>hmm a non-renewable energy source!</td><td>-</td><td>-</td></tr> <tr><td><156.png></td><td>156</td><td>Bronze Pickaxe</td><td>Used for mining</td><td>-</td><td>-</td></tr> <tr><td><157.png></td><td>157</td><td>uncut diamond</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><158.png></td><td>158</td><td>uncut ruby</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><159.png></td><td>159</td><td>uncut emerald</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><160.png></td><td>160</td><td>uncut sapphire</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><161.png></td><td>161</td><td>diamond</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><162.png></td><td>162</td><td>ruby</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><163.png></td><td>163</td><td>emerald</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><164.png></td><td>164</td><td>sapphire</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><165.png></td><td>165</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><166.png></td><td>166</td><td>tinderbox</td><td>useful for lighting a fire</td><td>-</td><td>-</td></tr> <tr><td><167.png></td><td>167</td><td>chisel</td><td>good for detailed crafting</td><td>-</td><td>-</td></tr> <tr><td><168.png></td><td>168</td><td>hammer</td><td>good for hitting things!</td><td>-</td><td>-</td></tr> <tr><td><169.png></td><td>169</td><td>bronze bar</td><td>it's a bar of bronze</td><td>-</td><td>-</td></tr> <tr><td><170.png></td><td>170</td><td>iron bar</td><td>it's a bar of iron</td><td>-</td><td>-</td></tr> <tr><td><171.png></td><td>171</td><td>steel bar</td><td>it's a bar of steel</td><td>-</td><td>-</td></tr> <tr><td><172.png></td><td>172</td><td>gold bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><173.png></td><td>173</td><td>mithril bar</td><td>it's a bar of mithril</td><td>-</td><td>-</td></tr> <tr><td><174.png></td><td>174</td><td>adamantite bar</td><td>it's a bar of adamantite</td><td>-</td><td>-</td></tr> <tr><td><175.png></td><td>175</td><td>Pressure gauge</td><td>It looks like part of a machine</td><td>-</td><td>-</td></tr> <tr><td><176.png></td><td>176</td><td>Fish Food</td><td>Keeps your pet fish strong and healthy</td><td>-</td><td>-</td></tr> <tr><td><177.png></td><td>177</td><td>Poison</td><td>This stuff looks nasty</td><td>-</td><td>-</td></tr> <tr><td><178.png></td><td>178</td><td>Poisoned fish food</td><td>Doesn't seem very nice to the poor fishes</td><td>-</td><td>-</td></tr> <tr><td><179.png></td><td>179</td><td>spinach roll</td><td>A home made spinach thing</td><td>-</td><td>-</td></tr> <tr><td><180.png></td><td>180</td><td>Bad wine</td><td>Oh dear</td><td>-</td><td>-</td></tr> <tr><td><181.png></td><td>181</td><td>Ashes</td><td>A heap of ashes</td><td>-</td><td>-</td></tr> <tr><td><182.png></td><td>182</td><td>Apron</td><td>A mostly clean apron</td><td>X</td><td>-</td></tr> <tr><td><183.png></td><td>183</td><td>Cape</td><td>A bright red cape</td><td>X</td><td>-</td></tr> <tr><td><184.png></td><td>184</td><td>Wizards robe</td><td>I can do magic better in this</td><td>X</td><td>-</td></tr> <tr><td><185.png></td><td>185</td><td>wizardshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><186.png></td><td>186</td><td>Brass necklace</td><td>I'd prefer a gold one</td><td>X</td><td>-</td></tr> <tr><td><187.png></td><td>187</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><188.png></td><td>188</td><td>Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><189.png></td><td>189</td><td>Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><190.png></td><td>190</td><td>Crossbow bolts</td><td>Good if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><191.png></td><td>191</td><td>Apron</td><td>this will help keep my clothes clean</td><td>X</td><td>-</td></tr> <tr><td><192.png></td><td>192</td><td>Chef's hat</td><td>What a silly hat</td><td>X</td><td>-</td></tr> <tr><td><193.png></td><td>193</td><td>Beer</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><194.png></td><td>194</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><195.png></td><td>195</td><td>skirt</td><td>A ladies skirt</td><td>X</td><td>-</td></tr> <tr><td><196.png></td><td>196</td><td>Black Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><197.png></td><td>197</td><td>Staff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><198.png></td><td>198</td><td>Magic Staff</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><199.png></td><td>199</td><td>wizardshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><200.png></td><td>200</td><td>silk</td><td>It's a sheet of silk</td><td>-</td><td>-</td></tr> <tr><td><201.png></td><td>201</td><td>flier</td><td>Get your axes from Bob's axes</td><td>-</td><td>-</td></tr> <tr><td><202.png></td><td>202</td><td>tin ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><203.png></td><td>203</td><td>Mithril Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><204.png></td><td>204</td><td>Adamantite Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><205.png></td><td>205</td><td>bronze battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><206.png></td><td>206</td><td>Bronze Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><207.png></td><td>207</td><td>Ball of wool</td><td>Spun from sheeps wool</td><td>-</td><td>-</td></tr> <tr><td><208.png></td><td>208</td><td>Oil can</td><td>Its pretty full</td><td>-</td><td>-</td></tr> <tr><td><209.png></td><td>209</td><td>Cape</td><td>A warm black cape</td><td>X</td><td>-</td></tr> <tr><td><210.png></td><td>210</td><td>Kebab</td><td>A meaty Kebab</td><td>-</td><td>-</td></tr> <tr><td><211.png></td><td>211</td><td>Spade</td><td>A fairly small spade</td><td>-</td><td>-</td></tr> <tr><td><212.png></td><td>212</td><td>Closet Key</td><td>A slightly smelly key</td><td>-</td><td>-</td></tr> <tr><td><213.png></td><td>213</td><td>rubber tube</td><td>Its slightly charred</td><td>-</td><td>-</td></tr> <tr><td><214.png></td><td>214</td><td>Bronze Plated Skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><215.png></td><td>215</td><td>Iron Plated Skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><216.png></td><td>216</td><td>Black robe</td><td>I can do magic better in this</td><td>X</td><td>-</td></tr> <tr><td><217.png></td><td>217</td><td>stake</td><td>A very pointy stick</td><td>X</td><td>-</td></tr> <tr><td><218.png></td><td>218</td><td>Garlic</td><td>A clove of garlic</td><td>-</td><td>-</td></tr> <tr><td><219.png></td><td>219</td><td>Red spiders eggs</td><td>eewww</td><td>-</td><td>-</td></tr> <tr><td><220.png></td><td>220</td><td>Limpwurt root</td><td>the root of a limpwurt plant</td><td>-</td><td>-</td></tr> <tr><td><221.png></td><td>221</td><td>Strength Potion</td><td>4 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><222.png></td><td>222</td><td>Strength Potion</td><td>3 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><223.png></td><td>223</td><td>Strength Potion</td><td>2 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><224.png></td><td>224</td><td>Strength Potion</td><td>1 dose of strength potion</td><td>-</td><td>-</td></tr> <tr><td><225.png></td><td>225</td><td>Steel Plated skirt</td><td>designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><226.png></td><td>226</td><td>Mithril Plated skirt</td><td>Designer Leg protection</td><td>X</td><td>-</td></tr> <tr><td><227.png></td><td>227</td><td>Adamantite Plated skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><228.png></td><td>228</td><td>Cabbage</td><td>Yuck I don't like cabbage</td><td>-</td><td>-</td></tr> <tr><td><229.png></td><td>229</td><td>Cape</td><td>A thick blue cape</td><td>X</td><td>-</td></tr> <tr><td><230.png></td><td>230</td><td>Large Black Helmet</td><td>A full face helmet</td><td>X</td><td>-</td></tr> <tr><td><231.png></td><td>231</td><td>Red Bead</td><td>A small round red bead</td><td>-</td><td>-</td></tr> <tr><td><232.png></td><td>232</td><td>Yellow Bead</td><td>A small round yellow bead</td><td>-</td><td>-</td></tr> <tr><td><233.png></td><td>233</td><td>Black Bead</td><td>A small round black bead</td><td>-</td><td>-</td></tr> <tr><td><234.png></td><td>234</td><td>White Bead</td><td>A small round white bead</td><td>-</td><td>-</td></tr> <tr><td><235.png></td><td>235</td><td>Amulet of accuracy</td><td>It increases my aim</td><td>X</td><td>-</td></tr> <tr><td><236.png></td><td>236</td><td>Redberries</td><td>Very bright red berries</td><td>-</td><td>-</td></tr> <tr><td><237.png></td><td>237</td><td>Rope</td><td>A Coil of rope</td><td>-</td><td>-</td></tr> <tr><td><238.png></td><td>238</td><td>Reddye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><239.png></td><td>239</td><td>Yellowdye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><240.png></td><td>240</td><td>Paste</td><td>A bottle off skin coloured paste</td><td>-</td><td>-</td></tr> <tr><td><241.png></td><td>241</td><td>Onion</td><td>A strong smelling onion</td><td>-</td><td>-</td></tr> <tr><td><242.png></td><td>242</td><td>Bronze key</td><td>A heavy key</td><td>-</td><td>-</td></tr> <tr><td><243.png></td><td>243</td><td>Soft Clay</td><td>Clay that's ready to be used</td><td>-</td><td>-</td></tr> <tr><td><244.png></td><td>244</td><td>wig</td><td>A blonde wig</td><td>-</td><td>-</td></tr> <tr><td><245.png></td><td>245</td><td>wig</td><td>A wig made from wool</td><td>-</td><td>-</td></tr> <tr><td><246.png></td><td>246</td><td>Half full wine jug</td><td>It's half full of wine</td><td>-</td><td>-</td></tr> <tr><td><247.png></td><td>247</td><td>Keyprint</td><td>An imprint of a key in a lump of clay</td><td>-</td><td>-</td></tr> <tr><td><248.png></td><td>248</td><td>Black Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><249.png></td><td>249</td><td>banana</td><td>Mmm this looks tasty</td><td>-</td><td>-</td></tr> <tr><td><250.png></td><td>250</td><td>pastry dough</td><td>Some uncooked dough</td><td>-</td><td>-</td></tr> <tr><td><251.png></td><td>251</td><td>Pie dish</td><td>For making pies in</td><td>-</td><td>-</td></tr> <tr><td><252.png></td><td>252</td><td>cooking apple</td><td>I wonder what i can make with this</td><td>-</td><td>-</td></tr> <tr><td><253.png></td><td>253</td><td>pie shell</td><td>I need to find a filling for this pie</td><td>-</td><td>-</td></tr> <tr><td><254.png></td><td>254</td><td>Uncooked apple pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><255.png></td><td>255</td><td>Uncooked meat pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><256.png></td><td>256</td><td>Uncooked redberry pie</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><257.png></td><td>257</td><td>apple pie</td><td>Mmm Apple pie</td><td>-</td><td>-</td></tr> <tr><td><258.png></td><td>258</td><td>Redberry pie</td><td>Looks tasty</td><td>-</td><td>-</td></tr> <tr><td><259.png></td><td>259</td><td>meat pie</td><td>Mighty and meaty</td><td>-</td><td>-</td></tr> <tr><td><260.png></td><td>260</td><td>burntpie</td><td>Oops</td><td>-</td><td>-</td></tr> <tr><td><261.png></td><td>261</td><td>Half a meat pie</td><td>Mighty and meaty</td><td>-</td><td>-</td></tr> <tr><td><262.png></td><td>262</td><td>Half a Redberry pie</td><td>Looks tasty</td><td>-</td><td>-</td></tr> <tr><td><263.png></td><td>263</td><td>Half an apple pie</td><td>Mmm Apple pie</td><td>-</td><td>-</td></tr> <tr><td><264.png></td><td>264</td><td>Portrait</td><td>It's a picture of a knight</td><td>-</td><td>-</td></tr> <tr><td><265.png></td><td>265</td><td>Faladian Knight's sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><266.png></td><td>266</td><td>blurite ore</td><td>What Strange stuff</td><td>-</td><td>-</td></tr> <tr><td><267.png></td><td>267</td><td>Asgarnian Ale</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><268.png></td><td>268</td><td>Wizard's Mind Bomb</td><td>It's got strange bubbles in it</td><td>-</td><td>-</td></tr> <tr><td><269.png></td><td>269</td><td>Dwarven Stout</td><td>A Pint of thick dark beer</td><td>-</td><td>-</td></tr> <tr><td><270.png></td><td>270</td><td>Eye of newt</td><td>It seems to be looking at me</td><td>-</td><td>-</td></tr> <tr><td><271.png></td><td>271</td><td>Rat's tail</td><td>A bit of rat</td><td>-</td><td>-</td></tr> <tr><td><272.png></td><td>272</td><td>Bluedye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><273.png></td><td>273</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><274.png></td><td>274</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><275.png></td><td>275</td><td>Goblin Armour</td><td>Armour Designed to fit Goblins</td><td>-</td><td>-</td></tr> <tr><td><276.png></td><td>276</td><td>unstrung Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><277.png></td><td>277</td><td>unstrung shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><278.png></td><td>278</td><td>Unfired Pie dish</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><279.png></td><td>279</td><td>unfired pot</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><280.png></td><td>280</td><td>arrow shafts</td><td>I need to attach feathers to these</td><td>-</td><td>X</td></tr> <tr><td><281.png></td><td>281</td><td>Woad Leaf</td><td>slightly bluish leaves</td><td>-</td><td>X</td></tr> <tr><td><282.png></td><td>282</td><td>Orangedye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><283.png></td><td>283</td><td>Gold ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><284.png></td><td>284</td><td>Sapphire ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><285.png></td><td>285</td><td>Emerald ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><286.png></td><td>286</td><td>Ruby ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><287.png></td><td>287</td><td>Diamond ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><288.png></td><td>288</td><td>Gold necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><289.png></td><td>289</td><td>Sapphire necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><290.png></td><td>290</td><td>Emerald necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><291.png></td><td>291</td><td>Ruby necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><292.png></td><td>292</td><td>Diamond necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><293.png></td><td>293</td><td>ring mould</td><td>Used to make gold rings</td><td>-</td><td>-</td></tr> <tr><td><294.png></td><td>294</td><td>Amulet mould</td><td>Used to make gold amulets</td><td>-</td><td>-</td></tr> <tr><td><295.png></td><td>295</td><td>Necklace mould</td><td>Used to make gold necklaces</td><td>-</td><td>-</td></tr> <tr><td><296.png></td><td>296</td><td>Gold Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><297.png></td><td>297</td><td>Sapphire Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><298.png></td><td>298</td><td>Emerald Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><299.png></td><td>299</td><td>Ruby Amulet</td><td>It needs a string so I can make wear it</td><td>-</td><td>-</td></tr> <tr><td><300.png></td><td>300</td><td>Diamond Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><301.png></td><td>301</td><td>Gold Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><302.png></td><td>302</td><td>Sapphire Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><303.png></td><td>303</td><td>Emerald Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><304.png></td><td>304</td><td>Ruby Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><305.png></td><td>305</td><td>Diamond Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><306.png></td><td>306</td><td>superchisel</td><td>I wonder if I can get this enchanted</td><td>-</td><td>-</td></tr> <tr><td><307.png></td><td>307</td><td>Mace of Zamorak</td><td>This mace gives me the creeps</td><td>X</td><td>-</td></tr> <tr><td><308.png></td><td>308</td><td>Bronze Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><309.png></td><td>309</td><td>Steel Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><310.png></td><td>310</td><td>Mithril Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><311.png></td><td>311</td><td>Adamantite Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><312.png></td><td>312</td><td>Iron Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><313.png></td><td>313</td><td>Black Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><314.png></td><td>314</td><td>Sapphire Amulet of magic</td><td>It improves my magic</td><td>X</td><td>-</td></tr> <tr><td><315.png></td><td>315</td><td>Emerald Amulet of protection</td><td>It improves my defense</td><td>X</td><td>-</td></tr> <tr><td><316.png></td><td>316</td><td>Ruby Amulet of strength</td><td>It improves my damage</td><td>X</td><td>-</td></tr> <tr><td><317.png></td><td>317</td><td>Diamond Amulet of power</td><td>A powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><318.png></td><td>318</td><td>Karamja Rum</td><td>A very strong spirit brewed in Karamja</td><td>-</td><td>-</td></tr> <tr><td><319.png></td><td>319</td><td>Cheese</td><td>It's got holes in it</td><td>-</td><td>-</td></tr> <tr><td><320.png></td><td>320</td><td>Tomato</td><td>This would make good ketchup</td><td>-</td><td>-</td></tr> <tr><td><321.png></td><td>321</td><td>Pizza Base</td><td>I need to add some tomato next</td><td>-</td><td>-</td></tr> <tr><td><322.png></td><td>322</td><td>Burnt Pizza</td><td>Oh dear!</td><td>-</td><td>-</td></tr> <tr><td><323.png></td><td>323</td><td>Incomplete Pizza</td><td>I need to add some cheese next</td><td>-</td><td>-</td></tr> <tr><td><324.png></td><td>324</td><td>Uncooked Pizza</td><td>This needs cooking</td><td>-</td><td>-</td></tr> <tr><td><325.png></td><td>325</td><td>Plain Pizza</td><td>A cheese and tomato pizza</td><td>-</td><td>-</td></tr> <tr><td><326.png></td><td>326</td><td>Meat Pizza</td><td>A pizza with bits of meat on it</td><td>-</td><td>-</td></tr> <tr><td><327.png></td><td>327</td><td>Anchovie Pizza</td><td>A Pizza with Anchovies</td><td>-</td><td>-</td></tr> <tr><td><328.png></td><td>328</td><td>Half Meat Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><329.png></td><td>329</td><td>Half Anchovie Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><330.png></td><td>330</td><td>Cake</td><td>A plain sponge cake</td><td>-</td><td>-</td></tr> <tr><td><331.png></td><td>331</td><td>Burnt Cake</td><td>Argh what a mess!</td><td>-</td><td>-</td></tr> <tr><td><332.png></td><td>332</td><td>Chocolate Cake</td><td>This looks very tasty!</td><td>-</td><td>-</td></tr> <tr><td><333.png></td><td>333</td><td>Partial Cake</td><td>Someone has eaten a big chunk of this cake</td><td>-</td><td>-</td></tr> <tr><td><334.png></td><td>334</td><td>Partial Chocolate Cake</td><td>Someone has eaten a big chunk of this cake</td><td>-</td><td>-</td></tr> <tr><td><335.png></td><td>335</td><td>Slice of Cake</td><td>I'd rather have a whole cake!</td><td>-</td><td>-</td></tr> <tr><td><336.png></td><td>336</td><td>Chocolate Slice</td><td>A slice of chocolate cake</td><td>-</td><td>-</td></tr> <tr><td><337.png></td><td>337</td><td>Chocolate Bar</td><td>It's a bar of chocolate</td><td>-</td><td>-</td></tr> <tr><td><338.png></td><td>338</td><td>Cake Tin</td><td>Useful for baking cakes</td><td>-</td><td>-</td></tr> <tr><td><339.png></td><td>339</td><td>Uncooked cake</td><td>Now all I need to do is cook it</td><td>-</td><td>-</td></tr> <tr><td><340.png></td><td>340</td><td>Unfired bowl</td><td>I need to put this in a pottery oven</td><td>-</td><td>-</td></tr> <tr><td><341.png></td><td>341</td><td>Bowl</td><td>Useful for mixing things</td><td>-</td><td>-</td></tr> <tr><td><342.png></td><td>342</td><td>Bowl of water</td><td>It's a bowl of water</td><td>-</td><td>-</td></tr> <tr><td><343.png></td><td>343</td><td>Incomplete stew</td><td>I need to add some meat too</td><td>-</td><td>-</td></tr> <tr><td><344.png></td><td>344</td><td>Incomplete stew</td><td>I need to add some potato too</td><td>-</td><td>-</td></tr> <tr><td><345.png></td><td>345</td><td>Uncooked stew</td><td>I need to cook this</td><td>-</td><td>-</td></tr> <tr><td><346.png></td><td>346</td><td>Stew</td><td>It's a meat and potato stew</td><td>-</td><td>-</td></tr> <tr><td><347.png></td><td>347</td><td>Burnt Stew</td><td>Eew it's horribly burnt</td><td>-</td><td>-</td></tr> <tr><td><348.png></td><td>348</td><td>Potato</td><td>Can be used to make stew</td><td>-</td><td>-</td></tr> <tr><td><349.png></td><td>349</td><td>Raw Shrimp</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><350.png></td><td>350</td><td>Shrimp</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><351.png></td><td>351</td><td>Raw Anchovies</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><352.png></td><td>352</td><td>Anchovies</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><353.png></td><td>353</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><354.png></td><td>354</td><td>Raw Sardine</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><355.png></td><td>355</td><td>Sardine</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><356.png></td><td>356</td><td>Raw Salmon</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><357.png></td><td>357</td><td>Salmon</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><358.png></td><td>358</td><td>Raw Trout</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><359.png></td><td>359</td><td>Trout</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><360.png></td><td>360</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><361.png></td><td>361</td><td>Raw Herring</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><362.png></td><td>362</td><td>Herring</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><363.png></td><td>363</td><td>Raw Pike</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><364.png></td><td>364</td><td>Pike</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><365.png></td><td>365</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><366.png></td><td>366</td><td>Raw Tuna</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><367.png></td><td>367</td><td>Tuna</td><td>Wow this is a big fish</td><td>-</td><td>-</td></tr> <tr><td><368.png></td><td>368</td><td>Burnt fish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><369.png></td><td>369</td><td>Raw Swordfish</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><370.png></td><td>370</td><td>Swordfish</td><td>I'd better be careful eating this!</td><td>-</td><td>-</td></tr> <tr><td><371.png></td><td>371</td><td>Burnt Swordfish</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><372.png></td><td>372</td><td>Raw Lobster</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><373.png></td><td>373</td><td>Lobster</td><td>This looks tricky to eat</td><td>-</td><td>-</td></tr> <tr><td><374.png></td><td>374</td><td>Burnt Lobster</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><375.png></td><td>375</td><td>Lobster Pot</td><td>Useful for catching lobsters</td><td>-</td><td>-</td></tr> <tr><td><376.png></td><td>376</td><td>Net</td><td>Useful for catching small fish</td><td>-</td><td>-</td></tr> <tr><td><377.png></td><td>377</td><td>Fishing Rod</td><td>Useful for catching sardine or herring</td><td>-</td><td>-</td></tr> <tr><td><378.png></td><td>378</td><td>Fly Fishing Rod</td><td>Useful for catching salmon or trout</td><td>-</td><td>-</td></tr> <tr><td><379.png></td><td>379</td><td>Harpoon</td><td>Useful for catching really big fish</td><td>-</td><td>-</td></tr> <tr><td><380.png></td><td>380</td><td>Fishing Bait</td><td>For use with a fishing rod</td><td>-</td><td>X</td></tr> <tr><td><381.png></td><td>381</td><td>Feather</td><td>Used for fly-fishing</td><td>-</td><td>X</td></tr> <tr><td><382.png></td><td>382</td><td>Chest key</td><td>A key to One eyed Hector's chest</td><td>-</td><td>-</td></tr> <tr><td><383.png></td><td>383</td><td>Silver</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><384.png></td><td>384</td><td>silver bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><385.png></td><td>385</td><td>Holy Symbol of saradomin</td><td>This improves my prayer</td><td>X</td><td>-</td></tr> <tr><td><386.png></td><td>386</td><td>Holy symbol mould</td><td>Used to make Holy Symbols</td><td>-</td><td>-</td></tr> <tr><td><387.png></td><td>387</td><td>Disk of Returning</td><td>Used to get out of Thordur's blackhole</td><td>-</td><td>-</td></tr> <tr><td><388.png></td><td>388</td><td>Monks robe</td><td>I feel closer to the God's when I am wearing this</td><td>X</td><td>-</td></tr> <tr><td><389.png></td><td>389</td><td>Monks robe</td><td>Keeps a monk's legs nice and warm</td><td>X</td><td>-</td></tr> <tr><td><390.png></td><td>390</td><td>Red key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><391.png></td><td>391</td><td>Orange Key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><392.png></td><td>392</td><td>yellow key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><393.png></td><td>393</td><td>Blue key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><394.png></td><td>394</td><td>Magenta key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><395.png></td><td>395</td><td>black key</td><td>A painted key</td><td>-</td><td>-</td></tr> <tr><td><396.png></td><td>396</td><td>rune dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><397.png></td><td>397</td><td>Rune short sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><398.png></td><td>398</td><td>rune Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><399.png></td><td>399</td><td>Medium Rune Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><400.png></td><td>400</td><td>Rune Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><401.png></td><td>401</td><td>Rune Plate Mail Body</td><td>Provides excellent protection</td><td>X</td><td>-</td></tr> <tr><td><402.png></td><td>402</td><td>Rune Plate Mail Legs</td><td>These look pretty heavy</td><td>X</td><td>-</td></tr> <tr><td><403.png></td><td>403</td><td>Rune Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><404.png></td><td>404</td><td>Rune Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><405.png></td><td>405</td><td>rune Axe</td><td>A powerful axe</td><td>X</td><td>-</td></tr> <tr><td><406.png></td><td>406</td><td>Rune skirt</td><td>Designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><407.png></td><td>407</td><td>Rune Plate Mail top</td><td>Armour designed for females</td><td>X</td><td>-</td></tr> <tr><td><408.png></td><td>408</td><td>Runite bar</td><td>it's a bar of runite</td><td>-</td><td>-</td></tr> <tr><td><409.png></td><td>409</td><td>runite ore</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><410.png></td><td>410</td><td>Plank</td><td>This doesn't look very useful</td><td>-</td><td>-</td></tr> <tr><td><411.png></td><td>411</td><td>Tile</td><td>This doesn't look very useful</td><td>-</td><td>-</td></tr> <tr><td><412.png></td><td>412</td><td>skull</td><td>A spooky looking skull</td><td>-</td><td>-</td></tr> <tr><td><413.png></td><td>413</td><td>Big Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><414.png></td><td>414</td><td>Muddy key</td><td>It looks like a key to a chest</td><td>-</td><td>-</td></tr> <tr><td><415.png></td><td>415</td><td>Map</td><td>A map showing the way to the Isle of Crandor</td><td>-</td><td>-</td></tr> <tr><td><416.png></td><td>416</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><417.png></td><td>417</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><418.png></td><td>418</td><td>Map Piece</td><td>I need some more of the map for this to be useful</td><td>-</td><td>-</td></tr> <tr><td><419.png></td><td>419</td><td>Nails</td><td>Nails made from steel</td><td>-</td><td>X</td></tr> <tr><td><420.png></td><td>420</td><td>Anti dragon breath Shield</td><td>Helps prevent damage from dragons</td><td>X</td><td>-</td></tr> <tr><td><421.png></td><td>421</td><td>Maze key</td><td>The key to the entrance of Melzar's maze</td><td>-</td><td>-</td></tr> <tr><td><422.png></td><td>422</td><td>Pumpkin</td><td>Happy halloween</td><td>-</td><td>-</td></tr> <tr><td><423.png></td><td>423</td><td>Black dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><424.png></td><td>424</td><td>Black Short Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><425.png></td><td>425</td><td>Black Long Sword</td><td>A razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><426.png></td><td>426</td><td>Black 2-handed Sword</td><td>A very large sword</td><td>X</td><td>-</td></tr> <tr><td><427.png></td><td>427</td><td>Black Scimitar</td><td>A vicious curved sword</td><td>X</td><td>-</td></tr> <tr><td><428.png></td><td>428</td><td>Black Axe</td><td>A sinister looking axe</td><td>X</td><td>-</td></tr> <tr><td><429.png></td><td>429</td><td>Black battle Axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><430.png></td><td>430</td><td>Black Mace</td><td>A spikey mace</td><td>X</td><td>-</td></tr> <tr><td><431.png></td><td>431</td><td>Black Chain Mail Body</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><432.png></td><td>432</td><td>Black Square Shield</td><td>A medium metal shield</td><td>X</td><td>-</td></tr> <tr><td><433.png></td><td>433</td><td>Black Kite Shield</td><td>A large metal shield</td><td>X</td><td>-</td></tr> <tr><td><434.png></td><td>434</td><td>Black Plated skirt</td><td>designer leg protection</td><td>X</td><td>-</td></tr> <tr><td><435.png></td><td>435</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><436.png></td><td>436</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><437.png></td><td>437</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><438.png></td><td>438</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><439.png></td><td>439</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><440.png></td><td>440</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><441.png></td><td>441</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><442.png></td><td>442</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><443.png></td><td>443</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><444.png></td><td>444</td><td>Guam leaf</td><td>A herb used in attack potion making</td><td>-</td><td>-</td></tr> <tr><td><445.png></td><td>445</td><td>Marrentill</td><td>A herb used in poison cures</td><td>-</td><td>-</td></tr> <tr><td><446.png></td><td>446</td><td>Tarromin</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><447.png></td><td>447</td><td>Harralander</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><448.png></td><td>448</td><td>Ranarr Weed</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><449.png></td><td>449</td><td>Irit Leaf</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><450.png></td><td>450</td><td>Avantoe</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><451.png></td><td>451</td><td>Kwuarm</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><452.png></td><td>452</td><td>Cadantine</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><453.png></td><td>453</td><td>Dwarf Weed</td><td>A powerful herb</td><td>-</td><td>-</td></tr> <tr><td><454.png></td><td>454</td><td>Unfinished potion</td><td>I need another ingredient to finish this Guam potion</td><td>-</td><td>-</td></tr> <tr><td><455.png></td><td>455</td><td>Unfinished potion</td><td>I need another ingredient to finish this Marrentill potion</td><td>-</td><td>-</td></tr> <tr><td><456.png></td><td>456</td><td>Unfinished potion</td><td>I need another ingredient to finish this Tarromin potion</td><td>-</td><td>-</td></tr> <tr><td><457.png></td><td>457</td><td>Unfinished potion</td><td>I need another ingredient to finish this Harralander potion</td><td>-</td><td>-</td></tr> <tr><td><458.png></td><td>458</td><td>Unfinished potion</td><td>I need another ingredient to finish this Ranarr potion</td><td>-</td><td>-</td></tr> <tr><td><459.png></td><td>459</td><td>Unfinished potion</td><td>I need another ingredient to finish this Irit potion</td><td>-</td><td>-</td></tr> <tr><td><460.png></td><td>460</td><td>Unfinished potion</td><td>I need another ingredient to finish this Avantoe potion</td><td>-</td><td>-</td></tr> <tr><td><461.png></td><td>461</td><td>Unfinished potion</td><td>I need another ingredient to finish this Kwuarm potion</td><td>-</td><td>-</td></tr> <tr><td><462.png></td><td>462</td><td>Unfinished potion</td><td>I need another ingredient to finish this Cadantine potion</td><td>-</td><td>-</td></tr> <tr><td><463.png></td><td>463</td><td>Unfinished potion</td><td>I need another ingredient to finish this Dwarfweed potion</td><td>-</td><td>-</td></tr> <tr><td><464.png></td><td>464</td><td>Vial</td><td>It's full of water</td><td>-</td><td>-</td></tr> <tr><td><465.png></td><td>465</td><td>Vial</td><td>This vial is empty</td><td>-</td><td>-</td></tr> <tr><td><466.png></td><td>466</td><td>Unicorn horn</td><td>Poor unicorn</td><td>-</td><td>-</td></tr> <tr><td><467.png></td><td>467</td><td>Blue dragon scale</td><td>A large shiny scale</td><td>-</td><td>-</td></tr> <tr><td><468.png></td><td>468</td><td>Pestle and mortar</td><td>I can grind things for potions in this</td><td>-</td><td>-</td></tr> <tr><td><469.png></td><td>469</td><td>Snape grass</td><td>Strange spikey grass</td><td>-</td><td>-</td></tr> <tr><td><470.png></td><td>470</td><td>Medium black Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><471.png></td><td>471</td><td>White berries</td><td>Poisonous berries</td><td>-</td><td>-</td></tr> <tr><td><472.png></td><td>472</td><td>Ground blue dragon scale</td><td>This stuff isn't good for you</td><td>-</td><td>-</td></tr> <tr><td><473.png></td><td>473</td><td>Ground unicorn horn</td><td>A useful potion ingredient</td><td>-</td><td>-</td></tr> <tr><td><474.png></td><td>474</td><td>attack Potion</td><td>3 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><475.png></td><td>475</td><td>attack Potion</td><td>2 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><476.png></td><td>476</td><td>attack Potion</td><td>1 dose of attack potion</td><td>-</td><td>-</td></tr> <tr><td><477.png></td><td>477</td><td>stat restoration Potion</td><td>3 doses of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><478.png></td><td>478</td><td>stat restoration Potion</td><td>2 doses of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><479.png></td><td>479</td><td>stat restoration Potion</td><td>1 dose of stat restoration potion</td><td>-</td><td>-</td></tr> <tr><td><480.png></td><td>480</td><td>defense Potion</td><td>3 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><481.png></td><td>481</td><td>defense Potion</td><td>2 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><482.png></td><td>482</td><td>defense Potion</td><td>1 dose of defense potion</td><td>-</td><td>-</td></tr> <tr><td><483.png></td><td>483</td><td>restore prayer Potion</td><td>3 doses of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><484.png></td><td>484</td><td>restore prayer Potion</td><td>2 doses of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><485.png></td><td>485</td><td>restore prayer Potion</td><td>1 dose of restore prayer potion</td><td>-</td><td>-</td></tr> <tr><td><486.png></td><td>486</td><td>Super attack Potion</td><td>3 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><487.png></td><td>487</td><td>Super attack Potion</td><td>2 doses of attack potion</td><td>-</td><td>-</td></tr> <tr><td><488.png></td><td>488</td><td>Super attack Potion</td><td>1 dose of attack potion</td><td>-</td><td>-</td></tr> <tr><td><489.png></td><td>489</td><td>fishing Potion</td><td>3 doses of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><490.png></td><td>490</td><td>fishing Potion</td><td>2 doses of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><491.png></td><td>491</td><td>fishing Potion</td><td>1 dose of fishing potion</td><td>-</td><td>-</td></tr> <tr><td><492.png></td><td>492</td><td>Super strength Potion</td><td>3 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><493.png></td><td>493</td><td>Super strength Potion</td><td>2 doses of strength potion</td><td>-</td><td>-</td></tr> <tr><td><494.png></td><td>494</td><td>Super strength Potion</td><td>1 dose of strength potion</td><td>-</td><td>-</td></tr> <tr><td><495.png></td><td>495</td><td>Super defense Potion</td><td>3 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><496.png></td><td>496</td><td>Super defense Potion</td><td>2 doses of defense potion</td><td>-</td><td>-</td></tr> <tr><td><497.png></td><td>497</td><td>Super defense Potion</td><td>1 dose of defense potion</td><td>-</td><td>-</td></tr> <tr><td><498.png></td><td>498</td><td>ranging Potion</td><td>3 doses of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><499.png></td><td>499</td><td>ranging Potion</td><td>2 doses of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><500.png></td><td>500</td><td>ranging Potion</td><td>1 dose of ranging potion</td><td>-</td><td>-</td></tr> <tr><td><501.png></td><td>501</td><td>wine of Zamorak</td><td>It's full of wine</td><td>-</td><td>-</td></tr> <tr><td><502.png></td><td>502</td><td>raw bear meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><503.png></td><td>503</td><td>raw rat meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><504.png></td><td>504</td><td>raw beef</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><505.png></td><td>505</td><td>enchanted bear meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><506.png></td><td>506</td><td>enchanted rat meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><507.png></td><td>507</td><td>enchanted beef</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><508.png></td><td>508</td><td>enchanted chicken meat</td><td>I don't fancy eating this now</td><td>-</td><td>-</td></tr> <tr><td><509.png></td><td>509</td><td>Dramen Staff</td><td>A magical staff cut from the dramen tree</td><td>X</td><td>-</td></tr> <tr><td><510.png></td><td>510</td><td>Dramen Branch</td><td>I need to make this into a staff</td><td>-</td><td>-</td></tr> <tr><td><511.png></td><td>511</td><td>Cape</td><td>A thick Green cape</td><td>X</td><td>-</td></tr> <tr><td><512.png></td><td>512</td><td>Cape</td><td>A thick yellow cape</td><td>X</td><td>-</td></tr> <tr><td><513.png></td><td>513</td><td>Cape</td><td>A thick Orange cape</td><td>X</td><td>-</td></tr> <tr><td><514.png></td><td>514</td><td>Cape</td><td>A thick purple cape</td><td>X</td><td>-</td></tr> <tr><td><515.png></td><td>515</td><td>Greendye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><516.png></td><td>516</td><td>Purpledye</td><td>A little bottle of dye</td><td>-</td><td>-</td></tr> <tr><td><517.png></td><td>517</td><td>Iron ore certificate</td><td>Each certificate exchangable at draynor market for 5 iron ore</td><td>-</td><td>X</td></tr> <tr><td><518.png></td><td>518</td><td>Coal certificate</td><td>Each certificate exchangable at draynor market for 5 coal</td><td>-</td><td>X</td></tr> <tr><td><519.png></td><td>519</td><td>Mithril ore certificate</td><td>Each certificate exchangable at draynor market for 5 mithril ore</td><td>-</td><td>X</td></tr> <tr><td><520.png></td><td>520</td><td>silver certificate</td><td>Each certificate exchangable at draynor market for 5 silver nuggets</td><td>-</td><td>X</td></tr> <tr><td><521.png></td><td>521</td><td>Gold certificate</td><td>Each certificate exchangable at draynor market for 5 gold nuggets</td><td>-</td><td>X</td></tr> <tr><td><522.png></td><td>522</td><td>Dragonstone Amulet</td><td>A very powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><523.png></td><td>523</td><td>Dragonstone</td><td>This looks very valuable</td><td>-</td><td>-</td></tr> <tr><td><524.png></td><td>524</td><td>Dragonstone Amulet</td><td>It needs a string so I can wear it</td><td>-</td><td>-</td></tr> <tr><td><525.png></td><td>525</td><td>Crystal key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><526.png></td><td>526</td><td>Half of a key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><527.png></td><td>527</td><td>Half of a key</td><td>A very shiny key</td><td>-</td><td>-</td></tr> <tr><td><528.png></td><td>528</td><td>Iron bar certificate</td><td>Each certificate exchangable at draynor market for 5 iron bars</td><td>-</td><td>X</td></tr> <tr><td><529.png></td><td>529</td><td>steel bar certificate</td><td>Each certificate exchangable at draynor market for 5 steel bars</td><td>-</td><td>X</td></tr> <tr><td><530.png></td><td>530</td><td>Mithril bar certificate</td><td>Each certificate exchangable at draynor market for 5 mithril bars</td><td>-</td><td>X</td></tr> <tr><td><531.png></td><td>531</td><td>silver bar certificate</td><td>Each certificate exchangable at draynor market for 5 silver bars</td><td>-</td><td>X</td></tr> <tr><td><532.png></td><td>532</td><td>Gold bar certificate</td><td>Each certificate exchangable at draynor market for 5 gold bars</td><td>-</td><td>X</td></tr> <tr><td><533.png></td><td>533</td><td>Lobster certificate</td><td>Each certificate exchangable at draynor market for 5 lobsters</td><td>-</td><td>X</td></tr> <tr><td><534.png></td><td>534</td><td>Raw lobster certificate</td><td>Each certificate exchangable at draynor market for 5 raw lobsters</td><td>-</td><td>X</td></tr> <tr><td><535.png></td><td>535</td><td>Swordfish certificate</td><td>Each certificate exchangable at draynor market for 5 swordfish</td><td>-</td><td>X</td></tr> <tr><td><536.png></td><td>536</td><td>Raw swordfish certificate</td><td>Each certificate exchangable at draynor market for 5 raw swordfish</td><td>-</td><td>X</td></tr> <tr><td><537.png></td><td>537</td><td>Diary</td><td>Property of Nora.T.Hag</td><td>-</td><td>-</td></tr> <tr><td><538.png></td><td>538</td><td>Front door key</td><td>A house key</td><td>-</td><td>-</td></tr> <tr><td><539.png></td><td>539</td><td>Ball</td><td>A child's ball</td><td>-</td><td>-</td></tr> <tr><td><540.png></td><td>540</td><td>magnet</td><td>A very attractive magnet</td><td>-</td><td>-</td></tr> <tr><td><541.png></td><td>541</td><td>Grey wolf fur</td><td>This would make warm clothing</td><td>-</td><td>-</td></tr> <tr><td><542.png></td><td>542</td><td>uncut dragonstone</td><td>this would be worth more cut</td><td>-</td><td>-</td></tr> <tr><td><543.png></td><td>543</td><td>Dragonstone ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><544.png></td><td>544</td><td>Dragonstone necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><545.png></td><td>545</td><td>Raw Shark</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><546.png></td><td>546</td><td>Shark</td><td>I'd better be careful eating this!</td><td>-</td><td>-</td></tr> <tr><td><547.png></td><td>547</td><td>Burnt Shark</td><td>Oops!</td><td>-</td><td>-</td></tr> <tr><td><548.png></td><td>548</td><td>Big Net</td><td>Useful for catching lots of fish</td><td>-</td><td>-</td></tr> <tr><td><549.png></td><td>549</td><td>Casket</td><td>I hope there is treasure in it</td><td>-</td><td>-</td></tr> <tr><td><550.png></td><td>550</td><td>Raw cod</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><551.png></td><td>551</td><td>Cod</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><552.png></td><td>552</td><td>Raw Mackerel</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><553.png></td><td>553</td><td>Mackerel</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><554.png></td><td>554</td><td>Raw Bass</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><555.png></td><td>555</td><td>Bass</td><td>Wow this is a big fish</td><td>-</td><td>-</td></tr> <tr><td><556.png></td><td>556</td><td>Ice Gloves</td><td>These will keep my hands cold!</td><td>X</td><td>-</td></tr> <tr><td><557.png></td><td>557</td><td>Firebird Feather</td><td>A red hot feather</td><td>-</td><td>-</td></tr> <tr><td><558.png></td><td>558</td><td>Firebird Feather</td><td>This is cool enough to hold now</td><td>-</td><td>-</td></tr> <tr><td><559.png></td><td>559</td><td>Poisoned Iron dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><560.png></td><td>560</td><td>Poisoned bronze dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><561.png></td><td>561</td><td>Poisoned Steel dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><562.png></td><td>562</td><td>Poisoned Mithril dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><563.png></td><td>563</td><td>Poisoned Rune dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><564.png></td><td>564</td><td>Poisoned Adamantite dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><565.png></td><td>565</td><td>Poisoned Black dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><566.png></td><td>566</td><td>Cure poison Potion</td><td>3 doses of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><567.png></td><td>567</td><td>Cure poison Potion</td><td>2 doses of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><568.png></td><td>568</td><td>Cure poison Potion</td><td>1 dose of cure poison potion</td><td>-</td><td>-</td></tr> <tr><td><569.png></td><td>569</td><td>Poison antidote</td><td>3 doses of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><570.png></td><td>570</td><td>Poison antidote</td><td>2 doses of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><571.png></td><td>571</td><td>Poison antidote</td><td>1 dose of anti poison potion</td><td>-</td><td>-</td></tr> <tr><td><572.png></td><td>572</td><td>weapon poison</td><td>For use on daggers and arrows</td><td>-</td><td>-</td></tr> <tr><td><573.png></td><td>573</td><td>ID Paper</td><td>ID of Hartigen the black knight</td><td>-</td><td>-</td></tr> <tr><td><574.png></td><td>574</td><td>Poison Bronze Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><575.png></td><td>575</td><td>Christmas cracker</td><td>Use on another player to pull it</td><td>-</td><td>-</td></tr> <tr><td><576.png></td><td>576</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><577.png></td><td>577</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><578.png></td><td>578</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><579.png></td><td>579</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><580.png></td><td>580</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><581.png></td><td>581</td><td>Party Hat</td><td>Party!!!</td><td>X</td><td>-</td></tr> <tr><td><582.png></td><td>582</td><td>Miscellaneous key</td><td>I wonder what this unlocks</td><td>-</td><td>-</td></tr> <tr><td><583.png></td><td>583</td><td>Bunch of keys</td><td>Some keys on a keyring</td><td>-</td><td>-</td></tr> <tr><td><584.png></td><td>584</td><td>Whisky</td><td>A bottle of Draynor Malt</td><td>-</td><td>-</td></tr> <tr><td><585.png></td><td>585</td><td>Candlestick</td><td>A valuable candlestick</td><td>-</td><td>-</td></tr> <tr><td><586.png></td><td>586</td><td>Master thief armband</td><td>This denotes a great act of thievery</td><td>-</td><td>-</td></tr> <tr><td><587.png></td><td>587</td><td>Blamish snail slime</td><td>Yuck</td><td>-</td><td>-</td></tr> <tr><td><588.png></td><td>588</td><td>Blamish oil</td><td>made from the finest snail slime</td><td>-</td><td>-</td></tr> <tr><td><589.png></td><td>589</td><td>Oily Fishing Rod</td><td>A rod covered in Blamish oil</td><td>-</td><td>-</td></tr> <tr><td><590.png></td><td>590</td><td>lava eel</td><td>Strange it looks cooler now it's been cooked</td><td>-</td><td>-</td></tr> <tr><td><591.png></td><td>591</td><td>Raw lava eel</td><td>A very strange eel</td><td>-</td><td>-</td></tr> <tr><td><592.png></td><td>592</td><td>Poison Crossbow bolts</td><td>Good if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><593.png></td><td>593</td><td>Dragon sword</td><td>A Razor sharp sword</td><td>X</td><td>-</td></tr> <tr><td><594.png></td><td>594</td><td>Dragon axe</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><595.png></td><td>595</td><td>Jail keys</td><td>Keys to the black knight jail</td><td>-</td><td>-</td></tr> <tr><td><596.png></td><td>596</td><td>Dusty Key</td><td>A key given to me by Velrak</td><td>-</td><td>-</td></tr> <tr><td><597.png></td><td>597</td><td>Charged Dragonstone Amulet</td><td>A very powerful amulet</td><td>X</td><td>-</td></tr> <tr><td><598.png></td><td>598</td><td>Grog</td><td>A murky glass of some sort of drink</td><td>-</td><td>-</td></tr> <tr><td><599.png></td><td>599</td><td>Candle</td><td>An unlit candle</td><td>-</td><td>-</td></tr> <tr><td><600.png></td><td>600</td><td>black Candle</td><td>A spooky but unlit candle</td><td>-</td><td>-</td></tr> <tr><td><601.png></td><td>601</td><td>Candle</td><td>A small slowly burning candle</td><td>-</td><td>-</td></tr> <tr><td><602.png></td><td>602</td><td>black Candle</td><td>A spooky candle</td><td>-</td><td>-</td></tr> <tr><td><603.png></td><td>603</td><td>insect repellant</td><td>Drives away all known 6 legged creatures</td><td>-</td><td>-</td></tr> <tr><td><604.png></td><td>604</td><td>Bat bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><605.png></td><td>605</td><td>wax Bucket</td><td>It's a wooden bucket</td><td>-</td><td>-</td></tr> <tr><td><606.png></td><td>606</td><td>Excalibur</td><td>This used to belong to king Arthur</td><td>X</td><td>-</td></tr> <tr><td><607.png></td><td>607</td><td>Druids robe</td><td>I feel closer to the Gods when I am wearing this</td><td>X</td><td>-</td></tr> <tr><td><608.png></td><td>608</td><td>Druids robe</td><td>Keeps a druids's knees nice and warm</td><td>X</td><td>-</td></tr> <tr><td><609.png></td><td>609</td><td>Eye patch</td><td>It makes me look very piratical</td><td>X</td><td>-</td></tr> <tr><td><610.png></td><td>610</td><td>Unenchanted Dragonstone Amulet</td><td>I wonder if I can get this enchanted</td><td>X</td><td>-</td></tr> <tr><td><611.png></td><td>611</td><td>Unpowered orb</td><td>I'd prefer it if it was powered</td><td>-</td><td>-</td></tr> <tr><td><612.png></td><td>612</td><td>Fire orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><613.png></td><td>613</td><td>Water orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><614.png></td><td>614</td><td>Battlestaff</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><615.png></td><td>615</td><td>Battlestaff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><616.png></td><td>616</td><td>Battlestaff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><617.png></td><td>617</td><td>Battlestaff of air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><618.png></td><td>618</td><td>Battlestaff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><619.png></td><td>619</td><td>Blood-Rune</td><td>Used for high level missile spells</td><td>-</td><td>X</td></tr> <tr><td><620.png></td><td>620</td><td>Beer glass</td><td>I need to fill this with beer</td><td>-</td><td>-</td></tr> <tr><td><621.png></td><td>621</td><td>glassblowing pipe</td><td>Use on molten glass to make things</td><td>-</td><td>-</td></tr> <tr><td><622.png></td><td>622</td><td>seaweed</td><td>slightly damp seaweed</td><td>-</td><td>-</td></tr> <tr><td><623.png></td><td>623</td><td>molten glass</td><td>hot glass ready to be blown</td><td>-</td><td>-</td></tr> <tr><td><624.png></td><td>624</td><td>soda ash</td><td>one of the ingredients for making glass</td><td>-</td><td>-</td></tr> <tr><td><625.png></td><td>625</td><td>sand</td><td>one of the ingredients for making glass</td><td>-</td><td>-</td></tr> <tr><td><626.png></td><td>626</td><td>air orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><627.png></td><td>627</td><td>earth orb</td><td>A magic glowing orb</td><td>-</td><td>-</td></tr> <tr><td><628.png></td><td>628</td><td>bass certificate</td><td>Each certificate exchangable at Catherby for 5 bass</td><td>-</td><td>X</td></tr> <tr><td><629.png></td><td>629</td><td>Raw bass certificate</td><td>Each certificate exchangable at Catherby for 5 raw bass</td><td>-</td><td>X</td></tr> <tr><td><630.png></td><td>630</td><td>shark certificate</td><td>Each certificate exchangable at Catherby for 5 shark</td><td>-</td><td>X</td></tr> <tr><td><631.png></td><td>631</td><td>Raw shark certificate</td><td>Each certificate exchangable at Catherby for 5 raw shark</td><td>-</td><td>X</td></tr> <tr><td><632.png></td><td>632</td><td>Oak Logs</td><td>Logs cut from an oak tree</td><td>-</td><td>-</td></tr> <tr><td><633.png></td><td>633</td><td>Willow Logs</td><td>Logs cut from a willow tree</td><td>-</td><td>-</td></tr> <tr><td><634.png></td><td>634</td><td>Maple Logs</td><td>Logs cut from a maple tree</td><td>-</td><td>-</td></tr> <tr><td><635.png></td><td>635</td><td>Yew Logs</td><td>Logs cut from a yew tree</td><td>-</td><td>-</td></tr> <tr><td><636.png></td><td>636</td><td>Magic Logs</td><td>Logs made from magical wood</td><td>-</td><td>-</td></tr> <tr><td><637.png></td><td>637</td><td>Headless Arrows</td><td>I need to attach arrow heads to these</td><td>-</td><td>X</td></tr> <tr><td><638.png></td><td>638</td><td>Iron Arrows</td><td>Arrows with iron heads</td><td>-</td><td>X</td></tr> <tr><td><639.png></td><td>639</td><td>Poison Iron Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><640.png></td><td>640</td><td>Steel Arrows</td><td>Arrows with steel heads</td><td>-</td><td>X</td></tr> <tr><td><641.png></td><td>641</td><td>Poison Steel Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><642.png></td><td>642</td><td>Mithril Arrows</td><td>Arrows with mithril heads</td><td>-</td><td>X</td></tr> <tr><td><643.png></td><td>643</td><td>Poison Mithril Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><644.png></td><td>644</td><td>Adamantite Arrows</td><td>Arrows with adamantite heads</td><td>-</td><td>X</td></tr> <tr><td><645.png></td><td>645</td><td>Poison Adamantite Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><646.png></td><td>646</td><td>Rune Arrows</td><td>Arrows with rune heads</td><td>-</td><td>X</td></tr> <tr><td><647.png></td><td>647</td><td>Poison Rune Arrows</td><td>Venomous looking arrows</td><td>-</td><td>X</td></tr> <tr><td><648.png></td><td>648</td><td>Oak Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><649.png></td><td>649</td><td>Oak Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><650.png></td><td>650</td><td>Willow Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><651.png></td><td>651</td><td>Willow Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><652.png></td><td>652</td><td>Maple Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><653.png></td><td>653</td><td>Maple Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><654.png></td><td>654</td><td>Yew Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><655.png></td><td>655</td><td>Yew Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><656.png></td><td>656</td><td>Magic Longbow</td><td>A Nice sturdy bow</td><td>X</td><td>-</td></tr> <tr><td><657.png></td><td>657</td><td>Magic Shortbow</td><td>Short but effective</td><td>X</td><td>-</td></tr> <tr><td><658.png></td><td>658</td><td>unstrung Oak Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><659.png></td><td>659</td><td>unstrung Oak Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><660.png></td><td>660</td><td>unstrung Willow Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><661.png></td><td>661</td><td>unstrung Willow Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><662.png></td><td>662</td><td>unstrung Maple Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><663.png></td><td>663</td><td>unstrung Maple Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><664.png></td><td>664</td><td>unstrung Yew Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><665.png></td><td>665</td><td>unstrung Yew Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><666.png></td><td>666</td><td>unstrung Magic Longbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><667.png></td><td>667</td><td>unstrung Magic Shortbow</td><td>I need to find a string for this</td><td>-</td><td>-</td></tr> <tr><td><668.png></td><td>668</td><td>barcrawl card</td><td>The official Alfred Grimhand barcrawl</td><td>-</td><td>-</td></tr> <tr><td><669.png></td><td>669</td><td>bronze arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><670.png></td><td>670</td><td>iron arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><671.png></td><td>671</td><td>steel arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><672.png></td><td>672</td><td>mithril arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><673.png></td><td>673</td><td>adamantite arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><674.png></td><td>674</td><td>rune arrow heads</td><td>Not much use without the rest of the arrow!</td><td>-</td><td>X</td></tr> <tr><td><675.png></td><td>675</td><td>flax</td><td>I should use this with a spinning wheel</td><td>-</td><td>-</td></tr> <tr><td><676.png></td><td>676</td><td>bow string</td><td>I need a bow handle to attach this too</td><td>-</td><td>-</td></tr> <tr><td><677.png></td><td>677</td><td>Easter egg</td><td>Happy Easter</td><td>-</td><td>-</td></tr> <tr><td><678.png></td><td>678</td><td>scorpion cage</td><td>I need to catch some scorpions in this</td><td>-</td><td>-</td></tr> <tr><td><679.png></td><td>679</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><680.png></td><td>680</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><681.png></td><td>681</td><td>scorpion cage</td><td>It has 3 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><682.png></td><td>682</td><td>Enchanted Battlestaff of fire</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><683.png></td><td>683</td><td>Enchanted Battlestaff of water</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><684.png></td><td>684</td><td>Enchanted Battlestaff of air</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><685.png></td><td>685</td><td>Enchanted Battlestaff of earth</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><686.png></td><td>686</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><687.png></td><td>687</td><td>scorpion cage</td><td>It has 1 scorpion in it</td><td>-</td><td>-</td></tr> <tr><td><688.png></td><td>688</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><689.png></td><td>689</td><td>scorpion cage</td><td>It has 2 scorpions in it</td><td>-</td><td>-</td></tr> <tr><td><690.png></td><td>690</td><td>gold</td><td>this needs refining</td><td>-</td><td>-</td></tr> <tr><td><691.png></td><td>691</td><td>gold bar</td><td>this looks valuable</td><td>-</td><td>-</td></tr> <tr><td><692.png></td><td>692</td><td>Ruby ring</td><td>A valuable ring</td><td>-</td><td>-</td></tr> <tr><td><693.png></td><td>693</td><td>Ruby necklace</td><td>I wonder if this is valuable</td><td>X</td><td>-</td></tr> <tr><td><694.png></td><td>694</td><td>Family crest</td><td>The crest of a varrocian noble family</td><td>-</td><td>-</td></tr> <tr><td><695.png></td><td>695</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><696.png></td><td>696</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><697.png></td><td>697</td><td>Crest fragment</td><td>Part of the Fitzharmon family crest</td><td>-</td><td>-</td></tr> <tr><td><698.png></td><td>698</td><td>Steel gauntlets</td><td>Very handy armour</td><td>X</td><td>-</td></tr> <tr><td><699.png></td><td>699</td><td>gauntlets of goldsmithing</td><td>metal gloves for gold making</td><td>X</td><td>-</td></tr> <tr><td><700.png></td><td>700</td><td>gauntlets of cooking</td><td>Used for cooking fish</td><td>X</td><td>-</td></tr> <tr><td><701.png></td><td>701</td><td>gauntlets of chaos</td><td>improves bolt spells</td><td>X</td><td>-</td></tr> <tr><td><702.png></td><td>702</td><td>robe of Zamorak</td><td>A robe worn by worshippers of Zamorak</td><td>X</td><td>-</td></tr> <tr><td><703.png></td><td>703</td><td>robe of Zamorak</td><td>A robe worn by worshippers of Zamorak</td><td>X</td><td>-</td></tr> <tr><td><704.png></td><td>704</td><td>Address Label</td><td>To lord Handelmort- Handelmort mansion</td><td>-</td><td>-</td></tr> <tr><td><705.png></td><td>705</td><td>Tribal totem</td><td>It represents some sort of tribal god</td><td>-</td><td>-</td></tr> <tr><td><706.png></td><td>706</td><td>tourist guide</td><td>Your definitive guide to Ardougne</td><td>-</td><td>-</td></tr> <tr><td><707.png></td><td>707</td><td>spice</td><td>Put it in uncooked stew to make curry</td><td>-</td><td>-</td></tr> <tr><td><708.png></td><td>708</td><td>Uncooked curry</td><td>I need to cook this</td><td>-</td><td>-</td></tr> <tr><td><709.png></td><td>709</td><td>curry</td><td>It's a spicey hot curry</td><td>-</td><td>-</td></tr> <tr><td><710.png></td><td>710</td><td>Burnt curry</td><td>Eew it's horribly burnt</td><td>-</td><td>-</td></tr> <tr><td><711.png></td><td>711</td><td>yew logs certificate</td><td>Each certificate exchangable at Ardougne for 5 yew logs</td><td>-</td><td>X</td></tr> <tr><td><712.png></td><td>712</td><td>maple logs certificate</td><td>Each certificate exchangable at Ardougne for 5 maple logs</td><td>-</td><td>X</td></tr> <tr><td><713.png></td><td>713</td><td>willow logs certificate</td><td>Each certificate exchangable at Ardougne for 5 willow logs</td><td>-</td><td>X</td></tr> <tr><td><714.png></td><td>714</td><td>lockpick</td><td>It makes picking some locks easier</td><td>-</td><td>-</td></tr> <tr><td><715.png></td><td>715</td><td>Red vine worms</td><td>Strange little red worms</td><td>-</td><td>X</td></tr> <tr><td><716.png></td><td>716</td><td>Blanket</td><td>A child's blanket</td><td>-</td><td>-</td></tr> <tr><td><717.png></td><td>717</td><td>Raw giant carp</td><td>I should try cooking this</td><td>-</td><td>-</td></tr> <tr><td><718.png></td><td>718</td><td>giant Carp</td><td>Some nicely cooked fish</td><td>-</td><td>-</td></tr> <tr><td><719.png></td><td>719</td><td>Fishing competition Pass</td><td>Admits one to the Hemenster fishing competition</td><td>-</td><td>-</td></tr> <tr><td><720.png></td><td>720</td><td>Hemenster fishing trophy</td><td>Hurrah you won a fishing competition</td><td>-</td><td>-</td></tr> <tr><td><721.png></td><td>721</td><td>Pendant of Lucien</td><td>Gets me through the chamber of fear</td><td>X</td><td>-</td></tr> <tr><td><722.png></td><td>722</td><td>Boots of lightfootedness</td><td>Wearing these makes me feel like I am floating</td><td>X</td><td>-</td></tr> <tr><td><723.png></td><td>723</td><td>Ice Arrows</td><td>Can only be fired with yew or magic bows</td><td>-</td><td>X</td></tr> <tr><td><724.png></td><td>724</td><td>Lever</td><td>This was once attached to something</td><td>-</td><td>-</td></tr> <tr><td><725.png></td><td>725</td><td>Staff of Armadyl</td><td>A Magical staff</td><td>X</td><td>-</td></tr> <tr><td><726.png></td><td>726</td><td>Pendant of Armadyl</td><td>Allows me to fight Lucien</td><td>X</td><td>-</td></tr> <tr><td><727.png></td><td>727</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><728.png></td><td>728</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><729.png></td><td>729</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><730.png></td><td>730</td><td>Large cog</td><td> A large old cog</td><td>-</td><td>-</td></tr> <tr><td><731.png></td><td>731</td><td>Rat Poison</td><td>This stuff looks nasty</td><td>-</td><td>-</td></tr> <tr><td><732.png></td><td>732</td><td>shiny Key</td><td>Quite a small key</td><td>-</td><td>-</td></tr> <tr><td><733.png></td><td>733</td><td>khazard Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><734.png></td><td>734</td><td>khazard chainmail</td><td>A series of connected metal rings</td><td>X</td><td>-</td></tr> <tr><td><735.png></td><td>735</td><td>khali brew</td><td>A bottle of khazard's worst brew</td><td>-</td><td>-</td></tr> <tr><td><736.png></td><td>736</td><td>khazard cell keys</td><td>Keys for General Khazard's cells</td><td>-</td><td>-</td></tr> <tr><td><737.png></td><td>737</td><td>Poison chalice</td><td>A strange looking drink</td><td>-</td><td>-</td></tr> <tr><td><738.png></td><td>738</td><td>magic whistle</td><td>A small tin whistle</td><td>-</td><td>-</td></tr> <tr><td><739.png></td><td>739</td><td>Cup of tea</td><td>A nice cup of tea</td><td>-</td><td>-</td></tr> <tr><td><740.png></td><td>740</td><td>orb of protection</td><td>a strange glowing green orb</td><td>-</td><td>-</td></tr> <tr><td><741.png></td><td>741</td><td>orbs of protection</td><td>two strange glowing green orbs</td><td>-</td><td>-</td></tr> <tr><td><742.png></td><td>742</td><td>Holy table napkin</td><td>a cloth given to me by sir Galahad</td><td>-</td><td>-</td></tr> <tr><td><743.png></td><td>743</td><td>bell</td><td>I wonder what happens when i ring it</td><td>-</td><td>-</td></tr> <tr><td><744.png></td><td>744</td><td>Gnome Emerald Amulet of protection</td><td>It improves my defense</td><td>X</td><td>-</td></tr> <tr><td><745.png></td><td>745</td><td>magic golden feather</td><td>It will point the way for me</td><td>-</td><td>-</td></tr> <tr><td><746.png></td><td>746</td><td>Holy grail</td><td>A holy and powerful artifact</td><td>-</td><td>-</td></tr> <tr><td><747.png></td><td>747</td><td>Script of Hazeel</td><td>An old scroll with strange ancient text</td><td>-</td><td>-</td></tr> <tr><td><748.png></td><td>748</td><td>Pineapple</td><td>It can be cut up with a knife</td><td>-</td><td>-</td></tr> <tr><td><749.png></td><td>749</td><td>Pineapple ring</td><td>Exotic fruit</td><td>-</td><td>-</td></tr> <tr><td><750.png></td><td>750</td><td>Pineapple Pizza</td><td>A tropicana pizza</td><td>-</td><td>-</td></tr> <tr><td><751.png></td><td>751</td><td>Half pineapple Pizza</td><td>Half of this pizza has been eaten</td><td>-</td><td>-</td></tr> <tr><td><752.png></td><td>752</td><td>Magic scroll</td><td>Maybe I should read it</td><td>-</td><td>-</td></tr> <tr><td><753.png></td><td>753</td><td>Mark of Hazeel</td><td>A large metal amulet</td><td>-</td><td>-</td></tr> <tr><td><754.png></td><td>754</td><td>bloody axe of zamorak</td><td>A vicious looking axe</td><td>X</td><td>-</td></tr> <tr><td><755.png></td><td>755</td><td>carnillean armour</td><td>the carnillean family armour</td><td>-</td><td>-</td></tr> <tr><td><756.png></td><td>756</td><td>Carnillean Key</td><td>An old rusty key</td><td>-</td><td>-</td></tr> <tr><td><757.png></td><td>757</td><td>Cattle prod</td><td>An old cattle prod</td><td>-</td><td>-</td></tr> <tr><td><758.png></td><td>758</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><759.png></td><td>759</td><td>Poisoned animal feed</td><td>This looks nasty</td><td>-</td><td>-</td></tr> <tr><td><760.png></td><td>760</td><td>Protective jacket</td><td>A thick heavy leather top</td><td>X</td><td>-</td></tr> <tr><td><761.png></td><td>761</td><td>Protective trousers</td><td>A thick pair of leather trousers</td><td>X</td><td>-</td></tr> <tr><td><762.png></td><td>762</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><763.png></td><td>763</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><764.png></td><td>764</td><td>Plagued sheep remains</td><td>These sheep remains are infected</td><td>-</td><td>-</td></tr> <tr><td><765.png></td><td>765</td><td>dwellberries</td><td>some rather pretty blue berries</td><td>-</td><td>-</td></tr> <tr><td><766.png></td><td>766</td><td>Gasmask</td><td>Stops me breathing nasty stuff</td><td>X</td><td>-</td></tr> <tr><td><767.png></td><td>767</td><td>picture</td><td>A picture of a lady called Elena</td><td>-</td><td>-</td></tr> <tr><td><768.png></td><td>768</td><td>Book</td><td>Turnip growing for beginners</td><td>-</td><td>-</td></tr> <tr><td><769.png></td><td>769</td><td>Seaslug</td><td>a rather nasty looking crustacean</td><td>-</td><td>-</td></tr> <tr><td><770.png></td><td>770</td><td>chocolaty milk</td><td>Milk with chocolate in it</td><td>-</td><td>-</td></tr> <tr><td><771.png></td><td>771</td><td>Hangover cure</td><td>It doesn't look very tasty</td><td>-</td><td>-</td></tr> <tr><td><772.png></td><td>772</td><td>Chocolate dust</td><td>I prefer it in a bar shape</td><td>-</td><td>-</td></tr> <tr><td><773.png></td><td>773</td><td>Torch</td><td>A unlit home made torch</td><td>-</td><td>-</td></tr> <tr><td><774.png></td><td>774</td><td>Torch</td><td>A lit home made torch</td><td>-</td><td>-</td></tr> <tr><td><775.png></td><td>775</td><td>warrant</td><td>A search warrant for a house in Ardougne</td><td>-</td><td>-</td></tr> <tr><td><776.png></td><td>776</td><td>Damp sticks</td><td>Some damp wooden sticks</td><td>-</td><td>-</td></tr> <tr><td><777.png></td><td>777</td><td>Dry sticks</td><td>Some dry wooden sticks</td><td>-</td><td>-</td></tr> <tr><td><778.png></td><td>778</td><td>Broken glass</td><td>Glass from a broken window pane</td><td>-</td><td>-</td></tr> <tr><td><779.png></td><td>779</td><td>oyster pearls</td><td>I could work wonders with these and a chisel</td><td>-</td><td>-</td></tr> <tr><td><780.png></td><td>780</td><td>little key</td><td>Quite a small key</td><td>-</td><td>-</td></tr> <tr><td><781.png></td><td>781</td><td>Scruffy note</td><td>It seems to say hongorer lure</td><td>-</td><td>-</td></tr> <tr><td><782.png></td><td>782</td><td>Glarial's amulet</td><td>A bright green gem set in a necklace</td><td>X</td><td>-</td></tr> <tr><td><783.png></td><td>783</td><td>Swamp tar</td><td>A foul smelling thick tar like substance</td><td>-</td><td>X</td></tr> <tr><td><784.png></td><td>784</td><td>Uncooked Swamp paste</td><td>A thick tar like substance mixed with flour</td><td>-</td><td>X</td></tr> <tr><td><785.png></td><td>785</td><td>Swamp paste</td><td>A tar like substance mixed with flour and warmed</td><td>-</td><td>X</td></tr> <tr><td><786.png></td><td>786</td><td>Oyster pearl bolts</td><td>Great if you have a crossbow!</td><td>-</td><td>X</td></tr> <tr><td><787.png></td><td>787</td><td>Glarials pebble</td><td>A small pebble with elven inscription</td><td>-</td><td>-</td></tr> <tr><td><788.png></td><td>788</td><td>book on baxtorian</td><td>A book on elven history in north runescape</td><td>-</td><td>-</td></tr> <tr><td><789.png></td><td>789</td><td>large key</td><td>I wonder what this is the key to</td><td>-</td><td>-</td></tr> <tr><td><790.png></td><td>790</td><td>Oyster pearl bolt tips</td><td>Can be used to improve crossbow bolts</td><td>-</td><td>X</td></tr> <tr><td><791.png></td><td>791</td><td>oyster</td><td>It's empty</td><td>-</td><td>-</td></tr> <tr><td><792.png></td><td>792</td><td>oyster pearls</td><td>I could work wonders with these and a chisel</td><td>-</td><td>-</td></tr> <tr><td><793.png></td><td>793</td><td>oyster</td><td>It's a rare oyster</td><td>-</td><td>-</td></tr> <tr><td><794.png></td><td>794</td><td>Soil</td><td>It's a bucket of fine soil</td><td>-</td><td>-</td></tr> <tr><td><795.png></td><td>795</td><td>Dragon medium Helmet</td><td>A medium sized helmet</td><td>X</td><td>-</td></tr> <tr><td><796.png></td><td>796</td><td>Mithril seed</td><td>Magical seeds in a mithril case</td><td>-</td><td>X</td></tr> <tr><td><797.png></td><td>797</td><td>An old key</td><td>A door key</td><td>-</td><td>-</td></tr> <tr><td><798.png></td><td>798</td><td>pigeon cage</td><td>It's for holding pigeons</td><td>-</td><td>-</td></tr> <tr><td><799.png></td><td>799</td><td>Messenger pigeons</td><td>some very plump birds</td><td>-</td><td>-</td></tr> <tr><td><800.png></td><td>800</td><td>Bird feed</td><td>A selection of mixed seeds</td><td>-</td><td>-</td></tr> <tr><td><801.png></td><td>801</td><td>Rotten apples</td><td>Yuck!</td><td>-</td><td>-</td></tr> <tr><td><802.png></td><td>802</td><td>Doctors gown</td><td>I do feel clever wearing this</td><td>X</td><td>-</td></tr> <tr><td><803.png></td><td>803</td><td>Bronze key</td><td>A heavy key</td><td>-</td><td>-</td></tr> <tr><td><804.png></td><td>804</td><td>Distillator</td><td>It's for seperating compounds</td><td>-</td><td>-</td></tr> <tr><td><805.png></td><td>805</td><td>Glarial's urn</td><td>An urn containing glarials ashes</td><td>-</td><td>-</td></tr> <tr><td><806.png></td><td>806</td><td>Glarial's urn</td><td>An empty metal urn</td><td>-</td><td>-</td></tr> <tr><td><807.png></td><td>807</td><td>Priest robe</td><td>I feel closer to saradomin in this</td><td>X</td><td>-</td></tr> <tr><td><808.png></td><td>808</td><td>Priest gown</td><td>I feel closer to saradomin in this</td><td>X</td><td>-</td></tr> <tr><td><809.png></td><td>809</td><td>Liquid Honey</td><td>This isn't worth much</td><td>-</td><td>-</td></tr> <tr><td><810.png></td><td>810</td><td>Ethenea</td><td>An expensive colourless liquid</td><td>-</td><td>-</td></tr> <tr><td><811.png></td><td>811</td><td>Sulphuric Broline</td><td>it's highly poisonous</td><td>-</td><td>-</td></tr> <tr><td><812.png></td><td>812</td><td>Plague sample</td><td>An air tight tin container</td><td>-</td><td>-</td></tr> <tr><td><813.png></td><td>813</td><td>Touch paper</td><td>For scientific testing</td><td>-</td><td>-</td></tr> <tr><td><814.png></td><td>814</td><td>Dragon Bones</td><td>Ew it's a pile of bones</td><td>-</td><td>-</td></tr> <tr><td><815.png></td><td>815</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><816.png></td><td>816</td><td>Snake Weed</td><td>A very rare jungle herb</td><td>-</td><td>-</td></tr> <tr><td><817.png></td><td>817</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><818.png></td><td>818</td><td>Ardrigal</td><td>An interesting</td><td>-</td><td>-</td></tr> <tr><td><819.png></td><td>819</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><820.png></td><td>820</td><td>Sito Foil</td><td>An rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><821.png></td><td>821</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><822.png></td><td>822</td><td>Volencia Moss</td><td>A very rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><823.png></td><td>823</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><824.png></td><td>824</td><td>Rogues Purse</td><td> A rare species of jungle herb</td><td>-</td><td>-</td></tr> <tr><td><825.png></td><td>825</td><td>Soul-Rune</td><td>Used for high level curse spells</td><td>-</td><td>X</td></tr> <tr><td><826.png></td><td>826</td><td>king lathas Amulet</td><td>The amulet is red</td><td>X</td><td>-</td></tr> <tr><td><827.png></td><td>827</td><td>Bronze Spear</td><td>A bronze tipped spear</td><td>X</td><td>-</td></tr> <tr><td><828.png></td><td>828</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><829.png></td><td>829</td><td>Dragon bitter</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><830.png></td><td>830</td><td>Greenmans ale</td><td>A glass of frothy ale</td><td>-</td><td>-</td></tr> <tr><td><831.png></td><td>831</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><832.png></td><td>832</td><td>halloween mask</td><td>aaaarrrghhh ... i'm a monster</td><td>X</td><td>-</td></tr> <tr><td><833.png></td><td>833</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><834.png></td><td>834</td><td>cocktail shaker</td><td>For mixing cocktails</td><td>-</td><td>-</td></tr> <tr><td><835.png></td><td>835</td><td>Bone Key</td><td>A key delicately carved key made from a single piece of bone</td><td>-</td><td>-</td></tr> <tr><td><836.png></td><td>836</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><837.png></td><td>837</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><838.png></td><td>838</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><839.png></td><td>839</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><840.png></td><td>840</td><td>gnome robe</td><td>A high fashion robe</td><td>X</td><td>-</td></tr> <tr><td><841.png></td><td>841</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><842.png></td><td>842</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><843.png></td><td>843</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><844.png></td><td>844</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><845.png></td><td>845</td><td>gnomeshat</td><td>A silly pointed hat</td><td>X</td><td>-</td></tr> <tr><td><846.png></td><td>846</td><td>gnome top</td><td>rometti - the ultimate in gnome design</td><td>X</td><td>-</td></tr> <tr><td><847.png></td><td>847</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><848.png></td><td>848</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><849.png></td><td>849</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><850.png></td><td>850</td><td>gnome top</td><td>rometti - the only name in gnome fashion!</td><td>X</td><td>-</td></tr> <tr><td><851.png></td><td>851</td><td>gnome cocktail guide</td><td>A book on tree gnome cocktails</td><td>-</td><td>-</td></tr> <tr><td><852.png></td><td>852</td><td>Beads of the dead</td><td>A curious looking neck ornament</td><td>X</td><td>-</td></tr> <tr><td><853.png></td><td>853</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><854.png></td><td>854</td><td>cocktail glass</td><td>For sipping cocktails</td><td>-</td><td>-</td></tr> <tr><td><855.png></td><td>855</td><td>lemon</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><856.png></td><td>856</td><td>lemon slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><857.png></td><td>857</td><td>orange</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><858.png></td><td>858</td><td>orange slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><859.png></td><td>859</td><td>Diced orange</td><td>Fresh chunks of orange</td><td>-</td><td>-</td></tr> <tr><td><860.png></td><td>860</td><td>Diced lemon</td><td>Fresh chunks of lemon</td><td>-</td><td>-</td></tr> <tr><td><861.png></td><td>861</td><td>Fresh Pineapple</td><td>It can be cut up with a knife</td><td>-</td><td>-</td></tr> <tr><td><862.png></td><td>862</td><td>Pineapple chunks</td><td>Fresh chunks of pineapple</td><td>-</td><td>-</td></tr> <tr><td><863.png></td><td>863</td><td>lime</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><864.png></td><td>864</td><td>lime chunks</td><td>Fresh chunks of lime</td><td>-</td><td>-</td></tr> <tr><td><865.png></td><td>865</td><td>lime slices</td><td>It's very fresh</td><td>-</td><td>-</td></tr> <tr><td><866.png></td><td>866</td><td>fruit blast</td><td>A cool refreshing fruit mix</td><td>-</td><td>-</td></tr> <tr><td><867.png></td><td>867</td><td>odd looking cocktail</td><td>A cool refreshing mix</td><td>-</td><td>-</td></tr> <tr><td><868.png></td><td>868</td><td>Whisky</td><td>A locally brewed Malt</td><td>-</td><td>-</td></tr> <tr><td><869.png></td><td>869</td><td>vodka</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><870.png></td><td>870</td><td>gin</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><871.png></td><td>871</td><td>cream</td><td>Fresh cream</td><td>-</td><td>-</td></tr> <tr><td><872.png></td><td>872</td><td>Drunk dragon</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><873.png></td><td>873</td><td>Equa leaves</td><td>Small sweet smelling leaves</td><td>-</td><td>-</td></tr> <tr><td><874.png></td><td>874</td><td>SGG</td><td>A short green guy..looks good</td><td>-</td><td>-</td></tr> <tr><td><875.png></td><td>875</td><td>Chocolate saturday</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><876.png></td><td>876</td><td>brandy</td><td>A strong spirit</td><td>-</td><td>-</td></tr> <tr><td><877.png></td><td>877</td><td>blurberry special</td><td>Looks good..smells strong</td><td>-</td><td>-</td></tr> <tr><td><878.png></td><td>878</td><td>wizard blizzard</td><td>Looks like a strange mix</td><td>-</td><td>-</td></tr> <tr><td><879.png></td><td>879</td><td>pineapple punch</td><td>A fresh healthy fruit mix</td><td>-</td><td>-</td></tr> <tr><td><880.png></td><td>880</td><td>gnomebatta dough</td><td>Dough formed into a base</td><td>-</td><td>-</td></tr> <tr><td><881.png></td><td>881</td><td>gianne dough</td><td>It's made from a secret recipe</td><td>-</td><td>-</td></tr> <tr><td><882.png></td><td>882</td><td>gnomebowl dough</td><td>Dough formed into a bowl shape</td><td>-</td><td>-</td></tr> <tr><td><883.png></td><td>883</td><td>gnomecrunchie dough</td><td>Dough formed into cookie shapes</td><td>-</td><td>-</td></tr> <tr><td><884.png></td><td>884</td><td>gnomebatta</td><td>A baked dough base</td><td>-</td><td>-</td></tr> <tr><td><885.png></td><td>885</td><td>gnomebowl</td><td>A baked dough bowl</td><td>-</td><td>-</td></tr> <tr><td><886.png></td><td>886</td><td>gnomebatta</td><td>It's burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><887.png></td><td>887</td><td>gnomecrunchie</td><td>They're burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><888.png></td><td>888</td><td>gnomebowl</td><td>It's burnt to a sinder</td><td>-</td><td>-</td></tr> <tr><td><889.png></td><td>889</td><td>Uncut Red Topaz</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><890.png></td><td>890</td><td>Uncut Jade</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><891.png></td><td>891</td><td>Uncut Opal</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><892.png></td><td>892</td><td>Red Topaz</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><893.png></td><td>893</td><td>Jade</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><894.png></td><td>894</td><td>Opal</td><td>A semi precious stone</td><td>-</td><td>-</td></tr> <tr><td><895.png></td><td>895</td><td>Swamp Toad</td><td>Slippery little blighters</td><td>-</td><td>-</td></tr> <tr><td><896.png></td><td>896</td><td>Toad legs</td><td>Gnome delicacy apparently</td><td>-</td><td>-</td></tr> <tr><td><897.png></td><td>897</td><td>King worm</td><td>Gnome delicacy apparently</td><td>-</td><td>-</td></tr> <tr><td><898.png></td><td>898</td><td>Gnome spice</td><td>Aluft Giannes secret reciepe</td><td>-</td><td>-</td></tr> <tr><td><899.png></td><td>899</td><td>gianne cook book</td><td>Aluft Giannes favorite dishes</td><td>-</td><td>-</td></tr> <tr><td><900.png></td><td>900</td><td>gnomecrunchie</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><901.png></td><td>901</td><td>cheese and tomato batta</td><td>Smells really good</td><td>-</td><td>-</td></tr> <tr><td><902.png></td><td>902</td><td>toad batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><903.png></td><td>903</td><td>gnome batta</td><td>smells like pants</td><td>-</td><td>-</td></tr> <tr><td><904.png></td><td>904</td><td>worm batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><905.png></td><td>905</td><td>fruit batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><906.png></td><td>906</td><td>Veg batta</td><td>well..it looks healthy</td><td>-</td><td>-</td></tr> <tr><td><907.png></td><td>907</td><td>Chocolate bomb</td><td>Looks great</td><td>-</td><td>-</td></tr> <tr><td><908.png></td><td>908</td><td>Vegball</td><td>Looks pretty healthy</td><td>-</td><td>-</td></tr> <tr><td><909.png></td><td>909</td><td>worm hole</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><910.png></td><td>910</td><td>Tangled toads legs</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><911.png></td><td>911</td><td>Choc crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><912.png></td><td>912</td><td>Worm crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><913.png></td><td>913</td><td>Toad crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><914.png></td><td>914</td><td>Spice crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><915.png></td><td>915</td><td>Crushed Gemstone</td><td>A gemstone that has been smashed</td><td>-</td><td>-</td></tr> <tr><td><916.png></td><td>916</td><td>Blurberry badge</td><td>an official cocktail maker</td><td>-</td><td>-</td></tr> <tr><td><917.png></td><td>917</td><td>Gianne badge</td><td>an official gianne chef</td><td>-</td><td>-</td></tr> <tr><td><918.png></td><td>918</td><td>tree gnome translation</td><td>Translate the old gnome tounge</td><td>-</td><td>-</td></tr> <tr><td><919.png></td><td>919</td><td>Bark sample</td><td>A sample from the grand tree</td><td>-</td><td>-</td></tr> <tr><td><920.png></td><td>920</td><td>War ship</td><td>A model of a karamja warship</td><td>-</td><td>-</td></tr> <tr><td><921.png></td><td>921</td><td>gloughs journal</td><td>Glough's private notes</td><td>-</td><td>-</td></tr> <tr><td><922.png></td><td>922</td><td>invoice</td><td>A note with foreman's timber order</td><td>-</td><td>-</td></tr> <tr><td><923.png></td><td>923</td><td>Ugthanki Kebab</td><td>A strange smelling Kebab made from Ugthanki meat - it doesn't look too good</td><td>-</td><td>-</td></tr> <tr><td><924.png></td><td>924</td><td>special curry</td><td>It's a spicy hot curry</td><td>-</td><td>-</td></tr> <tr><td><925.png></td><td>925</td><td>glough's key</td><td>Glough left this at anita's</td><td>-</td><td>-</td></tr> <tr><td><926.png></td><td>926</td><td>glough's notes</td><td>Scribbled notes and diagrams</td><td>-</td><td>-</td></tr> <tr><td><927.png></td><td>927</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><928.png></td><td>928</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><929.png></td><td>929</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><930.png></td><td>930</td><td>Pebble</td><td>The pebble has an inscription</td><td>-</td><td>-</td></tr> <tr><td><931.png></td><td>931</td><td>Daconia rock</td><td>A magicaly crafted stone</td><td>-</td><td>-</td></tr> <tr><td><932.png></td><td>932</td><td>Sinister key</td><td>You get a sense of dread from this key</td><td>-</td><td>-</td></tr> <tr><td><933.png></td><td>933</td><td>Herb</td><td>I need a closer look to identify this</td><td>-</td><td>-</td></tr> <tr><td><934.png></td><td>934</td><td>Torstol</td><td>A useful herb</td><td>-</td><td>-</td></tr> <tr><td><935.png></td><td>935</td><td>Unfinished potion</td><td>I need Jangerberries to finish this Torstol potion</td><td>-</td><td>-</td></tr> <tr><td><936.png></td><td>936</td><td>Jangerberries</td><td>They don't look very ripe</td><td>-</td><td>-</td></tr> <tr><td><937.png></td><td>937</td><td>fruit blast</td><td>A cool refreshing fruit mix</td><td>-</td><td>-</td></tr> <tr><td><938.png></td><td>938</td><td>blurberry special</td><td>Looks good..smells strong</td><td>-</td><td>-</td></tr> <tr><td><939.png></td><td>939</td><td>wizard blizzard</td><td>Looks like a strange mix</td><td>-</td><td>-</td></tr> <tr><td><940.png></td><td>940</td><td>pineapple punch</td><td>A fresh healthy fruit mix</td><td>-</td><td>-</td></tr> <tr><td><941.png></td><td>941</td><td>SGG</td><td>A short green guy..looks good</td><td>-</td><td>-</td></tr> <tr><td><942.png></td><td>942</td><td>Chocolate saturday</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><943.png></td><td>943</td><td>Drunk dragon</td><td>A warm creamy alcoholic beverage</td><td>-</td><td>-</td></tr> <tr><td><944.png></td><td>944</td><td>cheese and tomato batta</td><td>Smells really good</td><td>-</td><td>-</td></tr> <tr><td><945.png></td><td>945</td><td>toad batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><946.png></td><td>946</td><td>gnome batta</td><td>smells like pants</td><td>-</td><td>-</td></tr> <tr><td><947.png></td><td>947</td><td>worm batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><948.png></td><td>948</td><td>fruit batta</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><949.png></td><td>949</td><td>Veg batta</td><td>well..it looks healthy</td><td>-</td><td>-</td></tr> <tr><td><950.png></td><td>950</td><td>Chocolate bomb</td><td>Looks great</td><td>-</td><td>-</td></tr> <tr><td><951.png></td><td>951</td><td>Vegball</td><td>Looks pretty healthy</td><td>-</td><td>-</td></tr> <tr><td><952.png></td><td>952</td><td>worm hole</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><953.png></td><td>953</td><td>Tangled toads legs</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><954.png></td><td>954</td><td>Choc crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><955.png></td><td>955</td><td>Worm crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><956.png></td><td>956</td><td>Toad crunchies</td><td>actually smells quite good</td><td>-</td><td>-</td></tr> <tr><td><957.png></td><td>957</td><td>Spice crunchies</td><td>yum ... smells good</td><td>-</td><td>-</td></tr> <tr><td><958.png></td><td>958</td><td>Stone-Plaque</td><td>A stone plaque with carved letters in it</td><td>-</td><td>-</td></tr> <tr><td><959.png></td><td>959</td><td>Tattered Scroll</td><td>An ancient tattered scroll</td><td>-</td><td>-</td></tr> <tr><td><960.png></td><td>960</td><td>Crumpled Scroll</td><td>An ancient crumpled scroll</td><td>-</td><td>-</td></tr> <tr><td><961.png></td><td>961</td><td>Bervirius Tomb Notes</td><td>Notes taken from the tomb of Bervirius</td><td>-</td><td>-</td></tr> <tr><td><962.png></td><td>962</td><td>Zadimus Corpse</td><td>The remains of Zadimus</td><td>-</td><td>-</td></tr> <tr><td><963.png></td><td>963</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><964.png></td><td>964</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><965.png></td><td>965</td><td>Potion of Zamorak</td><td>It looks scary</td><td>-</td><td>-</td></tr> <tr><td><966.png></td><td>966</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><967.png></td><td>967</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><968.png></td><td>968</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><969.png></td><td>969</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><970.png></td><td>970</td><td>Boots</td><td>They're soft and silky</td><td>X</td><td>-</td></tr> <tr><td><971.png></td><td>971</td><td>Santa's hat</td><td>It's a santa claus' hat</td><td>X</td><td>-</td></tr> <tr><td><972.png></td><td>972</td><td>Locating Crystal</td><td>A magical crystal sphere</td><td>-</td><td>-</td></tr> <tr><td><973.png></td><td>973</td><td>Sword Pommel</td><td>An ivory sword pommel</td><td>-</td><td>-</td></tr> <tr><td><974.png></td><td>974</td><td>Bone Shard</td><td>A slender piece of bone</td><td>-</td><td>-</td></tr> <tr><td><975.png></td><td>975</td><td>Steel Wire</td><td>Useful for crafting items</td><td>-</td><td>-</td></tr> <tr><td><976.png></td><td>976</td><td>Bone Beads</td><td>Beads carved out of bone</td><td>-</td><td>-</td></tr> <tr><td><977.png></td><td>977</td><td>Rashiliya Corpse</td><td>The remains of the Zombie Queen</td><td>-</td><td>-</td></tr> <tr><td><978.png></td><td>978</td><td>ResetCrystal</td><td>Helps reset things in game</td><td>-</td><td>-</td></tr> <tr><td><979.png></td><td>979</td><td>Bronze Wire</td><td>Useful for crafting items</td><td>-</td><td>-</td></tr> <tr><td><980.png></td><td>980</td><td>Present</td><td>Click to use this on a friend</td><td>-</td><td>-</td></tr> <tr><td><981.png></td><td>981</td><td>Gnome Ball</td><td>Lets play</td><td>-</td><td>-</td></tr> <tr><td><982.png></td><td>982</td><td>Papyrus</td><td>Used for making notes</td><td>-</td><td>-</td></tr> <tr><td><983.png></td><td>983</td><td>A lump of Charcoal</td><td>a lump of cooked coal good for making marks.</td><td>-</td><td>-</td></tr> <tr><td><984.png></td><td>984</td><td>Arrow</td><td>linen wrapped around an arrow head</td><td>-</td><td>-</td></tr> <tr><td><985.png></td><td>985</td><td>Lit Arrow</td><td>A flamming arrow</td><td>-</td><td>X</td></tr> <tr><td><986.png></td><td>986</td><td>Rocks</td><td>A few Large rocks</td><td>-</td><td>-</td></tr> <tr><td><987.png></td><td>987</td><td>Paramaya Rest Ticket</td><td>Allows you to rest in the luxurius Paramaya Inn</td><td>-</td><td>-</td></tr> <tr><td><988.png></td><td>988</td><td>Ship Ticket</td><td>Allows you passage on the 'Lady of the Waves' ship.</td><td>-</td><td>-</td></tr> <tr><td><989.png></td><td>989</td><td>Damp cloth</td><td>It smells as if it's been doused in alcohol</td><td>-</td><td>-</td></tr> <tr><td><990.png></td><td>990</td><td>Desert Boots</td><td>Boots made specially for the desert</td><td>X</td><td>-</td></tr> <tr><td><991.png></td><td>991</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><992.png></td><td>992</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><993.png></td><td>993</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><994.png></td><td>994</td><td>Orb of light</td><td>The orb gives you a safe peaceful feeling</td><td>-</td><td>-</td></tr> <tr><td><995.png></td><td>995</td><td>Railing</td><td>A broken metal rod</td><td>-</td><td>-</td></tr> <tr><td><996.png></td><td>996</td><td>Randas's journal</td><td>An old journal with several pages missing</td><td>-</td><td>-</td></tr> <tr><td><997.png></td><td>997</td><td>Unicorn horn</td><td>Poor unicorn went splat!</td><td>-</td><td>-</td></tr> <tr><td><998.png></td><td>998</td><td>Coat of Arms</td><td>A symbol of truth and all that is good</td><td>-</td><td>-</td></tr> <tr><td><999.png></td><td>999</td><td>Coat of Arms</td><td>A symbol of truth and all that is good</td><td>-</td><td>-</td></tr> <tr><td><1000.png></td><td>1000</td><td>Staff of Iban</td><td>It's a slightly magical stick</td><td>X</td><td>-</td></tr> <tr><td><1001.png></td><td>1001</td><td>Dwarf brew</td><td>It's a bucket of home made brew</td><td>-</td><td>-</td></tr> <tr><td><1002.png></td><td>1002</td><td>Ibans Ashes</td><td>A heap of ashes</td><td>-</td><td>-</td></tr> <tr><td><1003.png></td><td>1003</td><td>Cat</td><td>She's sleeping..i think!</td><td>-</td><td>-</td></tr> <tr><td><1004.png></td><td>1004</td><td>A Doll of Iban</td><td>A strange doll made from sticks and cloth</td><td>-</td><td>-</td></tr> <tr><td><1005.png></td><td>1005</td><td>Old Journal</td><td>I wonder who wrote this!</td><td>-</td><td>-</td></tr> <tr><td><1006.png></td><td>1006</td><td>Klank's gauntlets</td><td>Heavy hand protection</td><td>X</td><td>-</td></tr> <tr><td><1007.png></td><td>1007</td><td>Iban's shadow</td><td>A dark mystical liquid</td><td>-</td><td>-</td></tr> <tr><td><1008.png></td><td>1008</td><td>Iban's conscience</td><td>The remains of a dove that died long ago</td><td>-</td><td>-</td></tr> <tr><td><1009.png></td><td>1009</td><td>Amulet of Othainian</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1010.png></td><td>1010</td><td>Amulet of Doomion</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1011.png></td><td>1011</td><td>Amulet of Holthion</td><td>A strange looking amulet</td><td>X</td><td>-</td></tr> <tr><td><1012.png></td><td>1012</td><td>keep key</td><td>A small prison key</td><td>-</td><td>-</td></tr> <tr><td><1013.png></td><td>1013</td><td>Bronze Throwing Dart</td><td>A deadly throwing dart with a bronze tip.</td><td>X</td><td>X</td></tr> <tr><td><1014.png></td><td>1014</td><td>Prototype Throwing Dart</td><td>A proto type of a deadly throwing dart.</td><td>-</td><td>X</td></tr> <tr><td><1015.png></td><td>1015</td><td>Iron Throwing Dart</td><td>A deadly throwing dart with an iron tip.</td><td>X</td><td>X</td></tr> <tr><td><1016.png></td><td>1016</td><td>Full Water Skin</td><td>A skinful of water</td><td>-</td><td>-</td></tr> <tr><td><1017.png></td><td>1017</td><td>Lens mould</td><td>A peculiar mould in the shape of a disc</td><td>-</td><td>-</td></tr> <tr><td><1018.png></td><td>1018</td><td>Lens</td><td>A perfectly formed glass disc</td><td>-</td><td>-</td></tr> <tr><td><1019.png></td><td>1019</td><td>Desert Robe</td><td>Cool light robe to wear in the desert</td><td>X</td><td>-</td></tr> <tr><td><1020.png></td><td>1020</td><td>Desert Shirt</td><td>A light cool shirt to wear in the desert</td><td>X</td><td>-</td></tr> <tr><td><1021.png></td><td>1021</td><td>Metal Key</td><td>A large metalic key.</td><td>-</td><td>-</td></tr> <tr><td><1022.png></td><td>1022</td><td>Slaves Robe Bottom</td><td>A dirty desert skirt</td><td>X</td><td>-</td></tr> <tr><td><1023.png></td><td>1023</td><td>Slaves Robe Top</td><td>A dirty desert shirt</td><td>X</td><td>-</td></tr> <tr><td><1024.png></td><td>1024</td><td>Steel Throwing Dart</td><td>A deadly throwing dart with a steel tip.</td><td>X</td><td>X</td></tr> <tr><td><1025.png></td><td>1025</td><td>Astrology Book</td><td>A book on Astrology in runescape</td><td>-</td><td>-</td></tr> <tr><td><1026.png></td><td>1026</td><td>Unholy Symbol mould</td><td>use this with silver in a furnace</td><td>-</td><td>-</td></tr> <tr><td><1027.png></td><td>1027</td><td>Unholy Symbol of Zamorak</td><td>this needs stringing</td><td>-</td><td>-</td></tr> <tr><td><1028.png></td><td>1028</td><td>Unblessed Unholy Symbol of Zamorak</td><td>this needs blessing</td><td>X</td><td>-</td></tr> <tr><td><1029.png></td><td>1029</td><td>Unholy Symbol of Zamorak</td><td>a symbol indicating allegiance to Zamorak</td><td>X</td><td>-</td></tr> <tr><td><1030.png></td><td>1030</td><td>Shantay Desert Pass</td><td>Allows you into the desert through the Shantay pass worth 5 gold.</td><td>-</td><td>X</td></tr> <tr><td><1031.png></td><td>1031</td><td>Staff of Iban</td><td>The staff is damaged</td><td>-</td><td>-</td></tr> <tr><td><1032.png></td><td>1032</td><td>Dwarf cannon base</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1033.png></td><td>1033</td><td>Dwarf cannon stand</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1034.png></td><td>1034</td><td>Dwarf cannon barrels</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1035.png></td><td>1035</td><td>Dwarf cannon furnace</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1036.png></td><td>1036</td><td>Fingernails</td><td>Ugh gross!</td><td>-</td><td>-</td></tr> <tr><td><1037.png></td><td>1037</td><td>Powering crystal1</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1038.png></td><td>1038</td><td>Mining Barrel</td><td>A roughly constructed barrel for carrying rock.</td><td>-</td><td>-</td></tr> <tr><td><1039.png></td><td>1039</td><td>Ana in a Barrel</td><td>A roughly constructed barrel with an Ana in it!</td><td>-</td><td>-</td></tr> <tr><td><1040.png></td><td>1040</td><td>Stolen gold</td><td>I wish I could spend it</td><td>-</td><td>-</td></tr> <tr><td><1041.png></td><td>1041</td><td>multi cannon ball</td><td>A heavy metal spiked ball</td><td>-</td><td>X</td></tr> <tr><td><1042.png></td><td>1042</td><td>Railing</td><td>A metal railing replacement</td><td>-</td><td>-</td></tr> <tr><td><1043.png></td><td>1043</td><td>Ogre tooth</td><td>big sharp and nasty</td><td>-</td><td>-</td></tr> <tr><td><1044.png></td><td>1044</td><td>Ogre relic</td><td>A grotesque symbol of the ogres</td><td>-</td><td>-</td></tr> <tr><td><1045.png></td><td>1045</td><td>Skavid map</td><td>A map of cave locations</td><td>-</td><td>-</td></tr> <tr><td><1046.png></td><td>1046</td><td>dwarf remains</td><td>The remains of a dwarf savaged by goblins</td><td>-</td><td>-</td></tr> <tr><td><1047.png></td><td>1047</td><td>Key</td><td>A key for a chest</td><td>-</td><td>-</td></tr> <tr><td><1048.png></td><td>1048</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1049.png></td><td>1049</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1050.png></td><td>1050</td><td>Ogre relic part</td><td>A piece of a statue</td><td>-</td><td>-</td></tr> <tr><td><1051.png></td><td>1051</td><td>Ground bat bones</td><td>The ground bones of a bat</td><td>-</td><td>-</td></tr> <tr><td><1052.png></td><td>1052</td><td>Unfinished potion</td><td>I need another ingredient to finish the shaman potion</td><td>-</td><td>-</td></tr> <tr><td><1053.png></td><td>1053</td><td>Ogre potion</td><td>A strange liquid</td><td>-</td><td>-</td></tr> <tr><td><1054.png></td><td>1054</td><td>Magic ogre potion</td><td>A strange liquid that bubbles with power</td><td>-</td><td>-</td></tr> <tr><td><1055.png></td><td>1055</td><td>Tool kit</td><td>These could be handy!</td><td>-</td><td>-</td></tr> <tr><td><1056.png></td><td>1056</td><td>Nulodion's notes</td><td>Construction notes for dwarf cannon ammo</td><td>-</td><td>-</td></tr> <tr><td><1057.png></td><td>1057</td><td>cannon ammo mould</td><td>Used to make cannon ammo</td><td>-</td><td>-</td></tr> <tr><td><1058.png></td><td>1058</td><td>Tenti Pineapple</td><td>The most delicious in the whole of Kharid</td><td>-</td><td>-</td></tr> <tr><td><1059.png></td><td>1059</td><td>Bedobin Copy Key</td><td>A copy of a key for the captains of the mining camps chest</td><td>-</td><td>-</td></tr> <tr><td><1060.png></td><td>1060</td><td>Technical Plans</td><td>Very technical looking plans for making a thrown weapon of some sort</td><td>-</td><td>-</td></tr> <tr><td><1061.png></td><td>1061</td><td>Rock cake</td><td>Yum... I think!</td><td>-</td><td>-</td></tr> <tr><td><1062.png></td><td>1062</td><td>Bronze dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1063.png></td><td>1063</td><td>Iron dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1064.png></td><td>1064</td><td>Steel dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1065.png></td><td>1065</td><td>Mithril dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1066.png></td><td>1066</td><td>Adamantite dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1067.png></td><td>1067</td><td>Rune dart tips</td><td>Dangerous looking dart tips - need feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1068.png></td><td>1068</td><td>Mithril Throwing Dart</td><td>A deadly throwing dart with a mithril tip.</td><td>X</td><td>X</td></tr> <tr><td><1069.png></td><td>1069</td><td>Adamantite Throwing Dart</td><td>A deadly throwing dart with an adamantite tip.</td><td>X</td><td>X</td></tr> <tr><td><1070.png></td><td>1070</td><td>Rune Throwing Dart</td><td>A deadly throwing dart with a runite tip.</td><td>X</td><td>X</td></tr> <tr><td><1071.png></td><td>1071</td><td>Prototype dart tip</td><td>Dangerous looking dart tip - needs feathers for flight</td><td>-</td><td>X</td></tr> <tr><td><1072.png></td><td>1072</td><td>info document</td><td>read to access variable choices</td><td>-</td><td>-</td></tr> <tr><td><1073.png></td><td>1073</td><td>Instruction manual</td><td>An old note book</td><td>-</td><td>-</td></tr> <tr><td><1074.png></td><td>1074</td><td>Unfinished potion</td><td>I need another ingredient to finish this potion</td><td>-</td><td>-</td></tr> <tr><td><1075.png></td><td>1075</td><td>Iron throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1076.png></td><td>1076</td><td>Bronze throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1077.png></td><td>1077</td><td>Steel throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1078.png></td><td>1078</td><td>Mithril throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1079.png></td><td>1079</td><td>Adamantite throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1080.png></td><td>1080</td><td>Rune throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1081.png></td><td>1081</td><td>Black throwing knife</td><td>A finely balanced knife</td><td>X</td><td>-</td></tr> <tr><td><1082.png></td><td>1082</td><td>Water Skin mostly full</td><td>A half full skin of water</td><td>-</td><td>-</td></tr> <tr><td><1083.png></td><td>1083</td><td>Water Skin mostly empty</td><td>A half empty skin of water</td><td>-</td><td>-</td></tr> <tr><td><1084.png></td><td>1084</td><td>Water Skin mouthful left</td><td>A waterskin with a mouthful of water left</td><td>-</td><td>-</td></tr> <tr><td><1085.png></td><td>1085</td><td>Empty Water Skin</td><td>A completely empty waterskin</td><td>-</td><td>-</td></tr> <tr><td><1086.png></td><td>1086</td><td>nightshade</td><td>Deadly!</td><td>-</td><td>-</td></tr> <tr><td><1087.png></td><td>1087</td><td>Shaman robe</td><td>This has been left by one of the dead ogre shaman</td><td>-</td><td>-</td></tr> <tr><td><1088.png></td><td>1088</td><td>Iron Spear</td><td>An iron tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1089.png></td><td>1089</td><td>Steel Spear</td><td>A steel tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1090.png></td><td>1090</td><td>Mithril Spear</td><td>A mithril tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1091.png></td><td>1091</td><td>Adamantite Spear</td><td>An adamantite tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1092.png></td><td>1092</td><td>Rune Spear</td><td>A rune tipped spear</td><td>X</td><td>-</td></tr> <tr><td><1093.png></td><td>1093</td><td>Cat</td><td>it's fluffs</td><td>-</td><td>-</td></tr> <tr><td><1094.png></td><td>1094</td><td>Seasoned Sardine</td><td>They don't smell any better</td><td>-</td><td>-</td></tr> <tr><td><1095.png></td><td>1095</td><td>Kittens</td><td>purrr</td><td>-</td><td>-</td></tr> <tr><td><1096.png></td><td>1096</td><td>Kitten</td><td>purrr</td><td>-</td><td>-</td></tr> <tr><td><1097.png></td><td>1097</td><td>Wrought iron key</td><td>This key clears unlocks a very sturdy gate of some sort.</td><td>-</td><td>-</td></tr> <tr><td><1098.png></td><td>1098</td><td>Cell Door Key</td><td>A roughly hewn key</td><td>-</td><td>-</td></tr> <tr><td><1099.png></td><td>1099</td><td>A free Shantay Disclaimer</td><td>Very important information.</td><td>-</td><td>-</td></tr> <tr><td><1100.png></td><td>1100</td><td>Doogle leaves</td><td>Small sweet smelling leaves</td><td>-</td><td>-</td></tr> <tr><td><1101.png></td><td>1101</td><td>Raw Ugthanki Meat</td><td>I need to cook this first</td><td>-</td><td>-</td></tr> <tr><td><1102.png></td><td>1102</td><td>Tasty Ugthanki Kebab</td><td>A fresh Kebab made from Ugthanki meat</td><td>-</td><td>-</td></tr> <tr><td><1103.png></td><td>1103</td><td>Cooked Ugthanki Meat</td><td>Freshly cooked Ugthanki meat</td><td>-</td><td>-</td></tr> <tr><td><1104.png></td><td>1104</td><td>Uncooked Pitta Bread</td><td>I need to cook this.</td><td>-</td><td>-</td></tr> <tr><td><1105.png></td><td>1105</td><td>Pitta Bread</td><td>Mmmm I need to add some other ingredients yet.</td><td>-</td><td>-</td></tr> <tr><td><1106.png></td><td>1106</td><td>Tomato Mixture</td><td>A mixture of tomatoes in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1107.png></td><td>1107</td><td>Onion Mixture</td><td>A mixture of onions in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1108.png></td><td>1108</td><td>Onion and Tomato Mixture</td><td>A mixture of onions and tomatoes in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1109.png></td><td>1109</td><td>Onion and Tomato and Ugthanki Mix</td><td>A mixture of onions and tomatoes and Ugthanki meat in a bowl</td><td>-</td><td>-</td></tr> <tr><td><1110.png></td><td>1110</td><td>Burnt Pitta Bread</td><td>Urgh - it's all burnt</td><td>-</td><td>-</td></tr> <tr><td><1111.png></td><td>1111</td><td>Panning tray</td><td>used for panning gold</td><td>-</td><td>-</td></tr> <tr><td><1112.png></td><td>1112</td><td>Panning tray</td><td>this tray contains gold nuggets</td><td>-</td><td>-</td></tr> <tr><td><1113.png></td><td>1113</td><td>Panning tray</td><td>this tray contains mud</td><td>-</td><td>-</td></tr> <tr><td><1114.png></td><td>1114</td><td>Rock pick</td><td>a sharp pick for cracking rocks</td><td>-</td><td>-</td></tr> <tr><td><1115.png></td><td>1115</td><td>Specimen brush</td><td>stiff brush for cleaning specimens</td><td>-</td><td>-</td></tr> <tr><td><1116.png></td><td>1116</td><td>Specimen jar</td><td>a jar for holding soil samples</td><td>-</td><td>-</td></tr> <tr><td><1117.png></td><td>1117</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1118.png></td><td>1118</td><td>gold Nuggets</td><td>Real gold pieces!</td><td>-</td><td>X</td></tr> <tr><td><1119.png></td><td>1119</td><td>cat</td><td>looks like a healthy one</td><td>-</td><td>-</td></tr> <tr><td><1120.png></td><td>1120</td><td>Scrumpled piece of paper</td><td>A piece of paper with barely legible writing - looks like a recipe!</td><td>-</td><td>-</td></tr> <tr><td><1121.png></td><td>1121</td><td>Digsite info</td><td>IAN ONLY</td><td>-</td><td>-</td></tr> <tr><td><1122.png></td><td>1122</td><td>Poisoned Bronze Throwing Dart</td><td>A venomous throwing dart with a bronze tip.</td><td>X</td><td>X</td></tr> <tr><td><1123.png></td><td>1123</td><td>Poisoned Iron Throwing Dart</td><td>A venomous throwing dart with an iron tip.</td><td>X</td><td>X</td></tr> <tr><td><1124.png></td><td>1124</td><td>Poisoned Steel Throwing Dart</td><td>A venomous throwing dart with a steel tip.</td><td>X</td><td>X</td></tr> <tr><td><1125.png></td><td>1125</td><td>Poisoned Mithril Throwing Dart</td><td>A venomous throwing dart with a mithril tip.</td><td>X</td><td>X</td></tr> <tr><td><1126.png></td><td>1126</td><td>Poisoned Adamantite Throwing Dart</td><td>A venomous throwing dart with an adamantite tip.</td><td>X</td><td>X</td></tr> <tr><td><1127.png></td><td>1127</td><td>Poisoned Rune Throwing Dart</td><td>A deadly venomous dart with a runite tip.</td><td>X</td><td>X</td></tr> <tr><td><1128.png></td><td>1128</td><td>Poisoned Bronze throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1129.png></td><td>1129</td><td>Poisoned Iron throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1130.png></td><td>1130</td><td>Poisoned Steel throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1131.png></td><td>1131</td><td>Poisoned Mithril throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1132.png></td><td>1132</td><td>Poisoned Black throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1133.png></td><td>1133</td><td>Poisoned Adamantite throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1134.png></td><td>1134</td><td>Poisoned Rune throwing knife</td><td>A finely balanced knife with a coating of venom</td><td>X</td><td>-</td></tr> <tr><td><1135.png></td><td>1135</td><td>Poisoned Bronze Spear</td><td>A bronze tipped spear with added venom </td><td>X</td><td>-</td></tr> <tr><td><1136.png></td><td>1136</td><td>Poisoned Iron Spear</td><td>An iron tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1137.png></td><td>1137</td><td>Poisoned Steel Spear</td><td>A steel tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1138.png></td><td>1138</td><td>Poisoned Mithril Spear</td><td>A mithril tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1139.png></td><td>1139</td><td>Poisoned Adamantite Spear</td><td>An adamantite tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1140.png></td><td>1140</td><td>Poisoned Rune Spear</td><td>A rune tipped spear with added venom</td><td>X</td><td>-</td></tr> <tr><td><1141.png></td><td>1141</td><td>Book of experimental chemistry</td><td>A book on experiments with volatile chemicals</td><td>-</td><td>-</td></tr> <tr><td><1142.png></td><td>1142</td><td>Level 1 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1143.png></td><td>1143</td><td>Level 2 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1144.png></td><td>1144</td><td>Level 3 Certificate</td><td>A Certificate of education</td><td>-</td><td>-</td></tr> <tr><td><1145.png></td><td>1145</td><td>Trowel</td><td>A small device for digging</td><td>-</td><td>-</td></tr> <tr><td><1146.png></td><td>1146</td><td>Stamped letter of recommendation</td><td>A stamped scroll with a recommendation on it</td><td>-</td><td>-</td></tr> <tr><td><1147.png></td><td>1147</td><td>Unstamped letter of recommendation</td><td>I hereby recommend this student to undertake the Varrock City earth sciences exams</td><td>-</td><td>-</td></tr> <tr><td><1148.png></td><td>1148</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1149.png></td><td>1149</td><td>Rock Sample</td><td>A rock sample</td><td>-</td><td>-</td></tr> <tr><td><1150.png></td><td>1150</td><td>Cracked rock Sample</td><td>It's been cracked open</td><td>-</td><td>-</td></tr> <tr><td><1151.png></td><td>1151</td><td>Belt buckle</td><td>been here some time</td><td>-</td><td>-</td></tr> <tr><td><1152.png></td><td>1152</td><td>Powering crystal2</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1153.png></td><td>1153</td><td>Powering crystal3</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1154.png></td><td>1154</td><td>Powering crystal4</td><td>An intricately cut gemstone</td><td>-</td><td>-</td></tr> <tr><td><1155.png></td><td>1155</td><td>Old boot</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1156.png></td><td>1156</td><td>Bunny ears</td><td>Get another from the clothes shop if you die</td><td>X</td><td>-</td></tr> <tr><td><1157.png></td><td>1157</td><td>Damaged armour</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1158.png></td><td>1158</td><td>Damaged armour</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1159.png></td><td>1159</td><td>Rusty sword</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1160.png></td><td>1160</td><td>Ammonium Nitrate</td><td>An acrid chemical</td><td>-</td><td>-</td></tr> <tr><td><1161.png></td><td>1161</td><td>Nitroglycerin</td><td>A strong acidic formula</td><td>-</td><td>-</td></tr> <tr><td><1162.png></td><td>1162</td><td>Old tooth</td><td>a large single tooth</td><td>-</td><td>-</td></tr> tr><td><1163.png></td><td>1163</td><td>Radimus Scrolls</td><td>Scrolls that Radimus gave you</td><td>-</td><td>-</td></tr> <tr><td><1164.png></td><td>1164</td><td>chest key</td><td>A small key for a chest</td><td>-</td><td>-</td></tr> <tr><td><1165.png></td><td>1165</td><td>broken arrow</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1166.png></td><td>1166</td><td>buttons</td><td>they've been here some time</td><td>-</td><td>-</td></tr> <tr><td><1167.png></td><td>1167</td><td>broken staff</td><td>that's been here some time</td><td>-</td><td>-</td></tr> <tr><td><1168.png></td><td>1168</td><td>vase</td><td>An old vase</td><td>-</td><td>-</td></tr> <tr><td><1169.png></td><td>1169</td><td>ceramic remains</td><td>some ancient pottery</td><td>-</td><td>-</td></tr> <tr><td><1170.png></td><td>1170</td><td>Broken glass</td><td>smashed glass</td><td>-</td><td>-</td></tr> <tr><td><1171.png></td><td>1171</td><td>Unidentified powder</td><td>who knows what this is for?</td><td>-</td><td>-</td></tr> <tr><td><1172.png></td><td>1172</td><td>Machette</td><td>A purpose built tool for cutting through thick jungle.</td><td>X</td><td>-</td></tr> <tr><td><1173.png></td><td>1173</td><td>Scroll</td><td>A letter written by the expert</td><td>-</td><td>-</td></tr> <tr><td><1174.png></td><td>1174</td><td>stone tablet</td><td>some ancient script is engraved on here</td><td>-</td><td>-</td></tr> <tr><td><1175.png></td><td>1175</td><td>Talisman of Zaros</td><td>an ancient item</td><td>-</td><td>-</td></tr> <tr><td><1176.png></td><td>1176</td><td>Explosive compound</td><td>A dark mystical powder</td><td>-</td><td>-</td></tr> <tr><td><1177.png></td><td>1177</td><td>Bull Roarer</td><td>A sound producing instrument - it may attract attention</td><td>-</td><td>-</td></tr> <tr><td><1178.png></td><td>1178</td><td>Mixed chemicals</td><td>A pungent mix of 2 chemicals</td><td>-</td><td>-</td></tr> <tr><td><1179.png></td><td>1179</td><td>Ground charcoal</td><td>Powdered charcoal!</td><td>-</td><td>-</td></tr> <tr><td><1180.png></td><td>1180</td><td>Mixed chemicals</td><td>A pungent mix of 3 chemicals</td><td>-</td><td>-</td></tr> <tr><td><1181.png></td><td>1181</td><td>Spell scroll</td><td>A magical scroll</td><td>-</td><td>-</td></tr> <tr><td><1182.png></td><td>1182</td><td>Yommi tree seed</td><td>A magical seed that grows into a Yommi tree - these need to be germinated</td><td>-</td><td>X</td></tr> <tr><td><1183.png></td><td>1183</td><td>Totem Pole</td><td>A well crafted totem pole</td><td>-</td><td>-</td></tr> <tr><td><1184.png></td><td>1184</td><td>Dwarf cannon base</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1185.png></td><td>1185</td><td>Dwarf cannon stand</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1186.png></td><td>1186</td><td>Dwarf cannon barrels</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1187.png></td><td>1187</td><td>Dwarf cannon furnace</td><td>bang</td><td>-</td><td>-</td></tr> <tr><td><1188.png></td><td>1188</td><td>Golden Bowl</td><td>A specially made bowl constructed out of pure gold</td><td>-</td><td>-</td></tr> <tr><td><1189.png></td><td>1189</td><td>Golden Bowl with pure water</td><td>A golden bowl filled with pure water</td><td>-</td><td>-</td></tr> <tr><td><1190.png></td><td>1190</td><td>Raw Manta ray</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1191.png></td><td>1191</td><td>Manta ray</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1192.png></td><td>1192</td><td>Raw Sea turtle</td><td>A rare catch!</td><td>-</td><td>-</td></tr> <tr><td><1193.png></td><td>1193</td><td>Sea turtle</td><td>Tasty!</td><td>-</td><td>-</td></tr> <tr><td><1194.png></td><td>1194</td><td>Annas Silver Necklace</td><td>A necklace coated with silver</td><td>X</td><td>-</td></tr> <tr><td><1195.png></td><td>1195</td><td>Bobs Silver Teacup</td><td>A tea cup coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1196.png></td><td>1196</td><td>Carols Silver Bottle</td><td>A little bottle coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1197.png></td><td>1197</td><td>Davids Silver Book</td><td>An ornamental book coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1198.png></td><td>1198</td><td>Elizabeths Silver Needle</td><td>An ornamental needle coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1199.png></td><td>1199</td><td>Franks Silver Pot</td><td>A small pot coated with silver</td><td>-</td><td>-</td></tr> <tr><td><1200.png></td><td>1200</td><td>Thread</td><td>A piece of red thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1201.png></td><td>1201</td><td>Thread</td><td>A piece of green thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1202.png></td><td>1202</td><td>Thread</td><td>A piece of blue thread discovered at the scene of the crime</td><td>-</td><td>-</td></tr> <tr><td><1203.png></td><td>1203</td><td>Flypaper</td><td>Sticky paper for catching flies</td><td>-</td><td>-</td></tr> <tr><td><1204.png></td><td>1204</td><td>Murder Scene Pot</td><td>The pot has a sickly smell of poison mixed with wine</td><td>-</td><td>-</td></tr> <tr><td><1205.png></td><td>1205</td><td>A Silver Dagger</td><td>Dagger Found at crime scene</td><td>X</td><td>-</td></tr> <tr><td><1206.png></td><td>1206</td><td>Murderers fingerprint</td><td>An impression of the murderers fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1207.png></td><td>1207</td><td>Annas fingerprint</td><td>An impression of Annas fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1208.png></td><td>1208</td><td>Bobs fingerprint</td><td>An impression of Bobs fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1209.png></td><td>1209</td><td>Carols fingerprint</td><td>An impression of Carols fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1210.png></td><td>1210</td><td>Davids fingerprint</td><td>An impression of Davids fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1211.png></td><td>1211</td><td>Elizabeths fingerprint</td><td>An impression of Elizabeths fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1212.png></td><td>1212</td><td>Franks fingerprint</td><td>An impression of Franks fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1213.png></td><td>1213</td><td>Zamorak Cape</td><td>A cape from the almighty zamorak</td><td>X</td><td>-</td></tr> <tr><td><1214.png></td><td>1214</td><td>Saradomin Cape</td><td>A cape from the almighty saradomin</td><td>X</td><td>-</td></tr> <tr><td><1215.png></td><td>1215</td><td>Guthix Cape</td><td>A cape from the almighty guthix</td><td>X</td><td>-</td></tr> <tr><td><1216.png></td><td>1216</td><td>Staff of zamorak</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1217.png></td><td>1217</td><td>Staff of guthix</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1218.png></td><td>1218</td><td>Staff of Saradomin</td><td>It's a stick of the gods</td><td>X</td><td>-</td></tr> <tr><td><1219.png></td><td>1219</td><td>A chunk of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1220.png></td><td>1220</td><td>A lump of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1221.png></td><td>1221</td><td>A hunk of crystal</td><td>A reddish crystal fragment - it looks like it formed a shape at one time.</td><td>-</td><td>-</td></tr> <tr><td><1222.png></td><td>1222</td><td>A red crystal</td><td>A heart shaped red crystal </td><td>-</td><td>-</td></tr> <tr><td><1223.png></td><td>1223</td><td>Unidentified fingerprint</td><td>An impression of the murderers fingerprint</td><td>-</td><td>-</td></tr> <tr><td><1224.png></td><td>1224</td><td>Annas Silver Necklace</td><td>A silver necklace coated with flour</td><td>X</td><td>-</td></tr> <tr><td><1225.png></td><td>1225</td><td>Bobs Silver Teacup</td><td>A silver tea cup coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1226.png></td><td>1226</td><td>Carols Silver Bottle</td><td>A little silver bottle coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1227.png></td><td>1227</td><td>Davids Silver Book</td><td>An ornamental silver book coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1228.png></td><td>1228</td><td>Elizabeths Silver Needle</td><td>An ornamental silver needle coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1229.png></td><td>1229</td><td>Franks Silver Pot</td><td>A small silver pot coated with flour</td><td>-</td><td>-</td></tr> <tr><td><1230.png></td><td>1230</td><td>A Silver Dagger</td><td>Dagger Found at crime scene coated with flour</td><td>X</td><td>-</td></tr> <tr><td><1231.png></td><td>1231</td><td>A glowing red crystal</td><td>A glowing heart shaped red crystal - great magic must be present in this item</td><td>-</td><td>-</td></tr> <tr><td><1232.png></td><td>1232</td><td>Unidentified liquid</td><td>A strong acidic formula</td><td>-</td><td>-</td></tr> <tr><td><1233.png></td><td>1233</td><td>Radimus Scrolls</td><td>Mission briefing and the completed map of Karamja - Sir Radimus will be pleased...</td><td>-</td><td>-</td></tr> <tr><td><1234.png></td><td>1234</td><td>Robe</td><td>A worn robe</td><td>X</td><td>-</td></tr> <tr><td><1235.png></td><td>1235</td><td>Armour</td><td>An unusually red armour</td><td>-</td><td>-</td></tr> <tr><td><1236.png></td><td>1236</td><td>Dagger</td><td>Short but pointy</td><td>X</td><td>-</td></tr> <tr><td><1237.png></td><td>1237</td><td>eye patch</td><td>It makes me look very piratical</td><td>X</td><td>-</td></tr> <tr><td><1238.png></td><td>1238</td><td>Booking of Binding</td><td>An ancient tome on Demonology</td><td>-</td><td>-</td></tr> <tr><td><1239.png></td><td>1239</td><td>Holy Water Vial</td><td>A deadly potion against evil kin</td><td>X</td><td>-</td></tr> <tr><td><1240.png></td><td>1240</td><td>Enchanted Vial</td><td>This enchanted vial is empty - but is ready for magical liquids.</td><td>-</td><td>-</td></tr> <tr><td><1241.png></td><td>1241</td><td>Scribbled notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1242.png></td><td>1242</td><td>Scrawled notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1243.png></td><td>1243</td><td>Scatched notes</td><td>It looks like a page ripped from a book</td><td>-</td><td>-</td></tr> <tr><td><1244.png></td><td>1244</td><td>Shamans Tome</td><td>An ancient tome on various subjects...</td><td>-</td><td>-</td></tr> <tr><td><1245.png></td><td>1245</td><td>Edible seaweed</td><td>slightly damp seaweed</td><td>-</td><td>-</td></tr> <tr><td><1246.png></td><td>1246</td><td>Rough Sketch of a bowl</td><td>A roughly sketched picture of a bowl made from metal</td><td>-</td><td>-</td></tr> <tr><td><1247.png></td><td>1247</td><td>Burnt Manta ray</td><td>oops!</td><td>-</td><td>-</td></tr> <tr><td><1248.png></td><td>1248</td><td>Burnt Sea turtle</td><td>oops!</td><td>-</td><td>-</td></tr> <tr><td><1249.png></td><td>1249</td><td>Cut reed plant</td><td>A narrow long tube - it might be useful for something</td><td>-</td><td>-</td></tr> <tr><td><1250.png></td><td>1250</td><td>Magical Fire Pass</td><td>A pass which allows you to cross the flaming walls into the Flaming Octagon</td><td>-</td><td>-</td></tr> <tr><td><1251.png></td><td>1251</td><td>Snakes Weed Solution</td><td>Snakes weed in water - part of a potion</td><td>-</td><td>-</td></tr> <tr><td><1252.png></td><td>1252</td><td>Ardrigal Solution</td><td>Ardrigal herb in water - part of a potion</td><td>-</td><td>-</td></tr> <tr><td><1253.png></td><td>1253</td><td>Gujuo Potion</td><td>A potion to help against fear of the supernatural</td><td>-</td><td>-</td></tr> <tr><td><1254.png></td><td>1254</td><td>Germinated Yommi tree seed</td><td>A magical seed that grows into a Yommi tree - these have been germinated.</td><td>-</td><td>X</td></tr> <tr><td><1255.png></td><td>1255</td><td>Dark Dagger</td><td>An unusual looking dagger made of dark shiny obsidian</td><td>X</td><td>-</td></tr> <tr><td><1256.png></td><td>1256</td><td>Glowing Dark Dagger</td><td>An unusual looking dagger made of dark shiny obsidian - it has an unnatural glow .</td><td>X</td><td>-</td></tr> <tr><td><1257.png></td><td>1257</td><td>Holy Force Spell</td><td>A powerful incantation - it affects spirits of the underworld</td><td>-</td><td>-</td></tr> <tr><td><1258.png></td><td>1258</td><td>Iron Pickaxe</td><td>Used for mining</td><td>-</td><td>-</td></tr> <tr><td><1259.png></td><td>1259</td><td>Steel Pickaxe</td><td>Requires level 6 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1260.png></td><td>1260</td><td>Mithril Pickaxe</td><td>Requires level 21 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1261.png></td><td>1261</td><td>Adamantite Pickaxe</td><td>Requires level 31 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1262.png></td><td>1262</td><td>Rune Pickaxe</td><td>Requires level 41 mining to use</td><td>-</td><td>-</td></tr> <tr><td><1263.png></td><td>1263</td><td>Sleeping Bag</td><td>Not as comfy as a bed but better than nothing</td><td>-</td><td>-</td></tr> <tr><td><1264.png></td><td>1264</td><td>A blue wizards hat</td><td>An ancient wizards hat.</td><td>X</td><td>-</td></tr> <tr><td><1265.png></td><td>1265</td><td>Gilded Totem Pole</td><td>A well crafted totem pole - given to you as a gift from Gujuo</td><td>-</td><td>-</td></tr> <tr><td><1266.png></td><td>1266</td><td>Blessed Golden Bowl</td><td>A specially made bowl constructed out of pure gold - it looks magical somehow</td><td>-</td><td>-</td></tr> <tr><td><1267.png></td><td>1267</td><td>Blessed Golden Bowl with Pure Water</td><td>A golden bowl filled with pure water - it looks magical somehow</td><td>-</td><td>-</td></tr> <tr><td><1268.png></td><td>1268</td><td>Raw Oomlie Meat</td><td>Raw meat from the Oomlie bird</td><td>-</td><td>-</td></tr> <tr><td><1269.png></td><td>1269</td><td>Cooked Oomlie meat Parcel</td><td>Deliciously cooked Oomlie meat in a palm leaf pouch.</td><td>-</td><td>-</td></tr> <tr><td><1270.png></td><td>1270</td><td>Dragon Bone Certificate</td><td>Each certificate exchangable at Yanille for 5 Dragon Bones</td><td>-</td><td>X</td></tr> <tr><td><1271.png></td><td>1271</td><td>Limpwurt Root Certificate</td><td>Each certificate exchangable at Yanille for 5 Limpwort roots</td><td>-</td><td>X</td></tr> <tr><td><1272.png></td><td>1272</td><td>Prayer Potion Certificate</td><td>Each certificate exchangable at Yanille for 5 prayer potions</td><td>-</td><td>X</td></tr> <tr><td><1273.png></td><td>1273</td><td>Super Attack Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1274.png></td><td>1274</td><td>Super Defense Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1275.png></td><td>1275</td><td>Super Strength Potion Certificate</td><td>Exchangable at Yanille for 5</td><td>-</td><td>X</td></tr> <tr><td><1276.png></td><td>1276</td><td>Half Dragon Square Shield</td><td>The Right Half of an ancient and powerful looking Dragon Square shield.</td><td>-</td><td>-</td></tr> <tr><td><1277.png></td><td>1277</td><td>Half Dragon Square Shield</td><td>Left Half of an ancient and powerful looking Dragon Square shield.</td><td>-</td><td>-</td></tr> <tr><td><1278.png></td><td>1278</td><td>Dragon Square Shield</td><td>An ancient and powerful looking Dragon Square shield.</td><td>X</td><td>-</td></tr> <tr><td><1279.png></td><td>1279</td><td>Palm tree leaf</td><td>A thick green plam leaf - natives use this to cook meat in</td><td>-</td><td>-</td></tr> <tr><td><1280.png></td><td>1280</td><td>Raw Oomlie Meat Parcel</td><td>Oomlie meat in a palm leaf pouch - just needs to be cooked.</td><td>-</td><td>-</td></tr> <tr><td><1281.png></td><td>1281</td><td>Burnt Oomlie Meat parcel</td><td>Oomlie meat in a palm leaf pouch - it's burnt.</td><td>-</td><td>-</td></tr> <tr><td><1282.png></td><td>1282</td><td>Bailing Bucket</td><td>It's a water tight bucket</td><td>-</td><td>-</td></tr> <tr><td><1283.png></td><td>1283</td><td>Plank</td><td>Damaged remains of the ship</td><td>-</td><td>-</td></tr> <tr><td><1284.png></td><td>1284</td><td>Arcenia root</td><td>the root of an arcenia plant</td><td>-</td><td>-</td></tr> <tr><td><1285.png></td><td>1285</td><td>display tea</td><td>A nice cup of tea - for display only</td><td>-</td><td>-</td></tr> <tr><td><1286.png></td><td>1286</td><td>Blessed Golden Bowl with plain water</td><td>A golden bowl filled with plain water</td><td>-</td><td>-</td></tr> <tr><td><1287.png></td><td>1287</td><td>Golden Bowl with plain water</td><td>A golden bowl filled with plain water</td><td>-</td><td>-</td></tr> <tr><td><1288.png></td><td>1288</td><td>Cape of legends</td><td>Shows I am a member of the legends guild</td><td>X</td><td>-</td></tr> <tr><td><1289.png></td><td>1289</td><td>Scythe</td><td>Get another from the clothes shop if you die</td><td>X</td><td>-</td></tr> </table> 204 NPCs 0 22 7nudw6mhcw7rgd96n2owm8hfibn5g6r 102 2011-06-20T04:31:33Z Admin 1 Created page with "<table border="1" cellpadding="3" cellspacing="3"> <tr><td><b>id</b></td><td><b>npc name</b></td><td><b>level</b></td><td><b>description</b></td><td><b>attackable</b></td></tr> ..." <table border="1" cellpadding="3" cellspacing="3"> <tr><td><b>id</b></td><td><b>npc name</b></td><td><b>level</b></td><td><b>description</b></td><td><b>attackable</b></td></tr> <tr><td>0</td><td>Unicorn</td><td>21</td><td>It's a unicorn</td><td>X</td></tr> <tr><td>1</td><td>Bob</td><td>2</td><td>An axe seller</td><td>-</td></tr> <tr><td>2</td><td>Sheep</td><td>0</td><td>A very wooly sheep</td><td>-</td></tr> <tr><td>3</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>X</td></tr> <tr><td>4</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>5</td><td>Hans</td><td>3</td><td>A castle servant</td><td>X</td></tr> <tr><td>6</td><td>cow</td><td>8</td><td>It's a multi purpose cow</td><td>X</td></tr> <tr><td>7</td><td>cook</td><td>15</td><td>The head cook of Lumbridge castle</td><td>-</td></tr> <tr><td>8</td><td>Bear</td><td>24</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>9</td><td>Priest</td><td>0</td><td>A priest of Saradomin</td><td>-</td></tr> <tr><td>10</td><td>Urhney</td><td>8</td><td>He looks a little grumpy</td><td>-</td></tr> <tr><td>11</td><td>Man</td><td>9</td><td>One of runescapes many citizens</td><td>X</td></tr> <tr><td>12</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>13</td><td>Camel</td><td>0</td><td>Oh its a camel</td><td>-</td></tr> <tr><td>14</td><td>Gypsy</td><td>0</td><td>An old gypsy lady</td><td>-</td></tr> <tr><td>15</td><td>Ghost</td><td>12</td><td>Ooh spooky</td><td>-</td></tr> <tr><td>16</td><td>Sir Prysin</td><td>40</td><td>One of the king's knights</td><td>-</td></tr> <tr><td>17</td><td>Traiborn the wizard</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>18</td><td>Captain Rovin</td><td>51</td><td>The head of the palace guard</td><td>-</td></tr> <tr><td>19</td><td>Rat</td><td>8</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>20</td><td>Reldo</td><td>12</td><td>I think he's the librarian</td><td>-</td></tr> <tr><td>21</td><td>mugger</td><td>10</td><td>He jumps out and attacks people</td><td>X</td></tr> <tr><td>22</td><td>Lesser Demon</td><td>79</td><td>Lesser but still pretty big</td><td>X</td></tr> <tr><td>23</td><td>Giant Spider</td><td>8</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>24</td><td>Man</td><td>30</td><td>A shifty looking man</td><td>-</td></tr> <tr><td>25</td><td>Jonny the beard</td><td>10</td><td>I can see why he's called the beard</td><td>X</td></tr> <tr><td>26</td><td>Baraek</td><td>30</td><td>A fur trader</td><td>-</td></tr> <tr><td>27</td><td>Katrine</td><td>25</td><td>She doesn't look to friendly</td><td>-</td></tr> <tr><td>28</td><td>Tramp</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>29</td><td>Rat</td><td>2</td><td>A small muddy rat</td><td>X</td></tr> <tr><td>30</td><td>Romeo</td><td>45</td><td>He looks mildly confused</td><td>-</td></tr> <tr><td>31</td><td>Juliet</td><td>2</td><td>She looks a little stressed</td><td>-</td></tr> <tr><td>32</td><td>Father Lawrence</td><td>0</td><td>A kindly looking priest</td><td>-</td></tr> <tr><td>33</td><td>Apothecary</td><td>6</td><td>I wonder if he has any good potions</td><td>-</td></tr> <tr><td>34</td><td>spider</td><td>2</td><td>Incey wincey</td><td>X</td></tr> <tr><td>35</td><td>Delrith</td><td>30</td><td>A freshly summoned demon</td><td>X</td></tr> <tr><td>36</td><td>Veronica</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>37</td><td>Weaponsmaster</td><td>25</td><td>The phoenix gang quartermaster</td><td>X</td></tr> <tr><td>38</td><td>Professor Oddenstein</td><td>4</td><td>A mad scientist if I ever saw one</td><td>-</td></tr> <tr><td>39</td><td>Curator</td><td>2</td><td>He looks like he's daydreaming</td><td>-</td></tr> <tr><td>40</td><td>skeleton</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>41</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>42</td><td>king</td><td>30</td><td>King Roald the VIII</td><td>-</td></tr> <tr><td>43</td><td>Giant bat</td><td>32</td><td>An angry flying rodent</td><td>X</td></tr> <tr><td>44</td><td>Bartender</td><td>0</td><td>A friendly barman</td><td>-</td></tr> <tr><td>45</td><td>skeleton</td><td>31</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>46</td><td>skeleton</td><td>25</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>47</td><td>Rat</td><td>13</td><td>overgrown vermin</td><td>X</td></tr> <tr><td>48</td><td>Horvik the Armourer</td><td>16</td><td>He looks strong</td><td>-</td></tr> <tr><td>49</td><td>Bear</td><td>0</td><td>A bear</td><td>-</td></tr> <tr><td>50</td><td>skeleton</td><td>19</td><td>It rattles when it walks</td><td>X</td></tr> <tr><td>51</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>52</td><td>zombie</td><td>19</td><td>The living dead</td><td>X</td></tr> <tr><td>53</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>54</td><td>Aubury</td><td>0</td><td>I think he might be a shop keeper</td><td>-</td></tr> <tr><td>55</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>56</td><td>shopkeeper</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>57</td><td>Darkwizard</td><td>13</td><td>He works evil magic</td><td>X</td></tr> <tr><td>58</td><td>lowe</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>59</td><td>Thessalia</td><td>0</td><td>A young shop assistant</td><td>-</td></tr> <tr><td>60</td><td>Darkwizard</td><td>25</td><td>He works evil magic</td><td>X</td></tr> <tr><td>61</td><td>Giant</td><td>37</td><td>A very large foe</td><td>X</td></tr> <tr><td>62</td><td>Goblin</td><td>7</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>63</td><td>farmer</td><td>15</td><td>He grows the crops in this area</td><td>X</td></tr> <tr><td>64</td><td>Thief</td><td>21</td><td>He'll take anything that isn't nailed down</td><td>X</td></tr> <tr><td>65</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>X</td></tr> <tr><td>66</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>67</td><td>Hobgoblin</td><td>32</td><td>A large ugly green creature</td><td>X</td></tr> <tr><td>68</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>69</td><td>Zaff</td><td>0</td><td>He trades in staffs</td><td>-</td></tr> <tr><td>70</td><td>Scorpion</td><td>21</td><td>An extremely vicious scorpion</td><td>X</td></tr> <tr><td>71</td><td>silk trader</td><td>0</td><td>He sells silk</td><td>-</td></tr> <tr><td>72</td><td>Man</td><td>9</td><td>One of Runescapes many citizens</td><td>X</td></tr> <tr><td>73</td><td>Guide</td><td>1</td><td>He gives hints to new adventurers</td><td>-</td></tr> <tr><td>74</td><td>Giant Spider</td><td>31</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>75</td><td>Peksa</td><td>9</td><td>A helmet salesman</td><td>-</td></tr> <tr><td>76</td><td>Barbarian</td><td>16</td><td>Not civilised looking</td><td>X</td></tr> <tr><td>77</td><td>Fred the farmer</td><td>9</td><td>An old farmer</td><td>-</td></tr> <tr><td>78</td><td>Gunthor the Brave</td><td>37</td><td>The barbarians fearless leader</td><td>X</td></tr> <tr><td>79</td><td>Witch</td><td>25</td><td>She's got warts</td><td>X</td></tr> <tr><td>80</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>81</td><td>Wizard</td><td>16</td><td>An old wizard</td><td>X</td></tr> <tr><td>82</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>83</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>84</td><td>Zeke</td><td>0</td><td>He sells Scimitars</td><td>-</td></tr> <tr><td>85</td><td>Louie Legs</td><td>0</td><td>He might want to sell something</td><td>-</td></tr> <tr><td>86</td><td>Warrior</td><td>18</td><td>A member of Al Kharid's military</td><td>X</td></tr> <tr><td>87</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>88</td><td>Shop Assistant</td><td>0</td><td>Maybe she'd like to buy some of my junk</td><td>-</td></tr> <tr><td>89</td><td>Highwayman</td><td>13</td><td>He holds up passers by</td><td>X</td></tr> <tr><td>90</td><td>Kebab Seller</td><td>0</td><td>A seller of strange food</td><td>-</td></tr> <tr><td>91</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>-</td></tr> <tr><td>92</td><td>Ernest</td><td>3</td><td>A former chicken</td><td>-</td></tr> <tr><td>93</td><td>Monk</td><td>13</td><td>A Peaceful monk</td><td>X</td></tr> <tr><td>94</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>95</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>96</td><td>Count Draynor</td><td>43</td><td>A vicious vampire</td><td>X</td></tr> <tr><td>97</td><td>Morgan</td><td>9</td><td>A frigtened villager</td><td>-</td></tr> <tr><td>98</td><td>Dr Harlow</td><td>9</td><td>His nose is very red</td><td>-</td></tr> <tr><td>99</td><td>Deadly Red spider</td><td>36</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>100</td><td>Guard</td><td>28</td><td>He's here to guard this fortress</td><td>X</td></tr> <tr><td>101</td><td>Cassie</td><td>25</td><td>She sells shields</td><td>-</td></tr> <tr><td>102</td><td>White Knight</td><td>56</td><td>A chivalrous knight</td><td>X</td></tr> <tr><td>103</td><td>Ranael</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>104</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>105</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>106</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>107</td><td>Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>108</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>109</td><td>Greldo</td><td>7</td><td>A small green warty creature</td><td>X</td></tr> <tr><td>110</td><td>Sir Amik Varze</td><td>56</td><td>The leader of the white knights</td><td>-</td></tr> <tr><td>111</td><td>Guildmaster</td><td>40</td><td>He's in charge of this place</td><td>-</td></tr> <tr><td>112</td><td>Valaine</td><td>25</td><td>She runs the champion's store</td><td>-</td></tr> <tr><td>113</td><td>Drogo</td><td>18</td><td>He runs a mining store</td><td>-</td></tr> <tr><td>114</td><td>Imp</td><td>5</td><td>A cheeky little imp</td><td>X</td></tr> <tr><td>115</td><td>Flynn</td><td>16</td><td>The mace salesman</td><td>-</td></tr> <tr><td>116</td><td>Wyson the gardener</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>117</td><td>Wizard Mizgog</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>118</td><td>Prince Ali</td><td>20</td><td>A young prince</td><td>-</td></tr> <tr><td>119</td><td>Hassan</td><td>20</td><td>the Chancellor to the emir</td><td>-</td></tr> <tr><td>120</td><td>Osman</td><td>20</td><td>He looks a little shifty</td><td>-</td></tr> <tr><td>121</td><td>Joe</td><td>40</td><td>Lady Keli's head guard</td><td>-</td></tr> <tr><td>122</td><td>Leela</td><td>20</td><td>She comes from Al Kharid</td><td>-</td></tr> <tr><td>123</td><td>Lady Keli</td><td>20</td><td>An Infamous bandit</td><td>-</td></tr> <tr><td>124</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>125</td><td>Aggie</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>126</td><td>Prince Ali</td><td>10</td><td>That is an effective disguise</td><td>-</td></tr> <tr><td>127</td><td>Jailguard</td><td>34</td><td>I wonder what he's guarding</td><td>X</td></tr> <tr><td>128</td><td>Redbeard Frank</td><td>25</td><td>A pirate</td><td>-</td></tr> <tr><td>129</td><td>Wydin</td><td>0</td><td>A grocer</td><td>-</td></tr> <tr><td>130</td><td>shop assistant</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>131</td><td>Brian</td><td>0</td><td>An axe seller</td><td>-</td></tr> <tr><td>132</td><td>squire</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>133</td><td>Head chef</td><td>15</td><td>He looks after the chef's guild</td><td>-</td></tr> <tr><td>134</td><td>Thurgo</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>135</td><td>Ice Giant</td><td>68</td><td>He's got icicles in his beard</td><td>X</td></tr> <tr><td>136</td><td>King Scorpion</td><td>36</td><td>Wow scorpions shouldn't grow that big</td><td>X</td></tr> <tr><td>137</td><td>Pirate</td><td>27</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>138</td><td>Sir Vyvin</td><td>56</td><td>One of the white knights of Falador</td><td>-</td></tr> <tr><td>139</td><td>Monk of Zamorak</td><td>29</td><td>An evil cleric</td><td>X</td></tr> <tr><td>140</td><td>Monk of Zamorak</td><td>19</td><td>An evil cleric</td><td>X</td></tr> <tr><td>141</td><td>Wayne</td><td>16</td><td>An armourer</td><td>-</td></tr> <tr><td>142</td><td>Barmaid</td><td>25</td><td>a pretty barmaid</td><td>-</td></tr> <tr><td>143</td><td>Dwarven shopkeeper</td><td>18</td><td>I wonder if he wants to buy any of my junk</td><td>-</td></tr> <tr><td>144</td><td>Doric</td><td>18</td><td>A dwarven smith</td><td>-</td></tr> <tr><td>145</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>146</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>147</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>148</td><td>Hetty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>149</td><td>Betty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>150</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>151</td><td>General wartface</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>152</td><td>General Bentnoze</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>153</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>154</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>155</td><td>Herquin</td><td>0</td><td>A gem merchant</td><td>-</td></tr> <tr><td>156</td><td>Rommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>157</td><td>Grum</td><td>0</td><td>Grum the goldsmith</td><td>-</td></tr> <tr><td>158</td><td>Ice warrior</td><td>57</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>159</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>160</td><td>Thrander</td><td>16</td><td>A smith of some sort</td><td>-</td></tr> <tr><td>161</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>162</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>163</td><td>Customs Officer</td><td>16</td><td>She is here to stop smugglers</td><td>-</td></tr> <tr><td>164</td><td>Luthas</td><td>16</td><td>The owner of the banana plantation</td><td>-</td></tr> <tr><td>165</td><td>Zambo</td><td>16</td><td>He will sell me exotic rum</td><td>-</td></tr> <tr><td>166</td><td>Captain Tobias</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>167</td><td>Gerrant</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>168</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>169</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>170</td><td>Seaman Lorris</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>171</td><td>Seaman Thresnor</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>172</td><td>Tanner</td><td>45</td><td>He makes leather</td><td>-</td></tr> <tr><td>173</td><td>Dommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>174</td><td>Abbot Langley</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>175</td><td>Thordur</td><td>18</td><td>He runs a a tourist attraction</td><td>-</td></tr> <tr><td>176</td><td>Brother Jered</td><td>13</td><td>human</td><td>-</td></tr> <tr><td>177</td><td>Rat</td><td>13</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>178</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>179</td><td>skeleton</td><td>31</td><td>it rattles when it walks</td><td>X</td></tr> <tr><td>180</td><td>zombie</td><td>32</td><td>the living dead</td><td>X</td></tr> <tr><td>181</td><td>Lesser Demon</td><td>79</td><td>Lesser but still very big</td><td>X</td></tr> <tr><td>182</td><td>Melzar the mad</td><td>45</td><td>He looks totally insane</td><td>X</td></tr> <tr><td>183</td><td>Scavvo</td><td>10</td><td>He has lopsided eyes</td><td>-</td></tr> <tr><td>184</td><td>Greater Demon</td><td>87</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>185</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>186</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>187</td><td>Oziach</td><td>0</td><td>A strange little man</td><td>-</td></tr> <tr><td>188</td><td>Bear</td><td>26</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>189</td><td>Black Knight</td><td>46</td><td>An armoured follower of Zamorak</td><td>X</td></tr> <tr><td>190</td><td>chaos Dwarf</td><td>59</td><td>a dwarf gone bad</td><td>X</td></tr> <tr><td>191</td><td>dwarf</td><td>18</td><td>A dwarf who looks after the mining guild</td><td>-</td></tr> <tr><td>192</td><td>Wormbrain</td><td>7</td><td>Dumb even by goblin standards</td><td>X</td></tr> <tr><td>193</td><td>Klarense</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>194</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>195</td><td>skeleton</td><td>54</td><td>A Taller than normal skeleton</td><td>X</td></tr> <tr><td>196</td><td>Dragon</td><td>110</td><td>A powerful and ancient dragon</td><td>X</td></tr> <tr><td>197</td><td>Oracle</td><td>57</td><td>A mystic of unknown race</td><td>-</td></tr> <tr><td>198</td><td>Duke of Lumbridge</td><td>30</td><td>Duke Horacio of Lumbridge</td><td>-</td></tr> <tr><td>199</td><td>Dark Warrior</td><td>21</td><td>A warrior touched by chaos</td><td>X</td></tr> <tr><td>200</td><td>Druid</td><td>29</td><td>A worshipper of Guthix</td><td>X</td></tr> <tr><td>201</td><td>Red Dragon</td><td>140</td><td>A big powerful dragon</td><td>X</td></tr> <tr><td>202</td><td>Blue Dragon</td><td>105</td><td>A mother dragon</td><td>X</td></tr> <tr><td>203</td><td>Baby Blue Dragon</td><td>50</td><td>Young but still dangerous</td><td>X</td></tr> <tr><td>204</td><td>Kaqemeex</td><td>29</td><td>A wise druid</td><td>-</td></tr> <tr><td>205</td><td>Sanfew</td><td>29</td><td>An old druid</td><td>-</td></tr> <tr><td>206</td><td>Suit of armour</td><td>29</td><td>A dusty old suit of armour</td><td>-</td></tr> <tr><td>207</td><td>Adventurer</td><td>13</td><td>A cleric</td><td>-</td></tr> <tr><td>208</td><td>Adventurer</td><td>12</td><td>A wizard</td><td>-</td></tr> <tr><td>209</td><td>Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>210</td><td>Adventurer</td><td>25</td><td>An archer</td><td>-</td></tr> <tr><td>211</td><td>Leprechaun</td><td>18</td><td>A funny little man who lives in a tree</td><td>-</td></tr> <tr><td>212</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>213</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>214</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>215</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>216</td><td>tree spirit</td><td>95</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>217</td><td>cow</td><td>8</td><td>It's a dairy cow</td><td>-</td></tr> <tr><td>218</td><td>Irksol</td><td>2</td><td>Is he invisible or just a set of floating clothes?</td><td>-</td></tr> <tr><td>219</td><td>Fairy Lunderwin</td><td>2</td><td>A fairy merchant</td><td>-</td></tr> <tr><td>220</td><td>Jakut</td><td>2</td><td>An unusual looking merchant</td><td>-</td></tr> <tr><td>221</td><td>Doorman</td><td>56</td><td>He guards the entrance to the faerie market</td><td>-</td></tr> <tr><td>222</td><td>Fairy Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>223</td><td>Fairy Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>224</td><td>Fairy banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>225</td><td>Giles</td><td>30</td><td>He runs an ore exchange store</td><td>-</td></tr> <tr><td>226</td><td>Miles</td><td>30</td><td>He runs a bar exchange store</td><td>-</td></tr> <tr><td>227</td><td>Niles</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>228</td><td>Gaius</td><td>16</td><td>he sells very big swords</td><td>-</td></tr> <tr><td>229</td><td>Fairy Ladder attendant</td><td>0</td><td>A worker in the faerie market</td><td>-</td></tr> <tr><td>230</td><td>Jatix</td><td>29</td><td>A hard working druid</td><td>-</td></tr> <tr><td>231</td><td>Master Crafter</td><td>0</td><td>The man in charge of the crafter's guild</td><td>-</td></tr> <tr><td>232</td><td>Bandit</td><td>29</td><td>He's ready for a fight</td><td>X</td></tr> <tr><td>233</td><td>Noterazzo</td><td>29</td><td>A bandit shopkeeper</td><td>-</td></tr> <tr><td>234</td><td>Bandit</td><td>29</td><td>A wilderness outlaw</td><td>X</td></tr> <tr><td>235</td><td>Fat Tony</td><td>15</td><td>A Gourmet Pizza chef</td><td>-</td></tr> <tr><td>236</td><td>Donny the lad</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>237</td><td>Black Heather</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>238</td><td>Speedy Keith</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>239</td><td>White wolf sentry</td><td>31</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>240</td><td>Boy</td><td>39</td><td>He doesn't seem very happy</td><td>-</td></tr> <tr><td>241</td><td>Rat</td><td>2</td><td>He seems to live here</td><td>-</td></tr> <tr><td>242</td><td>Nora T Hag</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>243</td><td>Grey wolf</td><td>64</td><td>A sinister looking wolf</td><td>X</td></tr> <tr><td>244</td><td>shapeshifter</td><td>24</td><td>I've not seen anyone like this before</td><td>X</td></tr> <tr><td>245</td><td>shapeshifter</td><td>34</td><td>I think this spider has been genetically modified</td><td>-</td></tr> <tr><td>246</td><td>shapeshifter</td><td>44</td><td>Eek! A bear!</td><td>-</td></tr> <tr><td>247</td><td>shapeshifter</td><td>54</td><td>A sinister looking wolf</td><td>-</td></tr> <tr><td>248</td><td>White wolf</td><td>41</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>249</td><td>Pack leader</td><td>71</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>250</td><td>Harry</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>251</td><td>Thug</td><td>18</td><td>He likes hitting things</td><td>X</td></tr> <tr><td>252</td><td>Firebird</td><td>6</td><td>Probably not a chicken</td><td>X</td></tr> <tr><td>253</td><td>Achetties</td><td>46</td><td>One of Asgarnia's greatest heros</td><td>-</td></tr> <tr><td>254</td><td>Ice queen</td><td>103</td><td>The leader of the ice warriors</td><td>X</td></tr> <tr><td>255</td><td>Grubor</td><td>15</td><td>A rough looking thief</td><td>-</td></tr> <tr><td>256</td><td>Trobert</td><td>13</td><td>A well dressed thief</td><td>-</td></tr> <tr><td>257</td><td>Garv</td><td>28</td><td>A diligent guard</td><td>-</td></tr> <tr><td>258</td><td>guard</td><td>27</td><td>A vicious pirate</td><td>-</td></tr> <tr><td>259</td><td>Grip</td><td>46</td><td>Scar face petes head guard</td><td>X</td></tr> <tr><td>260</td><td>Alfonse the waiter</td><td>9</td><td>He should get a clean apron</td><td>-</td></tr> <tr><td>261</td><td>Charlie the cook</td><td>15</td><td>Head cook of the Shrimp and parrot</td><td>-</td></tr> <tr><td>262</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>X</td></tr> <tr><td>263</td><td>Ice spider</td><td>64</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>264</td><td>Pirate</td><td>30</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>265</td><td>Jailer</td><td>51</td><td>Guards prisoners for the black knights</td><td>X</td></tr> <tr><td>266</td><td>Lord Darquarius</td><td>76</td><td>A black knight commander</td><td>X</td></tr> <tr><td>267</td><td>Seth</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>268</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>269</td><td>Helemos</td><td>46</td><td>A retired hero</td><td>-</td></tr> <tr><td>270</td><td>Chaos Druid</td><td>19</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>271</td><td>Poison Scorpion</td><td>26</td><td>It has a very vicious looking tail</td><td>X</td></tr> <tr><td>272</td><td>Velrak the explorer</td><td>3</td><td>he looks cold and hungry</td><td>-</td></tr> <tr><td>273</td><td>Sir Lancelot</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>274</td><td>Sir Gawain</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>275</td><td>King Arthur</td><td>56</td><td>A wise old king</td><td>-</td></tr> <tr><td>276</td><td>Sir Mordred</td><td>58</td><td>An evil knight</td><td>X</td></tr> <tr><td>277</td><td>Renegade knight</td><td>51</td><td>He isn't very friendly</td><td>X</td></tr> <tr><td>278</td><td>Davon</td><td>27</td><td>An amulet trader</td><td>-</td></tr> <tr><td>279</td><td>Bartender</td><td>0</td><td>I could get some grog off him</td><td>-</td></tr> <tr><td>280</td><td>Arhein</td><td>0</td><td>A merchant</td><td>-</td></tr> <tr><td>281</td><td>Morgan le faye</td><td>25</td><td>An evil sorceress</td><td>-</td></tr> <tr><td>282</td><td>Candlemaker</td><td>16</td><td>He makes and sells candles</td><td>-</td></tr> <tr><td>283</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>284</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>285</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>286</td><td>Beggar</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>287</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>288</td><td>Thrantax</td><td>90</td><td>A freshly summoned demon</td><td>-</td></tr> <tr><td>289</td><td>Hickton</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>290</td><td>Black Demon</td><td>156</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>291</td><td>Black Dragon</td><td>200</td><td>A fierce dragon with black scales!</td><td>X</td></tr> <tr><td>292</td><td>Poison Spider</td><td>63</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>293</td><td>Monk of Zamorak</td><td>47</td><td>An evil cleric</td><td>X</td></tr> <tr><td>294</td><td>Hellhound</td><td>114</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>295</td><td>Animated axe</td><td>46</td><td>a magic axe with a mind of it's own</td><td>X</td></tr> <tr><td>296</td><td>Black Unicorn</td><td>31</td><td>It's a sort of unicorn</td><td>X</td></tr> <tr><td>297</td><td>Frincos</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>298</td><td>Otherworldly being</td><td>66</td><td>Is he invisible or just a set of floating clothes?</td><td>X</td></tr> <tr><td>299</td><td>Owen</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>300</td><td>Thormac the sorceror</td><td>25</td><td>A powerful sorcerrer</td><td>-</td></tr> <tr><td>301</td><td>Seer</td><td>16</td><td>An old wizard</td><td>-</td></tr> <tr><td>302</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>303</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>304</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>305</td><td>Barbarian guard</td><td>16</td><td>Not very civilised</td><td>-</td></tr> <tr><td>306</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>307</td><td>man</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>308</td><td>gem trader</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>309</td><td>Dimintheis</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>310</td><td>chef</td><td>15</td><td>A busy looking chef</td><td>-</td></tr> <tr><td>311</td><td>Hobgoblin</td><td>48</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>312</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>313</td><td>Boot the Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>314</td><td>Wizard</td><td>16</td><td>A young wizard</td><td>-</td></tr> <tr><td>315</td><td>Chronozon</td><td>121</td><td>Chronozon the blood demon</td><td>X</td></tr> <tr><td>316</td><td>Captain Barnaby</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>317</td><td>Customs Official</td><td>16</td><td>She's here to stop smugglers</td><td>-</td></tr> <tr><td>318</td><td>Man</td><td>9</td><td>One of Runescape's citizens</td><td>X</td></tr> <tr><td>319</td><td>farmer</td><td>15</td><td>An humble peasant</td><td>X</td></tr> <tr><td>320</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>321</td><td>Guard</td><td>28</td><td>He tries to keep the law and order around here</td><td>X</td></tr> <tr><td>322</td><td>Knight</td><td>56</td><td>A knight of Ardougne</td><td>X</td></tr> <tr><td>323</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>324</td><td>Hero</td><td>83</td><td>A Hero of Ardougne</td><td>X</td></tr> <tr><td>325</td><td>Baker</td><td>15</td><td>He sells hot baked bread</td><td>-</td></tr> <tr><td>326</td><td>silk merchant</td><td>0</td><td>He buys silk</td><td>-</td></tr> <tr><td>327</td><td>Fur trader</td><td>0</td><td>A buyer and seller of animal furs</td><td>-</td></tr> <tr><td>328</td><td>silver merchant</td><td>0</td><td>He deals in silver</td><td>-</td></tr> <tr><td>329</td><td>spice merchant</td><td>15</td><td>He sells exotic spices</td><td>-</td></tr> <tr><td>330</td><td>gem merchant</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>331</td><td>Zenesha</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>332</td><td>Kangai Mau</td><td>0</td><td>A tribesman</td><td>-</td></tr> <tr><td>333</td><td>Wizard Cromperty</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>334</td><td>RPDT employee</td><td>12</td><td>A delivery man</td><td>-</td></tr> <tr><td>335</td><td>Horacio</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>336</td><td>Aemad</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>337</td><td>Kortan</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>338</td><td>zoo keeper</td><td>20</td><td>He looks after Ardougne city zoo</td><td>X</td></tr> <tr><td>339</td><td>Make over mage</td><td>0</td><td>He can change how I look</td><td>-</td></tr> <tr><td>340</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>341</td><td>chuck</td><td>0</td><td>A wood merchant</td><td>-</td></tr> <tr><td>342</td><td>Rogue</td><td>21</td><td>He needs a shave</td><td>X</td></tr> <tr><td>343</td><td>Shadow spider</td><td>53</td><td>Is it a spider or is it a shadow</td><td>X</td></tr> <tr><td>344</td><td>Fire Giant</td><td>109</td><td>A big guy with red glowing skin</td><td>X</td></tr> <tr><td>345</td><td>Grandpa Jack</td><td>20</td><td>A wistful old man</td><td>-</td></tr> <tr><td>346</td><td>Sinister stranger</td><td>43</td><td>not your average fisherman</td><td>-</td></tr> <tr><td>347</td><td>Bonzo</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>348</td><td>Forester</td><td>21</td><td>He looks after McGrubor's wood</td><td>X</td></tr> <tr><td>349</td><td>Morris</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>350</td><td>Brother Omad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>351</td><td>Thief</td><td>21</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>352</td><td>Head Thief</td><td>34</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>353</td><td>Big Dave</td><td>15</td><td>A well built fisherman</td><td>-</td></tr> <tr><td>354</td><td>Joshua</td><td>15</td><td>A grumpy fisherman</td><td>-</td></tr> <tr><td>355</td><td>Mountain Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>356</td><td>Mountain Dwarf</td><td>28</td><td>A short angry guy</td><td>X</td></tr> <tr><td>357</td><td>Brother Cedric</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>358</td><td>Necromancer</td><td>34</td><td>A crazy evil necromancer</td><td>X</td></tr> <tr><td>359</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>360</td><td>Lucien</td><td>21</td><td>He walks with a slight limp</td><td>-</td></tr> <tr><td>361</td><td>The Fire warrior of lesarkus</td><td>63</td><td>A strange red humanoid</td><td>X</td></tr> <tr><td>362</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>363</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>364</td><td>Lucien</td><td>21</td><td>He walks with a limp</td><td>X</td></tr> <tr><td>365</td><td>winelda</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>366</td><td>Brother Kojo</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>367</td><td>Dungeon Rat</td><td>16</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>368</td><td>Master fisher</td><td>15</td><td>The man in charge of the fishing guild</td><td>-</td></tr> <tr><td>369</td><td>Orven</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>370</td><td>Padik</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>371</td><td>Shopkeeper</td><td>0</td><td>He smells of fish</td><td>-</td></tr> <tr><td>372</td><td>Lady servil</td><td>2</td><td>She look's wealthy</td><td>-</td></tr> <tr><td>373</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>374</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>375</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>376</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>377</td><td>Jeremy Servil</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>378</td><td>Justin Servil</td><td>0</td><td>Jeremy servil's father</td><td>-</td></tr> <tr><td>379</td><td>fightslave joe</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>380</td><td>fightslave kelvin</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>381</td><td>local</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>382</td><td>Khazard Bartender</td><td>0</td><td>A tough looking barman</td><td>-</td></tr> <tr><td>383</td><td>General Khazard</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>384</td><td>Khazard Ogre</td><td>58</td><td>Khazard's strongest ogre warrior</td><td>X</td></tr> <tr><td>385</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>386</td><td>Khazard Scorpion</td><td>46</td><td>A large angry scorpion</td><td>X</td></tr> <tr><td>387</td><td>hengrad</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>388</td><td>Bouncer</td><td>122</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>389</td><td>Stankers</td><td>0</td><td>A cheerful looking fellow</td><td>-</td></tr> <tr><td>390</td><td>Docky</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>391</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>392</td><td>Fairy queen</td><td>2</td><td>A very little queen</td><td>-</td></tr> <tr><td>393</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>394</td><td>Crone</td><td>25</td><td>A strange old lady</td><td>-</td></tr> <tr><td>395</td><td>High priest of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>396</td><td>elkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>397</td><td>remsai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>398</td><td>bolkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>399</td><td>local gnome</td><td>3</td><td>It's a young tree gnome</td><td>X</td></tr> <tr><td>400</td><td>bolren</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>401</td><td>Black Knight titan</td><td>146</td><td>He is blocking the way</td><td>X</td></tr> <tr><td>402</td><td>kalron</td><td>3</td><td>he look's lost</td><td>X</td></tr> <tr><td>403</td><td>brother Galahad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>404</td><td>tracker 1</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>405</td><td>tracker 2</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>406</td><td>tracker 3</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>407</td><td>Khazard troop</td><td>28</td><td>It's one of General Khazard's warrior's</td><td>X</td></tr> <tr><td>408</td><td>commander montai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>409</td><td>gnome troop</td><td>3</td><td>It's a tree gnome trooper</td><td>X</td></tr> <tr><td>410</td><td>khazard warlord</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>411</td><td>Sir Percival</td><td>56</td><td>He's covered in pieces of straw</td><td>-</td></tr> <tr><td>412</td><td>Fisher king</td><td>30</td><td>an old king</td><td>-</td></tr> <tr><td>413</td><td>maiden</td><td>2</td><td>She has a far away look in her eyes</td><td>-</td></tr> <tr><td>414</td><td>Fisherman</td><td>30</td><td>an old fisherman</td><td>-</td></tr> <tr><td>415</td><td>King Percival</td><td>56</td><td>The new fisher king</td><td>-</td></tr> <tr><td>416</td><td>unhappy peasant</td><td>25</td><td>He looks tired and hungry</td><td>X</td></tr> <tr><td>417</td><td>happy peasant</td><td>25</td><td>He looks well fed and full of energy</td><td>X</td></tr> <tr><td>418</td><td>ceril</td><td>9</td><td>It's Sir ceril carnillean a local noblemen</td><td>-</td></tr> <tr><td>419</td><td>butler</td><td>9</td><td>It's the carnillean family butler</td><td>-</td></tr> <tr><td>420</td><td>carnillean guard</td><td>28</td><td>It's a carnillean family guard</td><td>X</td></tr> <tr><td>421</td><td>Tribesman</td><td>39</td><td>A primative warrior</td><td>X</td></tr> <tr><td>422</td><td>henryeta</td><td>2</td><td>It's a wealthy looking woman</td><td>-</td></tr> <tr><td>423</td><td>philipe</td><td>0</td><td>It's a young well dressed boy</td><td>-</td></tr> <tr><td>424</td><td>clivet</td><td>20</td><td>A strange looking man in black </td><td>-</td></tr> <tr><td>425</td><td>cult member</td><td>20</td><td>An suspicous looking man in black </td><td>X</td></tr> <tr><td>426</td><td>Lord hazeel</td><td>100</td><td>He could do with some sun</td><td>X</td></tr> <tr><td>427</td><td>alomone</td><td>42</td><td>A musculer looking man in black </td><td>-</td></tr> <tr><td>428</td><td>Khazard commander</td><td>41</td><td>It's one of General Khazard's commander's</td><td>X</td></tr> <tr><td>429</td><td>claus</td><td>15</td><td>the carnillean family cook</td><td>-</td></tr> <tr><td>430</td><td>1st plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>431</td><td>2nd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>432</td><td>3rd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>433</td><td>4th plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>434</td><td>Farmer brumty</td><td>15</td><td>He looks after livestock in this area</td><td>-</td></tr> <tr><td>435</td><td>Doctor orbon</td><td>15</td><td>A local doctor</td><td>-</td></tr> <tr><td>436</td><td>Councillor Halgrive</td><td>20</td><td>A town counceller</td><td>-</td></tr> <tr><td>437</td><td>Edmond</td><td>20</td><td>A local civilian</td><td>-</td></tr> <tr><td>438</td><td>Citizen</td><td>11</td><td>He look's tired</td><td>X</td></tr> <tr><td>439</td><td>Citizen</td><td>10</td><td>He look's frightened</td><td>X</td></tr> <tr><td>440</td><td>Citizen</td><td>12</td><td>She look's frustrated</td><td>X</td></tr> <tr><td>441</td><td>Citizen</td><td>20</td><td>He look's angry</td><td>X</td></tr> <tr><td>442</td><td>Citizen</td><td>15</td><td>He look's disillusioned</td><td>X</td></tr> <tr><td>443</td><td>Jethick</td><td>15</td><td>A cynical old man</td><td>-</td></tr> <tr><td>444</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>445</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>446</td><td>Ted Rehnison</td><td>9</td><td>The head of the Rehnison family</td><td>-</td></tr> <tr><td>447</td><td>Martha Rehnison</td><td>12</td><td>A fairly poor looking woman</td><td>-</td></tr> <tr><td>448</td><td>Billy Rehnison</td><td>45</td><td>The Rehnisons eldest son</td><td>-</td></tr> <tr><td>449</td><td>Milli Rehnison</td><td>39</td><td>She doesn't seem very happy</td><td>-</td></tr> <tr><td>450</td><td>Alrena</td><td>2</td><td>She look's concerned</td><td>-</td></tr> <tr><td>451</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>452</td><td>Clerk</td><td>2</td><td>A bueracratic administrator</td><td>-</td></tr> <tr><td>453</td><td>Carla</td><td>2</td><td>She look's upset</td><td>-</td></tr> <tr><td>454</td><td>Bravek</td><td>30</td><td>The city warder of West Ardougne</td><td>-</td></tr> <tr><td>455</td><td>Caroline</td><td>2</td><td>A well dressed middle aged lady</td><td>-</td></tr> <tr><td>456</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>457</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>458</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>459</td><td>kent</td><td>45</td><td>caroline's husband</td><td>-</td></tr> <tr><td>460</td><td>bailey</td><td>15</td><td>the fishing platform cook</td><td>-</td></tr> <tr><td>461</td><td>kennith</td><td>0</td><td>A young scared looking boy</td><td>-</td></tr> <tr><td>462</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>463</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>464</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>465</td><td>Elena</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>466</td><td>jinno</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>467</td><td>Watto</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>468</td><td>Recruiter</td><td>51</td><td>A member of the Ardougne royal army</td><td>-</td></tr> <tr><td>469</td><td>Head mourner</td><td>2</td><td>In charge of people with silly outfits</td><td>-</td></tr> <tr><td>470</td><td>Almera</td><td>2</td><td>A woman of the wilderness</td><td>-</td></tr> <tr><td>471</td><td>hudon</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>472</td><td>hadley</td><td>30</td><td>A happy looking fellow</td><td>-</td></tr> <tr><td>473</td><td>Rat</td><td>7</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>474</td><td>Combat instructor</td><td>51</td><td>He will tell me how to fight</td><td>-</td></tr> <tr><td>475</td><td>golrie</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>476</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>477</td><td>King Black Dragon</td><td>245</td><td>The biggest meanest dragon around</td><td>X</td></tr> <tr><td>478</td><td>cooking instructor</td><td>15</td><td>Talk to him to learn about runescape food</td><td>-</td></tr> <tr><td>479</td><td>fishing instructor</td><td>15</td><td>He smells of fish</td><td>-</td></tr> <tr><td>480</td><td>financial advisor</td><td>0</td><td>He knows about money</td><td>-</td></tr> <tr><td>481</td><td>gerald</td><td>15</td><td>An old fisherman</td><td>-</td></tr> <tr><td>482</td><td>mining instructor</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>483</td><td>Elena</td><td>2</td><td>She looks concerned</td><td>-</td></tr> <tr><td>484</td><td>Omart</td><td>30</td><td>A nervous looking fellow</td><td>-</td></tr> <tr><td>485</td><td>Bank assistant</td><td>9</td><td>She can look after my stuff</td><td>-</td></tr> <tr><td>486</td><td>Jerico</td><td>15</td><td>He looks friendly enough</td><td>-</td></tr> <tr><td>487</td><td>Kilron</td><td>15</td><td>He looks shifty</td><td>-</td></tr> <tr><td>488</td><td>Guidor's wife</td><td>2</td><td>She looks rather concerned</td><td>-</td></tr> <tr><td>489</td><td>Quest advisor</td><td>51</td><td>I wonder what advise he has to impart</td><td>-</td></tr> <tr><td>490</td><td>chemist</td><td>4</td><td>human</td><td>-</td></tr> <tr><td>491</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>492</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>493</td><td>Wilderness guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>494</td><td>Magic Instructor</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>495</td><td>Mourner</td><td>22</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>496</td><td>Community instructor</td><td>2</td><td>This is the last advisor - honest</td><td>-</td></tr> <tr><td>497</td><td>boatman</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>498</td><td>skeleton mage</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>499</td><td>controls guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>500</td><td>nurse sarah</td><td>2</td><td>She's quite a looker</td><td>-</td></tr> <tr><td>501</td><td>Tailor</td><td>29</td><td>He's ready for a party</td><td>-</td></tr> <tr><td>502</td><td>Mourner</td><td>25</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>503</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>504</td><td>Chemist</td><td>29</td><td>He looks clever enough</td><td>-</td></tr> <tr><td>505</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>506</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>507</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>508</td><td>Guidor</td><td>29</td><td>He's not that ill</td><td>-</td></tr> <tr><td>509</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>510</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>511</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>512</td><td>king Lathas</td><td>30</td><td>King Lanthas of east ardounge</td><td>-</td></tr> <tr><td>513</td><td>Head wizard</td><td>12</td><td>He runs the wizards guild</td><td>-</td></tr> <tr><td>514</td><td>Magic store owner</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>515</td><td>Wizard Frumscone</td><td>12</td><td>A confused looking wizard</td><td>-</td></tr> <tr><td>516</td><td>target practice zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>517</td><td>Trufitus</td><td>6</td><td>A wise old witch doctor</td><td>-</td></tr> <tr><td>518</td><td>Colonel Radick</td><td>51</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>519</td><td>Soldier</td><td>28</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>520</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>521</td><td>Jungle Spider</td><td>47</td><td>A venomous deadly spider</td><td>X</td></tr> <tr><td>522</td><td>Jiminua</td><td>0</td><td>She looks very interested in selling some of her wares.</td><td>-</td></tr> <tr><td>523</td><td>Jogre</td><td>58</td><td>An aggressive humanoid</td><td>X</td></tr> <tr><td>524</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>525</td><td>Ogre</td><td>58</td><td>Useful for ranged training</td><td>X</td></tr> <tr><td>526</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>527</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>528</td><td>shop keeper</td><td>0</td><td>he sells weapons</td><td>-</td></tr> <tr><td>529</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>530</td><td>Frenita</td><td>0</td><td>runs a cookery shop</td><td>-</td></tr> <tr><td>531</td><td>Ogre chieftan</td><td>78</td><td>A slightly bigger uglier ogre</td><td>X</td></tr> <tr><td>532</td><td>rometti</td><td>3</td><td>It's a well dressed tree gnome</td><td>-</td></tr> <tr><td>533</td><td>Rashiliyia</td><td>80</td><td>A willowy ethereal being who floats above the ground</td><td>-</td></tr> <tr><td>534</td><td>Blurberry</td><td>3</td><td>It's a red faced tree gnome</td><td>-</td></tr> <tr><td>535</td><td>Heckel funch</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>536</td><td>Aluft Gianne</td><td>3</td><td>It's a tree gnome chef</td><td>-</td></tr> <tr><td>537</td><td>Hudo glenfad</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>538</td><td>Irena</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>539</td><td>Mosol</td><td>0</td><td>A jungle warrior</td><td>-</td></tr> <tr><td>540</td><td>Gnome banker</td><td>3</td><td>It's tree gnome banker</td><td>-</td></tr> <tr><td>541</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>542</td><td>UndeadOne</td><td>62</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>543</td><td>Drucas</td><td>20</td><td>engraver</td><td>-</td></tr> <tr><td>544</td><td>tourist</td><td>29</td><td>human</td><td>-</td></tr> <tr><td>545</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>546</td><td>Hazelmere</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>547</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>548</td><td>Shar</td><td>0</td><td>Concerned about the economy</td><td>-</td></tr> <tr><td>549</td><td>Shantay</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>550</td><td>charlie</td><td>0</td><td>Poor guy?</td><td>X</td></tr> <tr><td>551</td><td>Gnome guard</td><td>31</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>552</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>553</td><td>Mehman</td><td>29</td><td>local</td><td>-</td></tr> <tr><td>554</td><td>Ana</td><td>16</td><td>This lady doesn't look as if she belongs here.</td><td>-</td></tr> <tr><td>555</td><td>Chaos Druid warrior</td><td>44</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>556</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>557</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>558</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>559</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>560</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>561</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>562</td><td>Gnome guard</td><td>23</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>563</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>564</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>565</td><td>Anita</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>566</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>567</td><td>Salarin the twisted</td><td>69</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>568</td><td>Black Demon</td><td>175</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>569</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>570</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>571</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>572</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>573</td><td>Sigbert the Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>574</td><td>Yanille Watchman</td><td>33</td><td>He watches out for invading ogres</td><td>X</td></tr> <tr><td>575</td><td>Tower guard</td><td>33</td><td>He stops people going up the tower</td><td>-</td></tr> <tr><td>576</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>577</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>578</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>579</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>580</td><td>Blurberry barman</td><td>3</td><td>He serves cocktails</td><td>-</td></tr> <tr><td>581</td><td>Gnome waiter</td><td>3</td><td>He can serve you gnome food</td><td>-</td></tr> <tr><td>582</td><td>Gnome guard</td><td>27</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>583</td><td>Gnome child</td><td>3</td><td>that's a little gnome</td><td>X</td></tr> <tr><td>584</td><td>Earth warrior</td><td>52</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>585</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>X</td></tr> <tr><td>586</td><td>Gnome child</td><td>3</td><td>hello little gnome</td><td>X</td></tr> <tr><td>587</td><td>Gulluck</td><td>10</td><td>He sells weapons</td><td>-</td></tr> <tr><td>588</td><td>Gunnjorn</td><td>16</td><td>Not civilised looking</td><td>-</td></tr> <tr><td>589</td><td>Zadimus</td><td>0</td><td>Ghostly Visage of the dead Zadimus</td><td>-</td></tr> <tr><td>590</td><td>Brimstail</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>591</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>-</td></tr> <tr><td>592</td><td>Gnome local</td><td>9</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>593</td><td>Gnome local</td><td>3</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>594</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>595</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>596</td><td>Goalie</td><td>70</td><td>A gnome ball goal catcher</td><td>-</td></tr> <tr><td>597</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>598</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>599</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>600</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>601</td><td>Referee</td><td>3</td><td>He controls the game</td><td>-</td></tr> <tr><td>602</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>603</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>604</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>605</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>606</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>607</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>608</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>609</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>610</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>611</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>612</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>613</td><td>Nazastarool Zombie</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>614</td><td>Nazastarool Skeleton</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>615</td><td>Nazastarool Ghost</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>616</td><td>Fernahei</td><td>6</td><td>An enthusiastic fishing shop owner</td><td>-</td></tr> <tr><td>617</td><td>Jungle Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>618</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>619</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>620</td><td>Obli</td><td>0</td><td>An intelligent looking shop owner</td><td>-</td></tr> <tr><td>621</td><td>Kaleb</td><td>0</td><td>This is Kaleb Paramaya - a warm and friendly inn owner</td><td>-</td></tr> <tr><td>622</td><td>Yohnus</td><td>0</td><td>This is Yohnus - he runs the local blacksmiths</td><td>-</td></tr> <tr><td>623</td><td>Serevel</td><td>0</td><td>This is Serevel - he sells tickets for the 'Lady of the Waves'</td><td>-</td></tr> <tr><td>624</td><td>Yanni</td><td>0</td><td>Yanni Salika - He buys and sells antiques.</td><td>-</td></tr> <tr><td>625</td><td>Official</td><td>3</td><td>He helps the referee</td><td>-</td></tr> <tr><td>626</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>627</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>628</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>629</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>630</td><td>Blessed Vermen</td><td>14</td><td>A undead servent of iban</td><td>X</td></tr> <tr><td>631</td><td>Blessed Spider</td><td>35</td><td>One of iban's eight legged friends</td><td>X</td></tr> <tr><td>632</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>633</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>634</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>635</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>636</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>637</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>638</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>639</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>640</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>641</td><td>Kalrag</td><td>78</td><td>I think this is one of Ibans pets</td><td>X</td></tr> <tr><td>642</td><td>Niloof</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>643</td><td>Kardia the Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>644</td><td>Souless</td><td>16</td><td>He seems an empty shell</td><td>X</td></tr> <tr><td>645</td><td>Othainian</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>646</td><td>Doomion</td><td>98</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>647</td><td>Holthion</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>648</td><td>Klank</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>649</td><td>Iban</td><td>21</td><td>You feel terror just looking at him</td><td>-</td></tr> <tr><td>650</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>651</td><td>Goblin guard</td><td>48</td><td>An imposing green creature</td><td>X</td></tr> <tr><td>652</td><td>Observatory Professor</td><td>4</td><td>He works in the observatory</td><td>-</td></tr> <tr><td>653</td><td>Ugthanki</td><td>45</td><td>A dangerous type of spitting camel that can temporarily blind an opponent.</td><td>X</td></tr> <tr><td>654</td><td>Observatory assistant</td><td>4</td><td>The Professor's assistant</td><td>-</td></tr> <tr><td>655</td><td>Souless</td><td>24</td><td>A servent to zamorak</td><td>X</td></tr> <tr><td>656</td><td>Dungeon spider</td><td>22</td><td>A nasty poisonous arachnid</td><td>X</td></tr> <tr><td>657</td><td>Kamen</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>658</td><td>Iban disciple</td><td>19</td><td>An evil follower of Iban</td><td>X</td></tr> <tr><td>659</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>660</td><td>Goblin</td><td>19</td><td>These goblins have grown strong</td><td>X</td></tr> <tr><td>661</td><td>Chadwell</td><td>16</td><td>A sturdy looking gent</td><td>-</td></tr> <tr><td>662</td><td>Professor</td><td>4</td><td>The owner of the observatory</td><td>-</td></tr> <tr><td>663</td><td>San Tojalon</td><td>120</td><td>The animated spirit of San Tojalon</td><td>X</td></tr> <tr><td>664</td><td>Ghost</td><td>29</td><td>A doomed victim of zamorak</td><td>X</td></tr> <tr><td>665</td><td>Spirit of Scorpius</td><td>100</td><td>The undead spirit of the follower of Zamorak</td><td>-</td></tr> <tr><td>666</td><td>Scorpion</td><td>21</td><td>There are nasty scorpions around this grave</td><td>-</td></tr> <tr><td>667</td><td>Dark Mage</td><td>0</td><td>He works in the ways of dark magic</td><td>-</td></tr> <tr><td>668</td><td>Mercenary</td><td>50</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>669</td><td>Mercenary Captain</td><td>64</td><td>He's in control of the local guards.</td><td>X</td></tr> <tr><td>670</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>671</td><td>Mining Slave</td><td>16</td><td>A chained slave forced to mine rocks.</td><td>X</td></tr> <tr><td>672</td><td>Watchtower wizard</td><td>12</td><td>A learned man</td><td>-</td></tr> <tr><td>673</td><td>Ogre Shaman</td><td>100</td><td>An intelligent form of ogre</td><td>-</td></tr> <tr><td>674</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>675</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>676</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>677</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>678</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>679</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>680</td><td>Og</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>681</td><td>Grew</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>682</td><td>Toban</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>683</td><td>Gorad</td><td>78</td><td>A high ranking ogre official</td><td>X</td></tr> <tr><td>684</td><td>Ogre guard</td><td>96</td><td>this creature looks very tough</td><td>X</td></tr> <tr><td>685</td><td>Yanille Watchman</td><td>33</td><td>A captured guard of Yanille</td><td>-</td></tr> <tr><td>686</td><td>Ogre merchant</td><td>58</td><td>He sells ogre-inspired items</td><td>-</td></tr> <tr><td>687</td><td>Ogre trader</td><td>58</td><td>He trades in metals</td><td>-</td></tr> <tr><td>688</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>689</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>690</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>691</td><td>City Guard</td><td>78</td><td>high ranking ogre guards</td><td>-</td></tr> <tr><td>692</td><td>Mercenary</td><td>39</td><td>He seems to be guarding this area</td><td>X</td></tr> <tr><td>693</td><td>Lawgof</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>694</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>695</td><td>lollk</td><td>18</td><td>He looks scared</td><td>-</td></tr> <tr><td>696</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>697</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>X</td></tr> <tr><td>698</td><td>Nulodion</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>699</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>700</td><td>Al Shabim</td><td>0</td><td>The leader of a nomadic Bedabin desert people - sometimes referred to as the 'Tenti's'</td><td>-</td></tr> <tr><td>701</td><td>Bedabin Nomad</td><td>0</td><td>A Bedabin nomad - they live in the harshest extremes in the desert</td><td>-</td></tr> <tr><td>702</td><td>Captain Siad</td><td>48</td><td>He's in control of the whole mining camp.</td><td>X</td></tr> <tr><td>703</td><td>Bedabin Nomad Guard</td><td>70</td><td>A Bedabin nomad guard - he's protecting something important</td><td>X</td></tr> <tr><td>704</td><td>Ogre citizen</td><td>58</td><td>A denizen of Gu'Tanoth</td><td>X</td></tr> <tr><td>705</td><td>Rock of ages</td><td>150</td><td>A huge boulder</td><td>X</td></tr> <tr><td>706</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>707</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>708</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>709</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>710</td><td>Draft Mercenary Guard</td><td>50</td><td>He's quickly drafted in to deal with trouble makers</td><td>X</td></tr> <tr><td>711</td><td>Mining Cart Driver</td><td>15</td><td>He drives the mining cart</td><td>-</td></tr> <tr><td>712</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>-</td></tr> <tr><td>713</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>X</td></tr> <tr><td>714</td><td>Gertrude</td><td>20</td><td>A busy housewife</td><td>-</td></tr> <tr><td>715</td><td>Shilop</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>716</td><td>Rowdy Guard</td><td>50</td><td>He looks as if he's spoiling for trouble</td><td>X</td></tr> <tr><td>717</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>X</td></tr> <tr><td>718</td><td>Rowdy Slave</td><td>16</td><td>A slave who's looking for trouble.</td><td>X</td></tr> <tr><td>719</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>-</td></tr> <tr><td>720</td><td>Assistant</td><td>0</td><td>He is an assistant to Shantay and helps him to run the pass.</td><td>-</td></tr> <tr><td>721</td><td>Desert Wolf</td><td>31</td><td>A vicious Desert wolf</td><td>X</td></tr> <tr><td>722</td><td>Workman</td><td>9</td><td>This person is working on the site</td><td>-</td></tr> <tr><td>723</td><td>Examiner</td><td>2</td><td>As you examine the examiner you examine that she is indeed an examiner!!</td><td>-</td></tr> <tr><td>724</td><td>Student</td><td>0</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>725</td><td>Student</td><td>20</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>726</td><td>Guide</td><td>12</td><td>This person specialises in panning for gold</td><td>-</td></tr> <tr><td>727</td><td>Student</td><td>18</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>728</td><td>Archaeological expert</td><td>15</td><td>An expert on archaeology!</td><td>-</td></tr> <tr><td>729</td><td>civillian</td><td>18</td><td>He looks aggitated!</td><td>X</td></tr> <tr><td>730</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>731</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>732</td><td>civillian</td><td>15</td><td>He looks aggitated!</td><td>-</td></tr> <tr><td>733</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>734</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>735</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>736</td><td>Legends Guild Guard</td><td>50</td><td>This guard is protecting the entrance to the Legends Guild.</td><td>-</td></tr> <tr><td>737</td><td>Escaping Mining Slave</td><td>16</td><td>An emancipated slave with cool Desert Clothes.</td><td>-</td></tr> <tr><td>738</td><td>Workman</td><td>9</td><td>This person is working in the mine</td><td>-</td></tr> <tr><td>739</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>740</td><td>Echned Zekin</td><td>50</td><td>An evil spirit of the underworld.</td><td>-</td></tr> <tr><td>741</td><td>Donovan the Handyman</td><td>9</td><td>It's the family odd jobs man</td><td>-</td></tr> <tr><td>742</td><td>Pierre the Dog Handler</td><td>9</td><td>It's the guy who looks after the family guard dog</td><td>-</td></tr> <tr><td>743</td><td>Hobbes the Butler</td><td>9</td><td>It's the family butler</td><td>-</td></tr> <tr><td>744</td><td>Louisa The Cook</td><td>0</td><td>It's the family cook</td><td>-</td></tr> <tr><td>745</td><td>Mary The Maid</td><td>25</td><td>The family maid</td><td>-</td></tr> <tr><td>746</td><td>Stanford The Gardener</td><td>8</td><td>It's the family Gardener</td><td>-</td></tr> <tr><td>747</td><td>Guard</td><td>28</td><td>He looks like he's in over his head here</td><td>-</td></tr> <tr><td>748</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>-</td></tr> <tr><td>749</td><td>Guard</td><td>8</td><td>***EMPTY PLEASE USE OR REPLACE***</td><td>-</td></tr> <tr><td>750</td><td>Man</td><td>9</td><td>A thirsty looking man</td><td>-</td></tr> <tr><td>751</td><td>Anna Sinclair</td><td>9</td><td>The first child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>752</td><td>Bob Sinclair</td><td>9</td><td>The second child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>753</td><td>Carol Sinclair</td><td>9</td><td>The third child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>754</td><td>David Sinclair</td><td>9</td><td>The fourth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>755</td><td>Elizabeth Sinclair</td><td>9</td><td>The fifth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>756</td><td>Frank Sinclair</td><td>9</td><td>The sixth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>757</td><td>kolodion</td><td>65</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>758</td><td>kolodion</td><td>68</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>759</td><td>kolodion</td><td>46</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>760</td><td>kolodion</td><td>98</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>761</td><td>Irvig Senay</td><td>125</td><td>The animated spirit of Irvig Senay</td><td>X</td></tr> <tr><td>762</td><td>Ranalph Devere</td><td>130</td><td>The animated spirit of Ranalph Devere</td><td>X</td></tr> <tr><td>763</td><td>Poison Salesman</td><td>7</td><td>Peter Potter - Poison Purveyor</td><td>-</td></tr> <tr><td>764</td><td>Gujuo</td><td>60</td><td>A tall charismatic looking jungle native - he approaches with confidence</td><td>-</td></tr> <tr><td>765</td><td>Jungle Forester</td><td>15</td><td>A woodsman who specialises in large and exotic timber</td><td>-</td></tr> <tr><td>766</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman</td><td>X</td></tr> <tr><td>767</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman - he looks very strange with glowing red eyes...</td><td>X</td></tr> <tr><td>768</td><td>Death Wing</td><td>80</td><td>A supernatural creature of the underworld</td><td>X</td></tr> <tr><td>769</td><td>Nezikchened</td><td>172</td><td>An ancient powerful Demon of the Underworld...</td><td>X</td></tr> <tr><td>770</td><td>Dwarf Cannon engineer</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>771</td><td>Dwarf commander</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>772</td><td>Viyeldi</td><td>80</td><td>The spirit of a dead sorcerer</td><td>X</td></tr> <tr><td>773</td><td>Nurmof</td><td>18</td><td>He sells pickaxes</td><td>-</td></tr> <tr><td>774</td><td>Fatigue expert</td><td>10</td><td>He looks wide awake</td><td>-</td></tr> <tr><td>775</td><td>Karamja Wolf</td><td>61</td><td>A hungry</td><td>X</td></tr> <tr><td>776</td><td>Jungle Savage</td><td>87</td><td>A savage and fearless Jungle warrior</td><td>X</td></tr> <tr><td>777</td><td>Oomlie Bird</td><td>32</td><td>A variety of flightless jungle fowl - it has a sharp beak and a bad temper.</td><td>X</td></tr> <tr><td>778</td><td>Sidney Smith</td><td>30</td><td>Sidney Smith - Certification clerk</td><td>-</td></tr> <tr><td>779</td><td>Siegfried Erkle</td><td>25</td><td>An eccentric shop keeper - related to the Grand Vizier of the Legends Guild</td><td>-</td></tr> <tr><td>780</td><td>Tea seller</td><td>9</td><td>He has delicious tea to buy</td><td>-</td></tr> <tr><td>781</td><td>Wilough</td><td>0</td><td>A young son of gertrudes</td><td>-</td></tr> <tr><td>782</td><td>Philop</td><td>0</td><td>Gertrudes youngest</td><td>-</td></tr> <tr><td>783</td><td>Kanel</td><td>0</td><td>Gertrudes youngest's twin brother</td><td>-</td></tr> <tr><td>784</td><td>chamber guardian</td><td>15</td><td>He hasn't seen much sun latley</td><td>-</td></tr> <tr><td>785</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>786</td><td>Pit Scorpion</td><td>35</td><td>Very vicious little scorpions</td><td>X</td></tr> <tr><td>787</td><td>Shadow Warrior</td><td>64</td><td>A sinsistar shadowy figure</td><td>X</td></tr> <tr><td>788</td><td>Fionella</td><td>25</td><td>She runs the legend's general store</td><td>-</td></tr> <tr><td>789</td><td>Battle mage</td><td>52</td><td>He kills in the name of guthix</td><td>X</td></tr> <tr><td>790</td><td>Battle mage</td><td>52</td><td>He kills in the name of zamarok</td><td>X</td></tr> <tr><td>791</td><td>Battle mage</td><td>52</td><td>He kills in the name of Saradomin</td><td>X</td></tr> <tr><td>792</td><td>Gundai</td><td>15</td><td>He must get lonely out here</td><td>-</td></tr> <tr><td>793</td><td>Lundail</td><td>15</td><td>He sells rune stones</td><td>-</td></tr> 104 2011-06-20T04:33:13Z Admin 1 {{NPCs}} <table border="1" cellpadding="3" cellspacing="3"> <tr><td><b>id</b></td><td><b>npc name</b></td><td><b>level</b></td><td><b>description</b></td><td><b>attackable</b></td></tr> <tr><td>0</td><td>Unicorn</td><td>21</td><td>It's a unicorn</td><td>X</td></tr> <tr><td>1</td><td>Bob</td><td>2</td><td>An axe seller</td><td>-</td></tr> <tr><td>2</td><td>Sheep</td><td>0</td><td>A very wooly sheep</td><td>-</td></tr> <tr><td>3</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>X</td></tr> <tr><td>4</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>5</td><td>Hans</td><td>3</td><td>A castle servant</td><td>X</td></tr> <tr><td>6</td><td>cow</td><td>8</td><td>It's a multi purpose cow</td><td>X</td></tr> <tr><td>7</td><td>cook</td><td>15</td><td>The head cook of Lumbridge castle</td><td>-</td></tr> <tr><td>8</td><td>Bear</td><td>24</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>9</td><td>Priest</td><td>0</td><td>A priest of Saradomin</td><td>-</td></tr> <tr><td>10</td><td>Urhney</td><td>8</td><td>He looks a little grumpy</td><td>-</td></tr> <tr><td>11</td><td>Man</td><td>9</td><td>One of runescapes many citizens</td><td>X</td></tr> <tr><td>12</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>13</td><td>Camel</td><td>0</td><td>Oh its a camel</td><td>-</td></tr> <tr><td>14</td><td>Gypsy</td><td>0</td><td>An old gypsy lady</td><td>-</td></tr> <tr><td>15</td><td>Ghost</td><td>12</td><td>Ooh spooky</td><td>-</td></tr> <tr><td>16</td><td>Sir Prysin</td><td>40</td><td>One of the king's knights</td><td>-</td></tr> <tr><td>17</td><td>Traiborn the wizard</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>18</td><td>Captain Rovin</td><td>51</td><td>The head of the palace guard</td><td>-</td></tr> <tr><td>19</td><td>Rat</td><td>8</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>20</td><td>Reldo</td><td>12</td><td>I think he's the librarian</td><td>-</td></tr> <tr><td>21</td><td>mugger</td><td>10</td><td>He jumps out and attacks people</td><td>X</td></tr> <tr><td>22</td><td>Lesser Demon</td><td>79</td><td>Lesser but still pretty big</td><td>X</td></tr> <tr><td>23</td><td>Giant Spider</td><td>8</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>24</td><td>Man</td><td>30</td><td>A shifty looking man</td><td>-</td></tr> <tr><td>25</td><td>Jonny the beard</td><td>10</td><td>I can see why he's called the beard</td><td>X</td></tr> <tr><td>26</td><td>Baraek</td><td>30</td><td>A fur trader</td><td>-</td></tr> <tr><td>27</td><td>Katrine</td><td>25</td><td>She doesn't look to friendly</td><td>-</td></tr> <tr><td>28</td><td>Tramp</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>29</td><td>Rat</td><td>2</td><td>A small muddy rat</td><td>X</td></tr> <tr><td>30</td><td>Romeo</td><td>45</td><td>He looks mildly confused</td><td>-</td></tr> <tr><td>31</td><td>Juliet</td><td>2</td><td>She looks a little stressed</td><td>-</td></tr> <tr><td>32</td><td>Father Lawrence</td><td>0</td><td>A kindly looking priest</td><td>-</td></tr> <tr><td>33</td><td>Apothecary</td><td>6</td><td>I wonder if he has any good potions</td><td>-</td></tr> <tr><td>34</td><td>spider</td><td>2</td><td>Incey wincey</td><td>X</td></tr> <tr><td>35</td><td>Delrith</td><td>30</td><td>A freshly summoned demon</td><td>X</td></tr> <tr><td>36</td><td>Veronica</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>37</td><td>Weaponsmaster</td><td>25</td><td>The phoenix gang quartermaster</td><td>X</td></tr> <tr><td>38</td><td>Professor Oddenstein</td><td>4</td><td>A mad scientist if I ever saw one</td><td>-</td></tr> <tr><td>39</td><td>Curator</td><td>2</td><td>He looks like he's daydreaming</td><td>-</td></tr> <tr><td>40</td><td>skeleton</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>41</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>42</td><td>king</td><td>30</td><td>King Roald the VIII</td><td>-</td></tr> <tr><td>43</td><td>Giant bat</td><td>32</td><td>An angry flying rodent</td><td>X</td></tr> <tr><td>44</td><td>Bartender</td><td>0</td><td>A friendly barman</td><td>-</td></tr> <tr><td>45</td><td>skeleton</td><td>31</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>46</td><td>skeleton</td><td>25</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>47</td><td>Rat</td><td>13</td><td>overgrown vermin</td><td>X</td></tr> <tr><td>48</td><td>Horvik the Armourer</td><td>16</td><td>He looks strong</td><td>-</td></tr> <tr><td>49</td><td>Bear</td><td>0</td><td>A bear</td><td>-</td></tr> <tr><td>50</td><td>skeleton</td><td>19</td><td>It rattles when it walks</td><td>X</td></tr> <tr><td>51</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>52</td><td>zombie</td><td>19</td><td>The living dead</td><td>X</td></tr> <tr><td>53</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>54</td><td>Aubury</td><td>0</td><td>I think he might be a shop keeper</td><td>-</td></tr> <tr><td>55</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>56</td><td>shopkeeper</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>57</td><td>Darkwizard</td><td>13</td><td>He works evil magic</td><td>X</td></tr> <tr><td>58</td><td>lowe</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>59</td><td>Thessalia</td><td>0</td><td>A young shop assistant</td><td>-</td></tr> <tr><td>60</td><td>Darkwizard</td><td>25</td><td>He works evil magic</td><td>X</td></tr> <tr><td>61</td><td>Giant</td><td>37</td><td>A very large foe</td><td>X</td></tr> <tr><td>62</td><td>Goblin</td><td>7</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>63</td><td>farmer</td><td>15</td><td>He grows the crops in this area</td><td>X</td></tr> <tr><td>64</td><td>Thief</td><td>21</td><td>He'll take anything that isn't nailed down</td><td>X</td></tr> <tr><td>65</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>X</td></tr> <tr><td>66</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>67</td><td>Hobgoblin</td><td>32</td><td>A large ugly green creature</td><td>X</td></tr> <tr><td>68</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>69</td><td>Zaff</td><td>0</td><td>He trades in staffs</td><td>-</td></tr> <tr><td>70</td><td>Scorpion</td><td>21</td><td>An extremely vicious scorpion</td><td>X</td></tr> <tr><td>71</td><td>silk trader</td><td>0</td><td>He sells silk</td><td>-</td></tr> <tr><td>72</td><td>Man</td><td>9</td><td>One of Runescapes many citizens</td><td>X</td></tr> <tr><td>73</td><td>Guide</td><td>1</td><td>He gives hints to new adventurers</td><td>-</td></tr> <tr><td>74</td><td>Giant Spider</td><td>31</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>75</td><td>Peksa</td><td>9</td><td>A helmet salesman</td><td>-</td></tr> <tr><td>76</td><td>Barbarian</td><td>16</td><td>Not civilised looking</td><td>X</td></tr> <tr><td>77</td><td>Fred the farmer</td><td>9</td><td>An old farmer</td><td>-</td></tr> <tr><td>78</td><td>Gunthor the Brave</td><td>37</td><td>The barbarians fearless leader</td><td>X</td></tr> <tr><td>79</td><td>Witch</td><td>25</td><td>She's got warts</td><td>X</td></tr> <tr><td>80</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>81</td><td>Wizard</td><td>16</td><td>An old wizard</td><td>X</td></tr> <tr><td>82</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>83</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>84</td><td>Zeke</td><td>0</td><td>He sells Scimitars</td><td>-</td></tr> <tr><td>85</td><td>Louie Legs</td><td>0</td><td>He might want to sell something</td><td>-</td></tr> <tr><td>86</td><td>Warrior</td><td>18</td><td>A member of Al Kharid's military</td><td>X</td></tr> <tr><td>87</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>88</td><td>Shop Assistant</td><td>0</td><td>Maybe she'd like to buy some of my junk</td><td>-</td></tr> <tr><td>89</td><td>Highwayman</td><td>13</td><td>He holds up passers by</td><td>X</td></tr> <tr><td>90</td><td>Kebab Seller</td><td>0</td><td>A seller of strange food</td><td>-</td></tr> <tr><td>91</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>-</td></tr> <tr><td>92</td><td>Ernest</td><td>3</td><td>A former chicken</td><td>-</td></tr> <tr><td>93</td><td>Monk</td><td>13</td><td>A Peaceful monk</td><td>X</td></tr> <tr><td>94</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>95</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>96</td><td>Count Draynor</td><td>43</td><td>A vicious vampire</td><td>X</td></tr> <tr><td>97</td><td>Morgan</td><td>9</td><td>A frigtened villager</td><td>-</td></tr> <tr><td>98</td><td>Dr Harlow</td><td>9</td><td>His nose is very red</td><td>-</td></tr> <tr><td>99</td><td>Deadly Red spider</td><td>36</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>100</td><td>Guard</td><td>28</td><td>He's here to guard this fortress</td><td>X</td></tr> <tr><td>101</td><td>Cassie</td><td>25</td><td>She sells shields</td><td>-</td></tr> <tr><td>102</td><td>White Knight</td><td>56</td><td>A chivalrous knight</td><td>X</td></tr> <tr><td>103</td><td>Ranael</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>104</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>105</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>106</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>107</td><td>Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>108</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>109</td><td>Greldo</td><td>7</td><td>A small green warty creature</td><td>X</td></tr> <tr><td>110</td><td>Sir Amik Varze</td><td>56</td><td>The leader of the white knights</td><td>-</td></tr> <tr><td>111</td><td>Guildmaster</td><td>40</td><td>He's in charge of this place</td><td>-</td></tr> <tr><td>112</td><td>Valaine</td><td>25</td><td>She runs the champion's store</td><td>-</td></tr> <tr><td>113</td><td>Drogo</td><td>18</td><td>He runs a mining store</td><td>-</td></tr> <tr><td>114</td><td>Imp</td><td>5</td><td>A cheeky little imp</td><td>X</td></tr> <tr><td>115</td><td>Flynn</td><td>16</td><td>The mace salesman</td><td>-</td></tr> <tr><td>116</td><td>Wyson the gardener</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>117</td><td>Wizard Mizgog</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>118</td><td>Prince Ali</td><td>20</td><td>A young prince</td><td>-</td></tr> <tr><td>119</td><td>Hassan</td><td>20</td><td>the Chancellor to the emir</td><td>-</td></tr> <tr><td>120</td><td>Osman</td><td>20</td><td>He looks a little shifty</td><td>-</td></tr> <tr><td>121</td><td>Joe</td><td>40</td><td>Lady Keli's head guard</td><td>-</td></tr> <tr><td>122</td><td>Leela</td><td>20</td><td>She comes from Al Kharid</td><td>-</td></tr> <tr><td>123</td><td>Lady Keli</td><td>20</td><td>An Infamous bandit</td><td>-</td></tr> <tr><td>124</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>125</td><td>Aggie</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>126</td><td>Prince Ali</td><td>10</td><td>That is an effective disguise</td><td>-</td></tr> <tr><td>127</td><td>Jailguard</td><td>34</td><td>I wonder what he's guarding</td><td>X</td></tr> <tr><td>128</td><td>Redbeard Frank</td><td>25</td><td>A pirate</td><td>-</td></tr> <tr><td>129</td><td>Wydin</td><td>0</td><td>A grocer</td><td>-</td></tr> <tr><td>130</td><td>shop assistant</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>131</td><td>Brian</td><td>0</td><td>An axe seller</td><td>-</td></tr> <tr><td>132</td><td>squire</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>133</td><td>Head chef</td><td>15</td><td>He looks after the chef's guild</td><td>-</td></tr> <tr><td>134</td><td>Thurgo</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>135</td><td>Ice Giant</td><td>68</td><td>He's got icicles in his beard</td><td>X</td></tr> <tr><td>136</td><td>King Scorpion</td><td>36</td><td>Wow scorpions shouldn't grow that big</td><td>X</td></tr> <tr><td>137</td><td>Pirate</td><td>27</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>138</td><td>Sir Vyvin</td><td>56</td><td>One of the white knights of Falador</td><td>-</td></tr> <tr><td>139</td><td>Monk of Zamorak</td><td>29</td><td>An evil cleric</td><td>X</td></tr> <tr><td>140</td><td>Monk of Zamorak</td><td>19</td><td>An evil cleric</td><td>X</td></tr> <tr><td>141</td><td>Wayne</td><td>16</td><td>An armourer</td><td>-</td></tr> <tr><td>142</td><td>Barmaid</td><td>25</td><td>a pretty barmaid</td><td>-</td></tr> <tr><td>143</td><td>Dwarven shopkeeper</td><td>18</td><td>I wonder if he wants to buy any of my junk</td><td>-</td></tr> <tr><td>144</td><td>Doric</td><td>18</td><td>A dwarven smith</td><td>-</td></tr> <tr><td>145</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>146</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>147</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>148</td><td>Hetty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>149</td><td>Betty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>150</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>151</td><td>General wartface</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>152</td><td>General Bentnoze</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>153</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>154</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>155</td><td>Herquin</td><td>0</td><td>A gem merchant</td><td>-</td></tr> <tr><td>156</td><td>Rommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>157</td><td>Grum</td><td>0</td><td>Grum the goldsmith</td><td>-</td></tr> <tr><td>158</td><td>Ice warrior</td><td>57</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>159</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>160</td><td>Thrander</td><td>16</td><td>A smith of some sort</td><td>-</td></tr> <tr><td>161</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>162</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>163</td><td>Customs Officer</td><td>16</td><td>She is here to stop smugglers</td><td>-</td></tr> <tr><td>164</td><td>Luthas</td><td>16</td><td>The owner of the banana plantation</td><td>-</td></tr> <tr><td>165</td><td>Zambo</td><td>16</td><td>He will sell me exotic rum</td><td>-</td></tr> <tr><td>166</td><td>Captain Tobias</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>167</td><td>Gerrant</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>168</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>169</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>170</td><td>Seaman Lorris</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>171</td><td>Seaman Thresnor</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>172</td><td>Tanner</td><td>45</td><td>He makes leather</td><td>-</td></tr> <tr><td>173</td><td>Dommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>174</td><td>Abbot Langley</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>175</td><td>Thordur</td><td>18</td><td>He runs a a tourist attraction</td><td>-</td></tr> <tr><td>176</td><td>Brother Jered</td><td>13</td><td>human</td><td>-</td></tr> <tr><td>177</td><td>Rat</td><td>13</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>178</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>179</td><td>skeleton</td><td>31</td><td>it rattles when it walks</td><td>X</td></tr> <tr><td>180</td><td>zombie</td><td>32</td><td>the living dead</td><td>X</td></tr> <tr><td>181</td><td>Lesser Demon</td><td>79</td><td>Lesser but still very big</td><td>X</td></tr> <tr><td>182</td><td>Melzar the mad</td><td>45</td><td>He looks totally insane</td><td>X</td></tr> <tr><td>183</td><td>Scavvo</td><td>10</td><td>He has lopsided eyes</td><td>-</td></tr> <tr><td>184</td><td>Greater Demon</td><td>87</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>185</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>186</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>187</td><td>Oziach</td><td>0</td><td>A strange little man</td><td>-</td></tr> <tr><td>188</td><td>Bear</td><td>26</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>189</td><td>Black Knight</td><td>46</td><td>An armoured follower of Zamorak</td><td>X</td></tr> <tr><td>190</td><td>chaos Dwarf</td><td>59</td><td>a dwarf gone bad</td><td>X</td></tr> <tr><td>191</td><td>dwarf</td><td>18</td><td>A dwarf who looks after the mining guild</td><td>-</td></tr> <tr><td>192</td><td>Wormbrain</td><td>7</td><td>Dumb even by goblin standards</td><td>X</td></tr> <tr><td>193</td><td>Klarense</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>194</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>195</td><td>skeleton</td><td>54</td><td>A Taller than normal skeleton</td><td>X</td></tr> <tr><td>196</td><td>Dragon</td><td>110</td><td>A powerful and ancient dragon</td><td>X</td></tr> <tr><td>197</td><td>Oracle</td><td>57</td><td>A mystic of unknown race</td><td>-</td></tr> <tr><td>198</td><td>Duke of Lumbridge</td><td>30</td><td>Duke Horacio of Lumbridge</td><td>-</td></tr> <tr><td>199</td><td>Dark Warrior</td><td>21</td><td>A warrior touched by chaos</td><td>X</td></tr> <tr><td>200</td><td>Druid</td><td>29</td><td>A worshipper of Guthix</td><td>X</td></tr> <tr><td>201</td><td>Red Dragon</td><td>140</td><td>A big powerful dragon</td><td>X</td></tr> <tr><td>202</td><td>Blue Dragon</td><td>105</td><td>A mother dragon</td><td>X</td></tr> <tr><td>203</td><td>Baby Blue Dragon</td><td>50</td><td>Young but still dangerous</td><td>X</td></tr> <tr><td>204</td><td>Kaqemeex</td><td>29</td><td>A wise druid</td><td>-</td></tr> <tr><td>205</td><td>Sanfew</td><td>29</td><td>An old druid</td><td>-</td></tr> <tr><td>206</td><td>Suit of armour</td><td>29</td><td>A dusty old suit of armour</td><td>-</td></tr> <tr><td>207</td><td>Adventurer</td><td>13</td><td>A cleric</td><td>-</td></tr> <tr><td>208</td><td>Adventurer</td><td>12</td><td>A wizard</td><td>-</td></tr> <tr><td>209</td><td>Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>210</td><td>Adventurer</td><td>25</td><td>An archer</td><td>-</td></tr> <tr><td>211</td><td>Leprechaun</td><td>18</td><td>A funny little man who lives in a tree</td><td>-</td></tr> <tr><td>212</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>213</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>214</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>215</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>216</td><td>tree spirit</td><td>95</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>217</td><td>cow</td><td>8</td><td>It's a dairy cow</td><td>-</td></tr> <tr><td>218</td><td>Irksol</td><td>2</td><td>Is he invisible or just a set of floating clothes?</td><td>-</td></tr> <tr><td>219</td><td>Fairy Lunderwin</td><td>2</td><td>A fairy merchant</td><td>-</td></tr> <tr><td>220</td><td>Jakut</td><td>2</td><td>An unusual looking merchant</td><td>-</td></tr> <tr><td>221</td><td>Doorman</td><td>56</td><td>He guards the entrance to the faerie market</td><td>-</td></tr> <tr><td>222</td><td>Fairy Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>223</td><td>Fairy Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>224</td><td>Fairy banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>225</td><td>Giles</td><td>30</td><td>He runs an ore exchange store</td><td>-</td></tr> <tr><td>226</td><td>Miles</td><td>30</td><td>He runs a bar exchange store</td><td>-</td></tr> <tr><td>227</td><td>Niles</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>228</td><td>Gaius</td><td>16</td><td>he sells very big swords</td><td>-</td></tr> <tr><td>229</td><td>Fairy Ladder attendant</td><td>0</td><td>A worker in the faerie market</td><td>-</td></tr> <tr><td>230</td><td>Jatix</td><td>29</td><td>A hard working druid</td><td>-</td></tr> <tr><td>231</td><td>Master Crafter</td><td>0</td><td>The man in charge of the crafter's guild</td><td>-</td></tr> <tr><td>232</td><td>Bandit</td><td>29</td><td>He's ready for a fight</td><td>X</td></tr> <tr><td>233</td><td>Noterazzo</td><td>29</td><td>A bandit shopkeeper</td><td>-</td></tr> <tr><td>234</td><td>Bandit</td><td>29</td><td>A wilderness outlaw</td><td>X</td></tr> <tr><td>235</td><td>Fat Tony</td><td>15</td><td>A Gourmet Pizza chef</td><td>-</td></tr> <tr><td>236</td><td>Donny the lad</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>237</td><td>Black Heather</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>238</td><td>Speedy Keith</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>239</td><td>White wolf sentry</td><td>31</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>240</td><td>Boy</td><td>39</td><td>He doesn't seem very happy</td><td>-</td></tr> <tr><td>241</td><td>Rat</td><td>2</td><td>He seems to live here</td><td>-</td></tr> <tr><td>242</td><td>Nora T Hag</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>243</td><td>Grey wolf</td><td>64</td><td>A sinister looking wolf</td><td>X</td></tr> <tr><td>244</td><td>shapeshifter</td><td>24</td><td>I've not seen anyone like this before</td><td>X</td></tr> <tr><td>245</td><td>shapeshifter</td><td>34</td><td>I think this spider has been genetically modified</td><td>-</td></tr> <tr><td>246</td><td>shapeshifter</td><td>44</td><td>Eek! A bear!</td><td>-</td></tr> <tr><td>247</td><td>shapeshifter</td><td>54</td><td>A sinister looking wolf</td><td>-</td></tr> <tr><td>248</td><td>White wolf</td><td>41</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>249</td><td>Pack leader</td><td>71</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>250</td><td>Harry</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>251</td><td>Thug</td><td>18</td><td>He likes hitting things</td><td>X</td></tr> <tr><td>252</td><td>Firebird</td><td>6</td><td>Probably not a chicken</td><td>X</td></tr> <tr><td>253</td><td>Achetties</td><td>46</td><td>One of Asgarnia's greatest heros</td><td>-</td></tr> <tr><td>254</td><td>Ice queen</td><td>103</td><td>The leader of the ice warriors</td><td>X</td></tr> <tr><td>255</td><td>Grubor</td><td>15</td><td>A rough looking thief</td><td>-</td></tr> <tr><td>256</td><td>Trobert</td><td>13</td><td>A well dressed thief</td><td>-</td></tr> <tr><td>257</td><td>Garv</td><td>28</td><td>A diligent guard</td><td>-</td></tr> <tr><td>258</td><td>guard</td><td>27</td><td>A vicious pirate</td><td>-</td></tr> <tr><td>259</td><td>Grip</td><td>46</td><td>Scar face petes head guard</td><td>X</td></tr> <tr><td>260</td><td>Alfonse the waiter</td><td>9</td><td>He should get a clean apron</td><td>-</td></tr> <tr><td>261</td><td>Charlie the cook</td><td>15</td><td>Head cook of the Shrimp and parrot</td><td>-</td></tr> <tr><td>262</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>X</td></tr> <tr><td>263</td><td>Ice spider</td><td>64</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>264</td><td>Pirate</td><td>30</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>265</td><td>Jailer</td><td>51</td><td>Guards prisoners for the black knights</td><td>X</td></tr> <tr><td>266</td><td>Lord Darquarius</td><td>76</td><td>A black knight commander</td><td>X</td></tr> <tr><td>267</td><td>Seth</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>268</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>269</td><td>Helemos</td><td>46</td><td>A retired hero</td><td>-</td></tr> <tr><td>270</td><td>Chaos Druid</td><td>19</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>271</td><td>Poison Scorpion</td><td>26</td><td>It has a very vicious looking tail</td><td>X</td></tr> <tr><td>272</td><td>Velrak the explorer</td><td>3</td><td>he looks cold and hungry</td><td>-</td></tr> <tr><td>273</td><td>Sir Lancelot</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>274</td><td>Sir Gawain</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>275</td><td>King Arthur</td><td>56</td><td>A wise old king</td><td>-</td></tr> <tr><td>276</td><td>Sir Mordred</td><td>58</td><td>An evil knight</td><td>X</td></tr> <tr><td>277</td><td>Renegade knight</td><td>51</td><td>He isn't very friendly</td><td>X</td></tr> <tr><td>278</td><td>Davon</td><td>27</td><td>An amulet trader</td><td>-</td></tr> <tr><td>279</td><td>Bartender</td><td>0</td><td>I could get some grog off him</td><td>-</td></tr> <tr><td>280</td><td>Arhein</td><td>0</td><td>A merchant</td><td>-</td></tr> <tr><td>281</td><td>Morgan le faye</td><td>25</td><td>An evil sorceress</td><td>-</td></tr> <tr><td>282</td><td>Candlemaker</td><td>16</td><td>He makes and sells candles</td><td>-</td></tr> <tr><td>283</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>284</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>285</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>286</td><td>Beggar</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>287</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>288</td><td>Thrantax</td><td>90</td><td>A freshly summoned demon</td><td>-</td></tr> <tr><td>289</td><td>Hickton</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>290</td><td>Black Demon</td><td>156</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>291</td><td>Black Dragon</td><td>200</td><td>A fierce dragon with black scales!</td><td>X</td></tr> <tr><td>292</td><td>Poison Spider</td><td>63</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>293</td><td>Monk of Zamorak</td><td>47</td><td>An evil cleric</td><td>X</td></tr> <tr><td>294</td><td>Hellhound</td><td>114</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>295</td><td>Animated axe</td><td>46</td><td>a magic axe with a mind of it's own</td><td>X</td></tr> <tr><td>296</td><td>Black Unicorn</td><td>31</td><td>It's a sort of unicorn</td><td>X</td></tr> <tr><td>297</td><td>Frincos</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>298</td><td>Otherworldly being</td><td>66</td><td>Is he invisible or just a set of floating clothes?</td><td>X</td></tr> <tr><td>299</td><td>Owen</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>300</td><td>Thormac the sorceror</td><td>25</td><td>A powerful sorcerrer</td><td>-</td></tr> <tr><td>301</td><td>Seer</td><td>16</td><td>An old wizard</td><td>-</td></tr> <tr><td>302</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>303</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>304</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>305</td><td>Barbarian guard</td><td>16</td><td>Not very civilised</td><td>-</td></tr> <tr><td>306</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>307</td><td>man</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>308</td><td>gem trader</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>309</td><td>Dimintheis</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>310</td><td>chef</td><td>15</td><td>A busy looking chef</td><td>-</td></tr> <tr><td>311</td><td>Hobgoblin</td><td>48</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>312</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>313</td><td>Boot the Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>314</td><td>Wizard</td><td>16</td><td>A young wizard</td><td>-</td></tr> <tr><td>315</td><td>Chronozon</td><td>121</td><td>Chronozon the blood demon</td><td>X</td></tr> <tr><td>316</td><td>Captain Barnaby</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>317</td><td>Customs Official</td><td>16</td><td>She's here to stop smugglers</td><td>-</td></tr> <tr><td>318</td><td>Man</td><td>9</td><td>One of Runescape's citizens</td><td>X</td></tr> <tr><td>319</td><td>farmer</td><td>15</td><td>An humble peasant</td><td>X</td></tr> <tr><td>320</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>321</td><td>Guard</td><td>28</td><td>He tries to keep the law and order around here</td><td>X</td></tr> <tr><td>322</td><td>Knight</td><td>56</td><td>A knight of Ardougne</td><td>X</td></tr> <tr><td>323</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>324</td><td>Hero</td><td>83</td><td>A Hero of Ardougne</td><td>X</td></tr> <tr><td>325</td><td>Baker</td><td>15</td><td>He sells hot baked bread</td><td>-</td></tr> <tr><td>326</td><td>silk merchant</td><td>0</td><td>He buys silk</td><td>-</td></tr> <tr><td>327</td><td>Fur trader</td><td>0</td><td>A buyer and seller of animal furs</td><td>-</td></tr> <tr><td>328</td><td>silver merchant</td><td>0</td><td>He deals in silver</td><td>-</td></tr> <tr><td>329</td><td>spice merchant</td><td>15</td><td>He sells exotic spices</td><td>-</td></tr> <tr><td>330</td><td>gem merchant</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>331</td><td>Zenesha</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>332</td><td>Kangai Mau</td><td>0</td><td>A tribesman</td><td>-</td></tr> <tr><td>333</td><td>Wizard Cromperty</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>334</td><td>RPDT employee</td><td>12</td><td>A delivery man</td><td>-</td></tr> <tr><td>335</td><td>Horacio</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>336</td><td>Aemad</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>337</td><td>Kortan</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>338</td><td>zoo keeper</td><td>20</td><td>He looks after Ardougne city zoo</td><td>X</td></tr> <tr><td>339</td><td>Make over mage</td><td>0</td><td>He can change how I look</td><td>-</td></tr> <tr><td>340</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>341</td><td>chuck</td><td>0</td><td>A wood merchant</td><td>-</td></tr> <tr><td>342</td><td>Rogue</td><td>21</td><td>He needs a shave</td><td>X</td></tr> <tr><td>343</td><td>Shadow spider</td><td>53</td><td>Is it a spider or is it a shadow</td><td>X</td></tr> <tr><td>344</td><td>Fire Giant</td><td>109</td><td>A big guy with red glowing skin</td><td>X</td></tr> <tr><td>345</td><td>Grandpa Jack</td><td>20</td><td>A wistful old man</td><td>-</td></tr> <tr><td>346</td><td>Sinister stranger</td><td>43</td><td>not your average fisherman</td><td>-</td></tr> <tr><td>347</td><td>Bonzo</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>348</td><td>Forester</td><td>21</td><td>He looks after McGrubor's wood</td><td>X</td></tr> <tr><td>349</td><td>Morris</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>350</td><td>Brother Omad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>351</td><td>Thief</td><td>21</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>352</td><td>Head Thief</td><td>34</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>353</td><td>Big Dave</td><td>15</td><td>A well built fisherman</td><td>-</td></tr> <tr><td>354</td><td>Joshua</td><td>15</td><td>A grumpy fisherman</td><td>-</td></tr> <tr><td>355</td><td>Mountain Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>356</td><td>Mountain Dwarf</td><td>28</td><td>A short angry guy</td><td>X</td></tr> <tr><td>357</td><td>Brother Cedric</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>358</td><td>Necromancer</td><td>34</td><td>A crazy evil necromancer</td><td>X</td></tr> <tr><td>359</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>360</td><td>Lucien</td><td>21</td><td>He walks with a slight limp</td><td>-</td></tr> <tr><td>361</td><td>The Fire warrior of lesarkus</td><td>63</td><td>A strange red humanoid</td><td>X</td></tr> <tr><td>362</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>363</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>364</td><td>Lucien</td><td>21</td><td>He walks with a limp</td><td>X</td></tr> <tr><td>365</td><td>winelda</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>366</td><td>Brother Kojo</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>367</td><td>Dungeon Rat</td><td>16</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>368</td><td>Master fisher</td><td>15</td><td>The man in charge of the fishing guild</td><td>-</td></tr> <tr><td>369</td><td>Orven</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>370</td><td>Padik</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>371</td><td>Shopkeeper</td><td>0</td><td>He smells of fish</td><td>-</td></tr> <tr><td>372</td><td>Lady servil</td><td>2</td><td>She look's wealthy</td><td>-</td></tr> <tr><td>373</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>374</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>375</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>376</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>377</td><td>Jeremy Servil</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>378</td><td>Justin Servil</td><td>0</td><td>Jeremy servil's father</td><td>-</td></tr> <tr><td>379</td><td>fightslave joe</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>380</td><td>fightslave kelvin</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>381</td><td>local</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>382</td><td>Khazard Bartender</td><td>0</td><td>A tough looking barman</td><td>-</td></tr> <tr><td>383</td><td>General Khazard</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>384</td><td>Khazard Ogre</td><td>58</td><td>Khazard's strongest ogre warrior</td><td>X</td></tr> <tr><td>385</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>386</td><td>Khazard Scorpion</td><td>46</td><td>A large angry scorpion</td><td>X</td></tr> <tr><td>387</td><td>hengrad</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>388</td><td>Bouncer</td><td>122</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>389</td><td>Stankers</td><td>0</td><td>A cheerful looking fellow</td><td>-</td></tr> <tr><td>390</td><td>Docky</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>391</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>392</td><td>Fairy queen</td><td>2</td><td>A very little queen</td><td>-</td></tr> <tr><td>393</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>394</td><td>Crone</td><td>25</td><td>A strange old lady</td><td>-</td></tr> <tr><td>395</td><td>High priest of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>396</td><td>elkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>397</td><td>remsai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>398</td><td>bolkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>399</td><td>local gnome</td><td>3</td><td>It's a young tree gnome</td><td>X</td></tr> <tr><td>400</td><td>bolren</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>401</td><td>Black Knight titan</td><td>146</td><td>He is blocking the way</td><td>X</td></tr> <tr><td>402</td><td>kalron</td><td>3</td><td>he look's lost</td><td>X</td></tr> <tr><td>403</td><td>brother Galahad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>404</td><td>tracker 1</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>405</td><td>tracker 2</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>406</td><td>tracker 3</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>407</td><td>Khazard troop</td><td>28</td><td>It's one of General Khazard's warrior's</td><td>X</td></tr> <tr><td>408</td><td>commander montai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>409</td><td>gnome troop</td><td>3</td><td>It's a tree gnome trooper</td><td>X</td></tr> <tr><td>410</td><td>khazard warlord</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>411</td><td>Sir Percival</td><td>56</td><td>He's covered in pieces of straw</td><td>-</td></tr> <tr><td>412</td><td>Fisher king</td><td>30</td><td>an old king</td><td>-</td></tr> <tr><td>413</td><td>maiden</td><td>2</td><td>She has a far away look in her eyes</td><td>-</td></tr> <tr><td>414</td><td>Fisherman</td><td>30</td><td>an old fisherman</td><td>-</td></tr> <tr><td>415</td><td>King Percival</td><td>56</td><td>The new fisher king</td><td>-</td></tr> <tr><td>416</td><td>unhappy peasant</td><td>25</td><td>He looks tired and hungry</td><td>X</td></tr> <tr><td>417</td><td>happy peasant</td><td>25</td><td>He looks well fed and full of energy</td><td>X</td></tr> <tr><td>418</td><td>ceril</td><td>9</td><td>It's Sir ceril carnillean a local noblemen</td><td>-</td></tr> <tr><td>419</td><td>butler</td><td>9</td><td>It's the carnillean family butler</td><td>-</td></tr> <tr><td>420</td><td>carnillean guard</td><td>28</td><td>It's a carnillean family guard</td><td>X</td></tr> <tr><td>421</td><td>Tribesman</td><td>39</td><td>A primative warrior</td><td>X</td></tr> <tr><td>422</td><td>henryeta</td><td>2</td><td>It's a wealthy looking woman</td><td>-</td></tr> <tr><td>423</td><td>philipe</td><td>0</td><td>It's a young well dressed boy</td><td>-</td></tr> <tr><td>424</td><td>clivet</td><td>20</td><td>A strange looking man in black </td><td>-</td></tr> <tr><td>425</td><td>cult member</td><td>20</td><td>An suspicous looking man in black </td><td>X</td></tr> <tr><td>426</td><td>Lord hazeel</td><td>100</td><td>He could do with some sun</td><td>X</td></tr> <tr><td>427</td><td>alomone</td><td>42</td><td>A musculer looking man in black </td><td>-</td></tr> <tr><td>428</td><td>Khazard commander</td><td>41</td><td>It's one of General Khazard's commander's</td><td>X</td></tr> <tr><td>429</td><td>claus</td><td>15</td><td>the carnillean family cook</td><td>-</td></tr> <tr><td>430</td><td>1st plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>431</td><td>2nd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>432</td><td>3rd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>433</td><td>4th plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>434</td><td>Farmer brumty</td><td>15</td><td>He looks after livestock in this area</td><td>-</td></tr> <tr><td>435</td><td>Doctor orbon</td><td>15</td><td>A local doctor</td><td>-</td></tr> <tr><td>436</td><td>Councillor Halgrive</td><td>20</td><td>A town counceller</td><td>-</td></tr> <tr><td>437</td><td>Edmond</td><td>20</td><td>A local civilian</td><td>-</td></tr> <tr><td>438</td><td>Citizen</td><td>11</td><td>He look's tired</td><td>X</td></tr> <tr><td>439</td><td>Citizen</td><td>10</td><td>He look's frightened</td><td>X</td></tr> <tr><td>440</td><td>Citizen</td><td>12</td><td>She look's frustrated</td><td>X</td></tr> <tr><td>441</td><td>Citizen</td><td>20</td><td>He look's angry</td><td>X</td></tr> <tr><td>442</td><td>Citizen</td><td>15</td><td>He look's disillusioned</td><td>X</td></tr> <tr><td>443</td><td>Jethick</td><td>15</td><td>A cynical old man</td><td>-</td></tr> <tr><td>444</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>445</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>446</td><td>Ted Rehnison</td><td>9</td><td>The head of the Rehnison family</td><td>-</td></tr> <tr><td>447</td><td>Martha Rehnison</td><td>12</td><td>A fairly poor looking woman</td><td>-</td></tr> <tr><td>448</td><td>Billy Rehnison</td><td>45</td><td>The Rehnisons eldest son</td><td>-</td></tr> <tr><td>449</td><td>Milli Rehnison</td><td>39</td><td>She doesn't seem very happy</td><td>-</td></tr> <tr><td>450</td><td>Alrena</td><td>2</td><td>She look's concerned</td><td>-</td></tr> <tr><td>451</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>452</td><td>Clerk</td><td>2</td><td>A bueracratic administrator</td><td>-</td></tr> <tr><td>453</td><td>Carla</td><td>2</td><td>She look's upset</td><td>-</td></tr> <tr><td>454</td><td>Bravek</td><td>30</td><td>The city warder of West Ardougne</td><td>-</td></tr> <tr><td>455</td><td>Caroline</td><td>2</td><td>A well dressed middle aged lady</td><td>-</td></tr> <tr><td>456</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>457</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>458</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>459</td><td>kent</td><td>45</td><td>caroline's husband</td><td>-</td></tr> <tr><td>460</td><td>bailey</td><td>15</td><td>the fishing platform cook</td><td>-</td></tr> <tr><td>461</td><td>kennith</td><td>0</td><td>A young scared looking boy</td><td>-</td></tr> <tr><td>462</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>463</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>464</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>465</td><td>Elena</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>466</td><td>jinno</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>467</td><td>Watto</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>468</td><td>Recruiter</td><td>51</td><td>A member of the Ardougne royal army</td><td>-</td></tr> <tr><td>469</td><td>Head mourner</td><td>2</td><td>In charge of people with silly outfits</td><td>-</td></tr> <tr><td>470</td><td>Almera</td><td>2</td><td>A woman of the wilderness</td><td>-</td></tr> <tr><td>471</td><td>hudon</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>472</td><td>hadley</td><td>30</td><td>A happy looking fellow</td><td>-</td></tr> <tr><td>473</td><td>Rat</td><td>7</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>474</td><td>Combat instructor</td><td>51</td><td>He will tell me how to fight</td><td>-</td></tr> <tr><td>475</td><td>golrie</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>476</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>477</td><td>King Black Dragon</td><td>245</td><td>The biggest meanest dragon around</td><td>X</td></tr> <tr><td>478</td><td>cooking instructor</td><td>15</td><td>Talk to him to learn about runescape food</td><td>-</td></tr> <tr><td>479</td><td>fishing instructor</td><td>15</td><td>He smells of fish</td><td>-</td></tr> <tr><td>480</td><td>financial advisor</td><td>0</td><td>He knows about money</td><td>-</td></tr> <tr><td>481</td><td>gerald</td><td>15</td><td>An old fisherman</td><td>-</td></tr> <tr><td>482</td><td>mining instructor</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>483</td><td>Elena</td><td>2</td><td>She looks concerned</td><td>-</td></tr> <tr><td>484</td><td>Omart</td><td>30</td><td>A nervous looking fellow</td><td>-</td></tr> <tr><td>485</td><td>Bank assistant</td><td>9</td><td>She can look after my stuff</td><td>-</td></tr> <tr><td>486</td><td>Jerico</td><td>15</td><td>He looks friendly enough</td><td>-</td></tr> <tr><td>487</td><td>Kilron</td><td>15</td><td>He looks shifty</td><td>-</td></tr> <tr><td>488</td><td>Guidor's wife</td><td>2</td><td>She looks rather concerned</td><td>-</td></tr> <tr><td>489</td><td>Quest advisor</td><td>51</td><td>I wonder what advise he has to impart</td><td>-</td></tr> <tr><td>490</td><td>chemist</td><td>4</td><td>human</td><td>-</td></tr> <tr><td>491</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>492</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>493</td><td>Wilderness guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>494</td><td>Magic Instructor</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>495</td><td>Mourner</td><td>22</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>496</td><td>Community instructor</td><td>2</td><td>This is the last advisor - honest</td><td>-</td></tr> <tr><td>497</td><td>boatman</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>498</td><td>skeleton mage</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>499</td><td>controls guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>500</td><td>nurse sarah</td><td>2</td><td>She's quite a looker</td><td>-</td></tr> <tr><td>501</td><td>Tailor</td><td>29</td><td>He's ready for a party</td><td>-</td></tr> <tr><td>502</td><td>Mourner</td><td>25</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>503</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>504</td><td>Chemist</td><td>29</td><td>He looks clever enough</td><td>-</td></tr> <tr><td>505</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>506</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>507</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>508</td><td>Guidor</td><td>29</td><td>He's not that ill</td><td>-</td></tr> <tr><td>509</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>510</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>511</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>512</td><td>king Lathas</td><td>30</td><td>King Lanthas of east ardounge</td><td>-</td></tr> <tr><td>513</td><td>Head wizard</td><td>12</td><td>He runs the wizards guild</td><td>-</td></tr> <tr><td>514</td><td>Magic store owner</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>515</td><td>Wizard Frumscone</td><td>12</td><td>A confused looking wizard</td><td>-</td></tr> <tr><td>516</td><td>target practice zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>517</td><td>Trufitus</td><td>6</td><td>A wise old witch doctor</td><td>-</td></tr> <tr><td>518</td><td>Colonel Radick</td><td>51</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>519</td><td>Soldier</td><td>28</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>520</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>521</td><td>Jungle Spider</td><td>47</td><td>A venomous deadly spider</td><td>X</td></tr> <tr><td>522</td><td>Jiminua</td><td>0</td><td>She looks very interested in selling some of her wares.</td><td>-</td></tr> <tr><td>523</td><td>Jogre</td><td>58</td><td>An aggressive humanoid</td><td>X</td></tr> <tr><td>524</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>525</td><td>Ogre</td><td>58</td><td>Useful for ranged training</td><td>X</td></tr> <tr><td>526</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>527</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>528</td><td>shop keeper</td><td>0</td><td>he sells weapons</td><td>-</td></tr> <tr><td>529</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>530</td><td>Frenita</td><td>0</td><td>runs a cookery shop</td><td>-</td></tr> <tr><td>531</td><td>Ogre chieftan</td><td>78</td><td>A slightly bigger uglier ogre</td><td>X</td></tr> <tr><td>532</td><td>rometti</td><td>3</td><td>It's a well dressed tree gnome</td><td>-</td></tr> <tr><td>533</td><td>Rashiliyia</td><td>80</td><td>A willowy ethereal being who floats above the ground</td><td>-</td></tr> <tr><td>534</td><td>Blurberry</td><td>3</td><td>It's a red faced tree gnome</td><td>-</td></tr> <tr><td>535</td><td>Heckel funch</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>536</td><td>Aluft Gianne</td><td>3</td><td>It's a tree gnome chef</td><td>-</td></tr> <tr><td>537</td><td>Hudo glenfad</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>538</td><td>Irena</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>539</td><td>Mosol</td><td>0</td><td>A jungle warrior</td><td>-</td></tr> <tr><td>540</td><td>Gnome banker</td><td>3</td><td>It's tree gnome banker</td><td>-</td></tr> <tr><td>541</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>542</td><td>UndeadOne</td><td>62</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>543</td><td>Drucas</td><td>20</td><td>engraver</td><td>-</td></tr> <tr><td>544</td><td>tourist</td><td>29</td><td>human</td><td>-</td></tr> <tr><td>545</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>546</td><td>Hazelmere</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>547</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>548</td><td>Shar</td><td>0</td><td>Concerned about the economy</td><td>-</td></tr> <tr><td>549</td><td>Shantay</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>550</td><td>charlie</td><td>0</td><td>Poor guy?</td><td>X</td></tr> <tr><td>551</td><td>Gnome guard</td><td>31</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>552</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>553</td><td>Mehman</td><td>29</td><td>local</td><td>-</td></tr> <tr><td>554</td><td>Ana</td><td>16</td><td>This lady doesn't look as if she belongs here.</td><td>-</td></tr> <tr><td>555</td><td>Chaos Druid warrior</td><td>44</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>556</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>557</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>558</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>559</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>560</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>561</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>562</td><td>Gnome guard</td><td>23</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>563</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>564</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>565</td><td>Anita</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>566</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>567</td><td>Salarin the twisted</td><td>69</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>568</td><td>Black Demon</td><td>175</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>569</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>570</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>571</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>572</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>573</td><td>Sigbert the Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>574</td><td>Yanille Watchman</td><td>33</td><td>He watches out for invading ogres</td><td>X</td></tr> <tr><td>575</td><td>Tower guard</td><td>33</td><td>He stops people going up the tower</td><td>-</td></tr> <tr><td>576</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>577</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>578</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>579</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>580</td><td>Blurberry barman</td><td>3</td><td>He serves cocktails</td><td>-</td></tr> <tr><td>581</td><td>Gnome waiter</td><td>3</td><td>He can serve you gnome food</td><td>-</td></tr> <tr><td>582</td><td>Gnome guard</td><td>27</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>583</td><td>Gnome child</td><td>3</td><td>that's a little gnome</td><td>X</td></tr> <tr><td>584</td><td>Earth warrior</td><td>52</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>585</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>X</td></tr> <tr><td>586</td><td>Gnome child</td><td>3</td><td>hello little gnome</td><td>X</td></tr> <tr><td>587</td><td>Gulluck</td><td>10</td><td>He sells weapons</td><td>-</td></tr> <tr><td>588</td><td>Gunnjorn</td><td>16</td><td>Not civilised looking</td><td>-</td></tr> <tr><td>589</td><td>Zadimus</td><td>0</td><td>Ghostly Visage of the dead Zadimus</td><td>-</td></tr> <tr><td>590</td><td>Brimstail</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>591</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>-</td></tr> <tr><td>592</td><td>Gnome local</td><td>9</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>593</td><td>Gnome local</td><td>3</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>594</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>595</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>596</td><td>Goalie</td><td>70</td><td>A gnome ball goal catcher</td><td>-</td></tr> <tr><td>597</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>598</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>599</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>600</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>601</td><td>Referee</td><td>3</td><td>He controls the game</td><td>-</td></tr> <tr><td>602</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>603</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>604</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>605</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>606</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>607</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>608</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>609</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>610</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>611</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>612</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>613</td><td>Nazastarool Zombie</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>614</td><td>Nazastarool Skeleton</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>615</td><td>Nazastarool Ghost</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>616</td><td>Fernahei</td><td>6</td><td>An enthusiastic fishing shop owner</td><td>-</td></tr> <tr><td>617</td><td>Jungle Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>618</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>619</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>620</td><td>Obli</td><td>0</td><td>An intelligent looking shop owner</td><td>-</td></tr> <tr><td>621</td><td>Kaleb</td><td>0</td><td>This is Kaleb Paramaya - a warm and friendly inn owner</td><td>-</td></tr> <tr><td>622</td><td>Yohnus</td><td>0</td><td>This is Yohnus - he runs the local blacksmiths</td><td>-</td></tr> <tr><td>623</td><td>Serevel</td><td>0</td><td>This is Serevel - he sells tickets for the 'Lady of the Waves'</td><td>-</td></tr> <tr><td>624</td><td>Yanni</td><td>0</td><td>Yanni Salika - He buys and sells antiques.</td><td>-</td></tr> <tr><td>625</td><td>Official</td><td>3</td><td>He helps the referee</td><td>-</td></tr> <tr><td>626</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>627</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>628</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>629</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>630</td><td>Blessed Vermen</td><td>14</td><td>A undead servent of iban</td><td>X</td></tr> <tr><td>631</td><td>Blessed Spider</td><td>35</td><td>One of iban's eight legged friends</td><td>X</td></tr> <tr><td>632</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>633</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>634</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>635</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>636</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>637</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>638</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>639</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>640</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>641</td><td>Kalrag</td><td>78</td><td>I think this is one of Ibans pets</td><td>X</td></tr> <tr><td>642</td><td>Niloof</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>643</td><td>Kardia the Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>644</td><td>Souless</td><td>16</td><td>He seems an empty shell</td><td>X</td></tr> <tr><td>645</td><td>Othainian</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>646</td><td>Doomion</td><td>98</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>647</td><td>Holthion</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>648</td><td>Klank</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>649</td><td>Iban</td><td>21</td><td>You feel terror just looking at him</td><td>-</td></tr> <tr><td>650</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>651</td><td>Goblin guard</td><td>48</td><td>An imposing green creature</td><td>X</td></tr> <tr><td>652</td><td>Observatory Professor</td><td>4</td><td>He works in the observatory</td><td>-</td></tr> <tr><td>653</td><td>Ugthanki</td><td>45</td><td>A dangerous type of spitting camel that can temporarily blind an opponent.</td><td>X</td></tr> <tr><td>654</td><td>Observatory assistant</td><td>4</td><td>The Professor's assistant</td><td>-</td></tr> <tr><td>655</td><td>Souless</td><td>24</td><td>A servent to zamorak</td><td>X</td></tr> <tr><td>656</td><td>Dungeon spider</td><td>22</td><td>A nasty poisonous arachnid</td><td>X</td></tr> <tr><td>657</td><td>Kamen</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>658</td><td>Iban disciple</td><td>19</td><td>An evil follower of Iban</td><td>X</td></tr> <tr><td>659</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>660</td><td>Goblin</td><td>19</td><td>These goblins have grown strong</td><td>X</td></tr> <tr><td>661</td><td>Chadwell</td><td>16</td><td>A sturdy looking gent</td><td>-</td></tr> <tr><td>662</td><td>Professor</td><td>4</td><td>The owner of the observatory</td><td>-</td></tr> <tr><td>663</td><td>San Tojalon</td><td>120</td><td>The animated spirit of San Tojalon</td><td>X</td></tr> <tr><td>664</td><td>Ghost</td><td>29</td><td>A doomed victim of zamorak</td><td>X</td></tr> <tr><td>665</td><td>Spirit of Scorpius</td><td>100</td><td>The undead spirit of the follower of Zamorak</td><td>-</td></tr> <tr><td>666</td><td>Scorpion</td><td>21</td><td>There are nasty scorpions around this grave</td><td>-</td></tr> <tr><td>667</td><td>Dark Mage</td><td>0</td><td>He works in the ways of dark magic</td><td>-</td></tr> <tr><td>668</td><td>Mercenary</td><td>50</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>669</td><td>Mercenary Captain</td><td>64</td><td>He's in control of the local guards.</td><td>X</td></tr> <tr><td>670</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>671</td><td>Mining Slave</td><td>16</td><td>A chained slave forced to mine rocks.</td><td>X</td></tr> <tr><td>672</td><td>Watchtower wizard</td><td>12</td><td>A learned man</td><td>-</td></tr> <tr><td>673</td><td>Ogre Shaman</td><td>100</td><td>An intelligent form of ogre</td><td>-</td></tr> <tr><td>674</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>675</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>676</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>677</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>678</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>679</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>680</td><td>Og</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>681</td><td>Grew</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>682</td><td>Toban</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>683</td><td>Gorad</td><td>78</td><td>A high ranking ogre official</td><td>X</td></tr> <tr><td>684</td><td>Ogre guard</td><td>96</td><td>this creature looks very tough</td><td>X</td></tr> <tr><td>685</td><td>Yanille Watchman</td><td>33</td><td>A captured guard of Yanille</td><td>-</td></tr> <tr><td>686</td><td>Ogre merchant</td><td>58</td><td>He sells ogre-inspired items</td><td>-</td></tr> <tr><td>687</td><td>Ogre trader</td><td>58</td><td>He trades in metals</td><td>-</td></tr> <tr><td>688</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>689</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>690</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>691</td><td>City Guard</td><td>78</td><td>high ranking ogre guards</td><td>-</td></tr> <tr><td>692</td><td>Mercenary</td><td>39</td><td>He seems to be guarding this area</td><td>X</td></tr> <tr><td>693</td><td>Lawgof</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>694</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>695</td><td>lollk</td><td>18</td><td>He looks scared</td><td>-</td></tr> <tr><td>696</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>697</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>X</td></tr> <tr><td>698</td><td>Nulodion</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>699</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>700</td><td>Al Shabim</td><td>0</td><td>The leader of a nomadic Bedabin desert people - sometimes referred to as the 'Tenti's'</td><td>-</td></tr> <tr><td>701</td><td>Bedabin Nomad</td><td>0</td><td>A Bedabin nomad - they live in the harshest extremes in the desert</td><td>-</td></tr> <tr><td>702</td><td>Captain Siad</td><td>48</td><td>He's in control of the whole mining camp.</td><td>X</td></tr> <tr><td>703</td><td>Bedabin Nomad Guard</td><td>70</td><td>A Bedabin nomad guard - he's protecting something important</td><td>X</td></tr> <tr><td>704</td><td>Ogre citizen</td><td>58</td><td>A denizen of Gu'Tanoth</td><td>X</td></tr> <tr><td>705</td><td>Rock of ages</td><td>150</td><td>A huge boulder</td><td>X</td></tr> <tr><td>706</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>707</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>708</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>709</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>710</td><td>Draft Mercenary Guard</td><td>50</td><td>He's quickly drafted in to deal with trouble makers</td><td>X</td></tr> <tr><td>711</td><td>Mining Cart Driver</td><td>15</td><td>He drives the mining cart</td><td>-</td></tr> <tr><td>712</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>-</td></tr> <tr><td>713</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>X</td></tr> <tr><td>714</td><td>Gertrude</td><td>20</td><td>A busy housewife</td><td>-</td></tr> <tr><td>715</td><td>Shilop</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>716</td><td>Rowdy Guard</td><td>50</td><td>He looks as if he's spoiling for trouble</td><td>X</td></tr> <tr><td>717</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>X</td></tr> <tr><td>718</td><td>Rowdy Slave</td><td>16</td><td>A slave who's looking for trouble.</td><td>X</td></tr> <tr><td>719</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>-</td></tr> <tr><td>720</td><td>Assistant</td><td>0</td><td>He is an assistant to Shantay and helps him to run the pass.</td><td>-</td></tr> <tr><td>721</td><td>Desert Wolf</td><td>31</td><td>A vicious Desert wolf</td><td>X</td></tr> <tr><td>722</td><td>Workman</td><td>9</td><td>This person is working on the site</td><td>-</td></tr> <tr><td>723</td><td>Examiner</td><td>2</td><td>As you examine the examiner you examine that she is indeed an examiner!!</td><td>-</td></tr> <tr><td>724</td><td>Student</td><td>0</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>725</td><td>Student</td><td>20</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>726</td><td>Guide</td><td>12</td><td>This person specialises in panning for gold</td><td>-</td></tr> <tr><td>727</td><td>Student</td><td>18</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>728</td><td>Archaeological expert</td><td>15</td><td>An expert on archaeology!</td><td>-</td></tr> <tr><td>729</td><td>civillian</td><td>18</td><td>He looks aggitated!</td><td>X</td></tr> <tr><td>730</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>731</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>732</td><td>civillian</td><td>15</td><td>He looks aggitated!</td><td>-</td></tr> <tr><td>733</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>734</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>735</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>736</td><td>Legends Guild Guard</td><td>50</td><td>This guard is protecting the entrance to the Legends Guild.</td><td>-</td></tr> <tr><td>737</td><td>Escaping Mining Slave</td><td>16</td><td>An emancipated slave with cool Desert Clothes.</td><td>-</td></tr> <tr><td>738</td><td>Workman</td><td>9</td><td>This person is working in the mine</td><td>-</td></tr> <tr><td>739</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>740</td><td>Echned Zekin</td><td>50</td><td>An evil spirit of the underworld.</td><td>-</td></tr> <tr><td>741</td><td>Donovan the Handyman</td><td>9</td><td>It's the family odd jobs man</td><td>-</td></tr> <tr><td>742</td><td>Pierre the Dog Handler</td><td>9</td><td>It's the guy who looks after the family guard dog</td><td>-</td></tr> <tr><td>743</td><td>Hobbes the Butler</td><td>9</td><td>It's the family butler</td><td>-</td></tr> <tr><td>744</td><td>Louisa The Cook</td><td>0</td><td>It's the family cook</td><td>-</td></tr> <tr><td>745</td><td>Mary The Maid</td><td>25</td><td>The family maid</td><td>-</td></tr> <tr><td>746</td><td>Stanford The Gardener</td><td>8</td><td>It's the family Gardener</td><td>-</td></tr> <tr><td>747</td><td>Guard</td><td>28</td><td>He looks like he's in over his head here</td><td>-</td></tr> <tr><td>748</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>-</td></tr> <tr><td>749</td><td>Guard</td><td>8</td><td>***EMPTY PLEASE USE OR REPLACE***</td><td>-</td></tr> <tr><td>750</td><td>Man</td><td>9</td><td>A thirsty looking man</td><td>-</td></tr> <tr><td>751</td><td>Anna Sinclair</td><td>9</td><td>The first child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>752</td><td>Bob Sinclair</td><td>9</td><td>The second child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>753</td><td>Carol Sinclair</td><td>9</td><td>The third child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>754</td><td>David Sinclair</td><td>9</td><td>The fourth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>755</td><td>Elizabeth Sinclair</td><td>9</td><td>The fifth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>756</td><td>Frank Sinclair</td><td>9</td><td>The sixth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>757</td><td>kolodion</td><td>65</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>758</td><td>kolodion</td><td>68</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>759</td><td>kolodion</td><td>46</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>760</td><td>kolodion</td><td>98</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>761</td><td>Irvig Senay</td><td>125</td><td>The animated spirit of Irvig Senay</td><td>X</td></tr> <tr><td>762</td><td>Ranalph Devere</td><td>130</td><td>The animated spirit of Ranalph Devere</td><td>X</td></tr> <tr><td>763</td><td>Poison Salesman</td><td>7</td><td>Peter Potter - Poison Purveyor</td><td>-</td></tr> <tr><td>764</td><td>Gujuo</td><td>60</td><td>A tall charismatic looking jungle native - he approaches with confidence</td><td>-</td></tr> <tr><td>765</td><td>Jungle Forester</td><td>15</td><td>A woodsman who specialises in large and exotic timber</td><td>-</td></tr> <tr><td>766</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman</td><td>X</td></tr> <tr><td>767</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman - he looks very strange with glowing red eyes...</td><td>X</td></tr> <tr><td>768</td><td>Death Wing</td><td>80</td><td>A supernatural creature of the underworld</td><td>X</td></tr> <tr><td>769</td><td>Nezikchened</td><td>172</td><td>An ancient powerful Demon of the Underworld...</td><td>X</td></tr> <tr><td>770</td><td>Dwarf Cannon engineer</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>771</td><td>Dwarf commander</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>772</td><td>Viyeldi</td><td>80</td><td>The spirit of a dead sorcerer</td><td>X</td></tr> <tr><td>773</td><td>Nurmof</td><td>18</td><td>He sells pickaxes</td><td>-</td></tr> <tr><td>774</td><td>Fatigue expert</td><td>10</td><td>He looks wide awake</td><td>-</td></tr> <tr><td>775</td><td>Karamja Wolf</td><td>61</td><td>A hungry</td><td>X</td></tr> <tr><td>776</td><td>Jungle Savage</td><td>87</td><td>A savage and fearless Jungle warrior</td><td>X</td></tr> <tr><td>777</td><td>Oomlie Bird</td><td>32</td><td>A variety of flightless jungle fowl - it has a sharp beak and a bad temper.</td><td>X</td></tr> <tr><td>778</td><td>Sidney Smith</td><td>30</td><td>Sidney Smith - Certification clerk</td><td>-</td></tr> <tr><td>779</td><td>Siegfried Erkle</td><td>25</td><td>An eccentric shop keeper - related to the Grand Vizier of the Legends Guild</td><td>-</td></tr> <tr><td>780</td><td>Tea seller</td><td>9</td><td>He has delicious tea to buy</td><td>-</td></tr> <tr><td>781</td><td>Wilough</td><td>0</td><td>A young son of gertrudes</td><td>-</td></tr> <tr><td>782</td><td>Philop</td><td>0</td><td>Gertrudes youngest</td><td>-</td></tr> <tr><td>783</td><td>Kanel</td><td>0</td><td>Gertrudes youngest's twin brother</td><td>-</td></tr> <tr><td>784</td><td>chamber guardian</td><td>15</td><td>He hasn't seen much sun latley</td><td>-</td></tr> <tr><td>785</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>786</td><td>Pit Scorpion</td><td>35</td><td>Very vicious little scorpions</td><td>X</td></tr> <tr><td>787</td><td>Shadow Warrior</td><td>64</td><td>A sinsistar shadowy figure</td><td>X</td></tr> <tr><td>788</td><td>Fionella</td><td>25</td><td>She runs the legend's general store</td><td>-</td></tr> <tr><td>789</td><td>Battle mage</td><td>52</td><td>He kills in the name of guthix</td><td>X</td></tr> <tr><td>790</td><td>Battle mage</td><td>52</td><td>He kills in the name of zamarok</td><td>X</td></tr> <tr><td>791</td><td>Battle mage</td><td>52</td><td>He kills in the name of Saradomin</td><td>X</td></tr> <tr><td>792</td><td>Gundai</td><td>15</td><td>He must get lonely out here</td><td>-</td></tr> <tr><td>793</td><td>Lundail</td><td>15</td><td>He sells rune stones</td><td>-</td></tr> 105 2011-06-20T04:34:17Z Admin 1 [[Category:NPCs]] <table border="1" cellpadding="3" cellspacing="3"> <tr><td><b>id</b></td><td><b>npc name</b></td><td><b>level</b></td><td><b>description</b></td><td><b>attackable</b></td></tr> <tr><td>0</td><td>Unicorn</td><td>21</td><td>It's a unicorn</td><td>X</td></tr> <tr><td>1</td><td>Bob</td><td>2</td><td>An axe seller</td><td>-</td></tr> <tr><td>2</td><td>Sheep</td><td>0</td><td>A very wooly sheep</td><td>-</td></tr> <tr><td>3</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>X</td></tr> <tr><td>4</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>5</td><td>Hans</td><td>3</td><td>A castle servant</td><td>X</td></tr> <tr><td>6</td><td>cow</td><td>8</td><td>It's a multi purpose cow</td><td>X</td></tr> <tr><td>7</td><td>cook</td><td>15</td><td>The head cook of Lumbridge castle</td><td>-</td></tr> <tr><td>8</td><td>Bear</td><td>24</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>9</td><td>Priest</td><td>0</td><td>A priest of Saradomin</td><td>-</td></tr> <tr><td>10</td><td>Urhney</td><td>8</td><td>He looks a little grumpy</td><td>-</td></tr> <tr><td>11</td><td>Man</td><td>9</td><td>One of runescapes many citizens</td><td>X</td></tr> <tr><td>12</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>13</td><td>Camel</td><td>0</td><td>Oh its a camel</td><td>-</td></tr> <tr><td>14</td><td>Gypsy</td><td>0</td><td>An old gypsy lady</td><td>-</td></tr> <tr><td>15</td><td>Ghost</td><td>12</td><td>Ooh spooky</td><td>-</td></tr> <tr><td>16</td><td>Sir Prysin</td><td>40</td><td>One of the king's knights</td><td>-</td></tr> <tr><td>17</td><td>Traiborn the wizard</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>18</td><td>Captain Rovin</td><td>51</td><td>The head of the palace guard</td><td>-</td></tr> <tr><td>19</td><td>Rat</td><td>8</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>20</td><td>Reldo</td><td>12</td><td>I think he's the librarian</td><td>-</td></tr> <tr><td>21</td><td>mugger</td><td>10</td><td>He jumps out and attacks people</td><td>X</td></tr> <tr><td>22</td><td>Lesser Demon</td><td>79</td><td>Lesser but still pretty big</td><td>X</td></tr> <tr><td>23</td><td>Giant Spider</td><td>8</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>24</td><td>Man</td><td>30</td><td>A shifty looking man</td><td>-</td></tr> <tr><td>25</td><td>Jonny the beard</td><td>10</td><td>I can see why he's called the beard</td><td>X</td></tr> <tr><td>26</td><td>Baraek</td><td>30</td><td>A fur trader</td><td>-</td></tr> <tr><td>27</td><td>Katrine</td><td>25</td><td>She doesn't look to friendly</td><td>-</td></tr> <tr><td>28</td><td>Tramp</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>29</td><td>Rat</td><td>2</td><td>A small muddy rat</td><td>X</td></tr> <tr><td>30</td><td>Romeo</td><td>45</td><td>He looks mildly confused</td><td>-</td></tr> <tr><td>31</td><td>Juliet</td><td>2</td><td>She looks a little stressed</td><td>-</td></tr> <tr><td>32</td><td>Father Lawrence</td><td>0</td><td>A kindly looking priest</td><td>-</td></tr> <tr><td>33</td><td>Apothecary</td><td>6</td><td>I wonder if he has any good potions</td><td>-</td></tr> <tr><td>34</td><td>spider</td><td>2</td><td>Incey wincey</td><td>X</td></tr> <tr><td>35</td><td>Delrith</td><td>30</td><td>A freshly summoned demon</td><td>X</td></tr> <tr><td>36</td><td>Veronica</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>37</td><td>Weaponsmaster</td><td>25</td><td>The phoenix gang quartermaster</td><td>X</td></tr> <tr><td>38</td><td>Professor Oddenstein</td><td>4</td><td>A mad scientist if I ever saw one</td><td>-</td></tr> <tr><td>39</td><td>Curator</td><td>2</td><td>He looks like he's daydreaming</td><td>-</td></tr> <tr><td>40</td><td>skeleton</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>41</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>42</td><td>king</td><td>30</td><td>King Roald the VIII</td><td>-</td></tr> <tr><td>43</td><td>Giant bat</td><td>32</td><td>An angry flying rodent</td><td>X</td></tr> <tr><td>44</td><td>Bartender</td><td>0</td><td>A friendly barman</td><td>-</td></tr> <tr><td>45</td><td>skeleton</td><td>31</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>46</td><td>skeleton</td><td>25</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>47</td><td>Rat</td><td>13</td><td>overgrown vermin</td><td>X</td></tr> <tr><td>48</td><td>Horvik the Armourer</td><td>16</td><td>He looks strong</td><td>-</td></tr> <tr><td>49</td><td>Bear</td><td>0</td><td>A bear</td><td>-</td></tr> <tr><td>50</td><td>skeleton</td><td>19</td><td>It rattles when it walks</td><td>X</td></tr> <tr><td>51</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>52</td><td>zombie</td><td>19</td><td>The living dead</td><td>X</td></tr> <tr><td>53</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>54</td><td>Aubury</td><td>0</td><td>I think he might be a shop keeper</td><td>-</td></tr> <tr><td>55</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>56</td><td>shopkeeper</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>57</td><td>Darkwizard</td><td>13</td><td>He works evil magic</td><td>X</td></tr> <tr><td>58</td><td>lowe</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>59</td><td>Thessalia</td><td>0</td><td>A young shop assistant</td><td>-</td></tr> <tr><td>60</td><td>Darkwizard</td><td>25</td><td>He works evil magic</td><td>X</td></tr> <tr><td>61</td><td>Giant</td><td>37</td><td>A very large foe</td><td>X</td></tr> <tr><td>62</td><td>Goblin</td><td>7</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>63</td><td>farmer</td><td>15</td><td>He grows the crops in this area</td><td>X</td></tr> <tr><td>64</td><td>Thief</td><td>21</td><td>He'll take anything that isn't nailed down</td><td>X</td></tr> <tr><td>65</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>X</td></tr> <tr><td>66</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>67</td><td>Hobgoblin</td><td>32</td><td>A large ugly green creature</td><td>X</td></tr> <tr><td>68</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>69</td><td>Zaff</td><td>0</td><td>He trades in staffs</td><td>-</td></tr> <tr><td>70</td><td>Scorpion</td><td>21</td><td>An extremely vicious scorpion</td><td>X</td></tr> <tr><td>71</td><td>silk trader</td><td>0</td><td>He sells silk</td><td>-</td></tr> <tr><td>72</td><td>Man</td><td>9</td><td>One of Runescapes many citizens</td><td>X</td></tr> <tr><td>73</td><td>Guide</td><td>1</td><td>He gives hints to new adventurers</td><td>-</td></tr> <tr><td>74</td><td>Giant Spider</td><td>31</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>75</td><td>Peksa</td><td>9</td><td>A helmet salesman</td><td>-</td></tr> <tr><td>76</td><td>Barbarian</td><td>16</td><td>Not civilised looking</td><td>X</td></tr> <tr><td>77</td><td>Fred the farmer</td><td>9</td><td>An old farmer</td><td>-</td></tr> <tr><td>78</td><td>Gunthor the Brave</td><td>37</td><td>The barbarians fearless leader</td><td>X</td></tr> <tr><td>79</td><td>Witch</td><td>25</td><td>She's got warts</td><td>X</td></tr> <tr><td>80</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>81</td><td>Wizard</td><td>16</td><td>An old wizard</td><td>X</td></tr> <tr><td>82</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>83</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>84</td><td>Zeke</td><td>0</td><td>He sells Scimitars</td><td>-</td></tr> <tr><td>85</td><td>Louie Legs</td><td>0</td><td>He might want to sell something</td><td>-</td></tr> <tr><td>86</td><td>Warrior</td><td>18</td><td>A member of Al Kharid's military</td><td>X</td></tr> <tr><td>87</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>88</td><td>Shop Assistant</td><td>0</td><td>Maybe she'd like to buy some of my junk</td><td>-</td></tr> <tr><td>89</td><td>Highwayman</td><td>13</td><td>He holds up passers by</td><td>X</td></tr> <tr><td>90</td><td>Kebab Seller</td><td>0</td><td>A seller of strange food</td><td>-</td></tr> <tr><td>91</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>-</td></tr> <tr><td>92</td><td>Ernest</td><td>3</td><td>A former chicken</td><td>-</td></tr> <tr><td>93</td><td>Monk</td><td>13</td><td>A Peaceful monk</td><td>X</td></tr> <tr><td>94</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>95</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>96</td><td>Count Draynor</td><td>43</td><td>A vicious vampire</td><td>X</td></tr> <tr><td>97</td><td>Morgan</td><td>9</td><td>A frigtened villager</td><td>-</td></tr> <tr><td>98</td><td>Dr Harlow</td><td>9</td><td>His nose is very red</td><td>-</td></tr> <tr><td>99</td><td>Deadly Red spider</td><td>36</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>100</td><td>Guard</td><td>28</td><td>He's here to guard this fortress</td><td>X</td></tr> <tr><td>101</td><td>Cassie</td><td>25</td><td>She sells shields</td><td>-</td></tr> <tr><td>102</td><td>White Knight</td><td>56</td><td>A chivalrous knight</td><td>X</td></tr> <tr><td>103</td><td>Ranael</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>104</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>105</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>106</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>107</td><td>Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>108</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>109</td><td>Greldo</td><td>7</td><td>A small green warty creature</td><td>X</td></tr> <tr><td>110</td><td>Sir Amik Varze</td><td>56</td><td>The leader of the white knights</td><td>-</td></tr> <tr><td>111</td><td>Guildmaster</td><td>40</td><td>He's in charge of this place</td><td>-</td></tr> <tr><td>112</td><td>Valaine</td><td>25</td><td>She runs the champion's store</td><td>-</td></tr> <tr><td>113</td><td>Drogo</td><td>18</td><td>He runs a mining store</td><td>-</td></tr> <tr><td>114</td><td>Imp</td><td>5</td><td>A cheeky little imp</td><td>X</td></tr> <tr><td>115</td><td>Flynn</td><td>16</td><td>The mace salesman</td><td>-</td></tr> <tr><td>116</td><td>Wyson the gardener</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>117</td><td>Wizard Mizgog</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>118</td><td>Prince Ali</td><td>20</td><td>A young prince</td><td>-</td></tr> <tr><td>119</td><td>Hassan</td><td>20</td><td>the Chancellor to the emir</td><td>-</td></tr> <tr><td>120</td><td>Osman</td><td>20</td><td>He looks a little shifty</td><td>-</td></tr> <tr><td>121</td><td>Joe</td><td>40</td><td>Lady Keli's head guard</td><td>-</td></tr> <tr><td>122</td><td>Leela</td><td>20</td><td>She comes from Al Kharid</td><td>-</td></tr> <tr><td>123</td><td>Lady Keli</td><td>20</td><td>An Infamous bandit</td><td>-</td></tr> <tr><td>124</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>125</td><td>Aggie</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>126</td><td>Prince Ali</td><td>10</td><td>That is an effective disguise</td><td>-</td></tr> <tr><td>127</td><td>Jailguard</td><td>34</td><td>I wonder what he's guarding</td><td>X</td></tr> <tr><td>128</td><td>Redbeard Frank</td><td>25</td><td>A pirate</td><td>-</td></tr> <tr><td>129</td><td>Wydin</td><td>0</td><td>A grocer</td><td>-</td></tr> <tr><td>130</td><td>shop assistant</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>131</td><td>Brian</td><td>0</td><td>An axe seller</td><td>-</td></tr> <tr><td>132</td><td>squire</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>133</td><td>Head chef</td><td>15</td><td>He looks after the chef's guild</td><td>-</td></tr> <tr><td>134</td><td>Thurgo</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>135</td><td>Ice Giant</td><td>68</td><td>He's got icicles in his beard</td><td>X</td></tr> <tr><td>136</td><td>King Scorpion</td><td>36</td><td>Wow scorpions shouldn't grow that big</td><td>X</td></tr> <tr><td>137</td><td>Pirate</td><td>27</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>138</td><td>Sir Vyvin</td><td>56</td><td>One of the white knights of Falador</td><td>-</td></tr> <tr><td>139</td><td>Monk of Zamorak</td><td>29</td><td>An evil cleric</td><td>X</td></tr> <tr><td>140</td><td>Monk of Zamorak</td><td>19</td><td>An evil cleric</td><td>X</td></tr> <tr><td>141</td><td>Wayne</td><td>16</td><td>An armourer</td><td>-</td></tr> <tr><td>142</td><td>Barmaid</td><td>25</td><td>a pretty barmaid</td><td>-</td></tr> <tr><td>143</td><td>Dwarven shopkeeper</td><td>18</td><td>I wonder if he wants to buy any of my junk</td><td>-</td></tr> <tr><td>144</td><td>Doric</td><td>18</td><td>A dwarven smith</td><td>-</td></tr> <tr><td>145</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>146</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>147</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>148</td><td>Hetty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>149</td><td>Betty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>150</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>151</td><td>General wartface</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>152</td><td>General Bentnoze</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>153</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>154</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>155</td><td>Herquin</td><td>0</td><td>A gem merchant</td><td>-</td></tr> <tr><td>156</td><td>Rommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>157</td><td>Grum</td><td>0</td><td>Grum the goldsmith</td><td>-</td></tr> <tr><td>158</td><td>Ice warrior</td><td>57</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>159</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>160</td><td>Thrander</td><td>16</td><td>A smith of some sort</td><td>-</td></tr> <tr><td>161</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>162</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>163</td><td>Customs Officer</td><td>16</td><td>She is here to stop smugglers</td><td>-</td></tr> <tr><td>164</td><td>Luthas</td><td>16</td><td>The owner of the banana plantation</td><td>-</td></tr> <tr><td>165</td><td>Zambo</td><td>16</td><td>He will sell me exotic rum</td><td>-</td></tr> <tr><td>166</td><td>Captain Tobias</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>167</td><td>Gerrant</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>168</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>169</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>170</td><td>Seaman Lorris</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>171</td><td>Seaman Thresnor</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>172</td><td>Tanner</td><td>45</td><td>He makes leather</td><td>-</td></tr> <tr><td>173</td><td>Dommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>174</td><td>Abbot Langley</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>175</td><td>Thordur</td><td>18</td><td>He runs a a tourist attraction</td><td>-</td></tr> <tr><td>176</td><td>Brother Jered</td><td>13</td><td>human</td><td>-</td></tr> <tr><td>177</td><td>Rat</td><td>13</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>178</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>179</td><td>skeleton</td><td>31</td><td>it rattles when it walks</td><td>X</td></tr> <tr><td>180</td><td>zombie</td><td>32</td><td>the living dead</td><td>X</td></tr> <tr><td>181</td><td>Lesser Demon</td><td>79</td><td>Lesser but still very big</td><td>X</td></tr> <tr><td>182</td><td>Melzar the mad</td><td>45</td><td>He looks totally insane</td><td>X</td></tr> <tr><td>183</td><td>Scavvo</td><td>10</td><td>He has lopsided eyes</td><td>-</td></tr> <tr><td>184</td><td>Greater Demon</td><td>87</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>185</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>186</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>187</td><td>Oziach</td><td>0</td><td>A strange little man</td><td>-</td></tr> <tr><td>188</td><td>Bear</td><td>26</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>189</td><td>Black Knight</td><td>46</td><td>An armoured follower of Zamorak</td><td>X</td></tr> <tr><td>190</td><td>chaos Dwarf</td><td>59</td><td>a dwarf gone bad</td><td>X</td></tr> <tr><td>191</td><td>dwarf</td><td>18</td><td>A dwarf who looks after the mining guild</td><td>-</td></tr> <tr><td>192</td><td>Wormbrain</td><td>7</td><td>Dumb even by goblin standards</td><td>X</td></tr> <tr><td>193</td><td>Klarense</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>194</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>195</td><td>skeleton</td><td>54</td><td>A Taller than normal skeleton</td><td>X</td></tr> <tr><td>196</td><td>Dragon</td><td>110</td><td>A powerful and ancient dragon</td><td>X</td></tr> <tr><td>197</td><td>Oracle</td><td>57</td><td>A mystic of unknown race</td><td>-</td></tr> <tr><td>198</td><td>Duke of Lumbridge</td><td>30</td><td>Duke Horacio of Lumbridge</td><td>-</td></tr> <tr><td>199</td><td>Dark Warrior</td><td>21</td><td>A warrior touched by chaos</td><td>X</td></tr> <tr><td>200</td><td>Druid</td><td>29</td><td>A worshipper of Guthix</td><td>X</td></tr> <tr><td>201</td><td>Red Dragon</td><td>140</td><td>A big powerful dragon</td><td>X</td></tr> <tr><td>202</td><td>Blue Dragon</td><td>105</td><td>A mother dragon</td><td>X</td></tr> <tr><td>203</td><td>Baby Blue Dragon</td><td>50</td><td>Young but still dangerous</td><td>X</td></tr> <tr><td>204</td><td>Kaqemeex</td><td>29</td><td>A wise druid</td><td>-</td></tr> <tr><td>205</td><td>Sanfew</td><td>29</td><td>An old druid</td><td>-</td></tr> <tr><td>206</td><td>Suit of armour</td><td>29</td><td>A dusty old suit of armour</td><td>-</td></tr> <tr><td>207</td><td>Adventurer</td><td>13</td><td>A cleric</td><td>-</td></tr> <tr><td>208</td><td>Adventurer</td><td>12</td><td>A wizard</td><td>-</td></tr> <tr><td>209</td><td>Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>210</td><td>Adventurer</td><td>25</td><td>An archer</td><td>-</td></tr> <tr><td>211</td><td>Leprechaun</td><td>18</td><td>A funny little man who lives in a tree</td><td>-</td></tr> <tr><td>212</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>213</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>214</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>215</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>216</td><td>tree spirit</td><td>95</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>217</td><td>cow</td><td>8</td><td>It's a dairy cow</td><td>-</td></tr> <tr><td>218</td><td>Irksol</td><td>2</td><td>Is he invisible or just a set of floating clothes?</td><td>-</td></tr> <tr><td>219</td><td>Fairy Lunderwin</td><td>2</td><td>A fairy merchant</td><td>-</td></tr> <tr><td>220</td><td>Jakut</td><td>2</td><td>An unusual looking merchant</td><td>-</td></tr> <tr><td>221</td><td>Doorman</td><td>56</td><td>He guards the entrance to the faerie market</td><td>-</td></tr> <tr><td>222</td><td>Fairy Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>223</td><td>Fairy Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>224</td><td>Fairy banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>225</td><td>Giles</td><td>30</td><td>He runs an ore exchange store</td><td>-</td></tr> <tr><td>226</td><td>Miles</td><td>30</td><td>He runs a bar exchange store</td><td>-</td></tr> <tr><td>227</td><td>Niles</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>228</td><td>Gaius</td><td>16</td><td>he sells very big swords</td><td>-</td></tr> <tr><td>229</td><td>Fairy Ladder attendant</td><td>0</td><td>A worker in the faerie market</td><td>-</td></tr> <tr><td>230</td><td>Jatix</td><td>29</td><td>A hard working druid</td><td>-</td></tr> <tr><td>231</td><td>Master Crafter</td><td>0</td><td>The man in charge of the crafter's guild</td><td>-</td></tr> <tr><td>232</td><td>Bandit</td><td>29</td><td>He's ready for a fight</td><td>X</td></tr> <tr><td>233</td><td>Noterazzo</td><td>29</td><td>A bandit shopkeeper</td><td>-</td></tr> <tr><td>234</td><td>Bandit</td><td>29</td><td>A wilderness outlaw</td><td>X</td></tr> <tr><td>235</td><td>Fat Tony</td><td>15</td><td>A Gourmet Pizza chef</td><td>-</td></tr> <tr><td>236</td><td>Donny the lad</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>237</td><td>Black Heather</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>238</td><td>Speedy Keith</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>239</td><td>White wolf sentry</td><td>31</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>240</td><td>Boy</td><td>39</td><td>He doesn't seem very happy</td><td>-</td></tr> <tr><td>241</td><td>Rat</td><td>2</td><td>He seems to live here</td><td>-</td></tr> <tr><td>242</td><td>Nora T Hag</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>243</td><td>Grey wolf</td><td>64</td><td>A sinister looking wolf</td><td>X</td></tr> <tr><td>244</td><td>shapeshifter</td><td>24</td><td>I've not seen anyone like this before</td><td>X</td></tr> <tr><td>245</td><td>shapeshifter</td><td>34</td><td>I think this spider has been genetically modified</td><td>-</td></tr> <tr><td>246</td><td>shapeshifter</td><td>44</td><td>Eek! A bear!</td><td>-</td></tr> <tr><td>247</td><td>shapeshifter</td><td>54</td><td>A sinister looking wolf</td><td>-</td></tr> <tr><td>248</td><td>White wolf</td><td>41</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>249</td><td>Pack leader</td><td>71</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>250</td><td>Harry</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>251</td><td>Thug</td><td>18</td><td>He likes hitting things</td><td>X</td></tr> <tr><td>252</td><td>Firebird</td><td>6</td><td>Probably not a chicken</td><td>X</td></tr> <tr><td>253</td><td>Achetties</td><td>46</td><td>One of Asgarnia's greatest heros</td><td>-</td></tr> <tr><td>254</td><td>Ice queen</td><td>103</td><td>The leader of the ice warriors</td><td>X</td></tr> <tr><td>255</td><td>Grubor</td><td>15</td><td>A rough looking thief</td><td>-</td></tr> <tr><td>256</td><td>Trobert</td><td>13</td><td>A well dressed thief</td><td>-</td></tr> <tr><td>257</td><td>Garv</td><td>28</td><td>A diligent guard</td><td>-</td></tr> <tr><td>258</td><td>guard</td><td>27</td><td>A vicious pirate</td><td>-</td></tr> <tr><td>259</td><td>Grip</td><td>46</td><td>Scar face petes head guard</td><td>X</td></tr> <tr><td>260</td><td>Alfonse the waiter</td><td>9</td><td>He should get a clean apron</td><td>-</td></tr> <tr><td>261</td><td>Charlie the cook</td><td>15</td><td>Head cook of the Shrimp and parrot</td><td>-</td></tr> <tr><td>262</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>X</td></tr> <tr><td>263</td><td>Ice spider</td><td>64</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>264</td><td>Pirate</td><td>30</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>265</td><td>Jailer</td><td>51</td><td>Guards prisoners for the black knights</td><td>X</td></tr> <tr><td>266</td><td>Lord Darquarius</td><td>76</td><td>A black knight commander</td><td>X</td></tr> <tr><td>267</td><td>Seth</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>268</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>269</td><td>Helemos</td><td>46</td><td>A retired hero</td><td>-</td></tr> <tr><td>270</td><td>Chaos Druid</td><td>19</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>271</td><td>Poison Scorpion</td><td>26</td><td>It has a very vicious looking tail</td><td>X</td></tr> <tr><td>272</td><td>Velrak the explorer</td><td>3</td><td>he looks cold and hungry</td><td>-</td></tr> <tr><td>273</td><td>Sir Lancelot</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>274</td><td>Sir Gawain</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>275</td><td>King Arthur</td><td>56</td><td>A wise old king</td><td>-</td></tr> <tr><td>276</td><td>Sir Mordred</td><td>58</td><td>An evil knight</td><td>X</td></tr> <tr><td>277</td><td>Renegade knight</td><td>51</td><td>He isn't very friendly</td><td>X</td></tr> <tr><td>278</td><td>Davon</td><td>27</td><td>An amulet trader</td><td>-</td></tr> <tr><td>279</td><td>Bartender</td><td>0</td><td>I could get some grog off him</td><td>-</td></tr> <tr><td>280</td><td>Arhein</td><td>0</td><td>A merchant</td><td>-</td></tr> <tr><td>281</td><td>Morgan le faye</td><td>25</td><td>An evil sorceress</td><td>-</td></tr> <tr><td>282</td><td>Candlemaker</td><td>16</td><td>He makes and sells candles</td><td>-</td></tr> <tr><td>283</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>284</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>285</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>286</td><td>Beggar</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>287</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>288</td><td>Thrantax</td><td>90</td><td>A freshly summoned demon</td><td>-</td></tr> <tr><td>289</td><td>Hickton</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>290</td><td>Black Demon</td><td>156</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>291</td><td>Black Dragon</td><td>200</td><td>A fierce dragon with black scales!</td><td>X</td></tr> <tr><td>292</td><td>Poison Spider</td><td>63</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>293</td><td>Monk of Zamorak</td><td>47</td><td>An evil cleric</td><td>X</td></tr> <tr><td>294</td><td>Hellhound</td><td>114</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>295</td><td>Animated axe</td><td>46</td><td>a magic axe with a mind of it's own</td><td>X</td></tr> <tr><td>296</td><td>Black Unicorn</td><td>31</td><td>It's a sort of unicorn</td><td>X</td></tr> <tr><td>297</td><td>Frincos</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>298</td><td>Otherworldly being</td><td>66</td><td>Is he invisible or just a set of floating clothes?</td><td>X</td></tr> <tr><td>299</td><td>Owen</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>300</td><td>Thormac the sorceror</td><td>25</td><td>A powerful sorcerrer</td><td>-</td></tr> <tr><td>301</td><td>Seer</td><td>16</td><td>An old wizard</td><td>-</td></tr> <tr><td>302</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>303</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>304</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>305</td><td>Barbarian guard</td><td>16</td><td>Not very civilised</td><td>-</td></tr> <tr><td>306</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>307</td><td>man</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>308</td><td>gem trader</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>309</td><td>Dimintheis</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>310</td><td>chef</td><td>15</td><td>A busy looking chef</td><td>-</td></tr> <tr><td>311</td><td>Hobgoblin</td><td>48</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>312</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>313</td><td>Boot the Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>314</td><td>Wizard</td><td>16</td><td>A young wizard</td><td>-</td></tr> <tr><td>315</td><td>Chronozon</td><td>121</td><td>Chronozon the blood demon</td><td>X</td></tr> <tr><td>316</td><td>Captain Barnaby</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>317</td><td>Customs Official</td><td>16</td><td>She's here to stop smugglers</td><td>-</td></tr> <tr><td>318</td><td>Man</td><td>9</td><td>One of Runescape's citizens</td><td>X</td></tr> <tr><td>319</td><td>farmer</td><td>15</td><td>An humble peasant</td><td>X</td></tr> <tr><td>320</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>321</td><td>Guard</td><td>28</td><td>He tries to keep the law and order around here</td><td>X</td></tr> <tr><td>322</td><td>Knight</td><td>56</td><td>A knight of Ardougne</td><td>X</td></tr> <tr><td>323</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>324</td><td>Hero</td><td>83</td><td>A Hero of Ardougne</td><td>X</td></tr> <tr><td>325</td><td>Baker</td><td>15</td><td>He sells hot baked bread</td><td>-</td></tr> <tr><td>326</td><td>silk merchant</td><td>0</td><td>He buys silk</td><td>-</td></tr> <tr><td>327</td><td>Fur trader</td><td>0</td><td>A buyer and seller of animal furs</td><td>-</td></tr> <tr><td>328</td><td>silver merchant</td><td>0</td><td>He deals in silver</td><td>-</td></tr> <tr><td>329</td><td>spice merchant</td><td>15</td><td>He sells exotic spices</td><td>-</td></tr> <tr><td>330</td><td>gem merchant</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>331</td><td>Zenesha</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>332</td><td>Kangai Mau</td><td>0</td><td>A tribesman</td><td>-</td></tr> <tr><td>333</td><td>Wizard Cromperty</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>334</td><td>RPDT employee</td><td>12</td><td>A delivery man</td><td>-</td></tr> <tr><td>335</td><td>Horacio</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>336</td><td>Aemad</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>337</td><td>Kortan</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>338</td><td>zoo keeper</td><td>20</td><td>He looks after Ardougne city zoo</td><td>X</td></tr> <tr><td>339</td><td>Make over mage</td><td>0</td><td>He can change how I look</td><td>-</td></tr> <tr><td>340</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>341</td><td>chuck</td><td>0</td><td>A wood merchant</td><td>-</td></tr> <tr><td>342</td><td>Rogue</td><td>21</td><td>He needs a shave</td><td>X</td></tr> <tr><td>343</td><td>Shadow spider</td><td>53</td><td>Is it a spider or is it a shadow</td><td>X</td></tr> <tr><td>344</td><td>Fire Giant</td><td>109</td><td>A big guy with red glowing skin</td><td>X</td></tr> <tr><td>345</td><td>Grandpa Jack</td><td>20</td><td>A wistful old man</td><td>-</td></tr> <tr><td>346</td><td>Sinister stranger</td><td>43</td><td>not your average fisherman</td><td>-</td></tr> <tr><td>347</td><td>Bonzo</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>348</td><td>Forester</td><td>21</td><td>He looks after McGrubor's wood</td><td>X</td></tr> <tr><td>349</td><td>Morris</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>350</td><td>Brother Omad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>351</td><td>Thief</td><td>21</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>352</td><td>Head Thief</td><td>34</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>353</td><td>Big Dave</td><td>15</td><td>A well built fisherman</td><td>-</td></tr> <tr><td>354</td><td>Joshua</td><td>15</td><td>A grumpy fisherman</td><td>-</td></tr> <tr><td>355</td><td>Mountain Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>356</td><td>Mountain Dwarf</td><td>28</td><td>A short angry guy</td><td>X</td></tr> <tr><td>357</td><td>Brother Cedric</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>358</td><td>Necromancer</td><td>34</td><td>A crazy evil necromancer</td><td>X</td></tr> <tr><td>359</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>360</td><td>Lucien</td><td>21</td><td>He walks with a slight limp</td><td>-</td></tr> <tr><td>361</td><td>The Fire warrior of lesarkus</td><td>63</td><td>A strange red humanoid</td><td>X</td></tr> <tr><td>362</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>363</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>364</td><td>Lucien</td><td>21</td><td>He walks with a limp</td><td>X</td></tr> <tr><td>365</td><td>winelda</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>366</td><td>Brother Kojo</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>367</td><td>Dungeon Rat</td><td>16</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>368</td><td>Master fisher</td><td>15</td><td>The man in charge of the fishing guild</td><td>-</td></tr> <tr><td>369</td><td>Orven</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>370</td><td>Padik</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>371</td><td>Shopkeeper</td><td>0</td><td>He smells of fish</td><td>-</td></tr> <tr><td>372</td><td>Lady servil</td><td>2</td><td>She look's wealthy</td><td>-</td></tr> <tr><td>373</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>374</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>375</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>376</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>377</td><td>Jeremy Servil</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>378</td><td>Justin Servil</td><td>0</td><td>Jeremy servil's father</td><td>-</td></tr> <tr><td>379</td><td>fightslave joe</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>380</td><td>fightslave kelvin</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>381</td><td>local</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>382</td><td>Khazard Bartender</td><td>0</td><td>A tough looking barman</td><td>-</td></tr> <tr><td>383</td><td>General Khazard</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>384</td><td>Khazard Ogre</td><td>58</td><td>Khazard's strongest ogre warrior</td><td>X</td></tr> <tr><td>385</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>386</td><td>Khazard Scorpion</td><td>46</td><td>A large angry scorpion</td><td>X</td></tr> <tr><td>387</td><td>hengrad</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>388</td><td>Bouncer</td><td>122</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>389</td><td>Stankers</td><td>0</td><td>A cheerful looking fellow</td><td>-</td></tr> <tr><td>390</td><td>Docky</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>391</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>392</td><td>Fairy queen</td><td>2</td><td>A very little queen</td><td>-</td></tr> <tr><td>393</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>394</td><td>Crone</td><td>25</td><td>A strange old lady</td><td>-</td></tr> <tr><td>395</td><td>High priest of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>396</td><td>elkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>397</td><td>remsai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>398</td><td>bolkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>399</td><td>local gnome</td><td>3</td><td>It's a young tree gnome</td><td>X</td></tr> <tr><td>400</td><td>bolren</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>401</td><td>Black Knight titan</td><td>146</td><td>He is blocking the way</td><td>X</td></tr> <tr><td>402</td><td>kalron</td><td>3</td><td>he look's lost</td><td>X</td></tr> <tr><td>403</td><td>brother Galahad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>404</td><td>tracker 1</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>405</td><td>tracker 2</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>406</td><td>tracker 3</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>407</td><td>Khazard troop</td><td>28</td><td>It's one of General Khazard's warrior's</td><td>X</td></tr> <tr><td>408</td><td>commander montai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>409</td><td>gnome troop</td><td>3</td><td>It's a tree gnome trooper</td><td>X</td></tr> <tr><td>410</td><td>khazard warlord</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>411</td><td>Sir Percival</td><td>56</td><td>He's covered in pieces of straw</td><td>-</td></tr> <tr><td>412</td><td>Fisher king</td><td>30</td><td>an old king</td><td>-</td></tr> <tr><td>413</td><td>maiden</td><td>2</td><td>She has a far away look in her eyes</td><td>-</td></tr> <tr><td>414</td><td>Fisherman</td><td>30</td><td>an old fisherman</td><td>-</td></tr> <tr><td>415</td><td>King Percival</td><td>56</td><td>The new fisher king</td><td>-</td></tr> <tr><td>416</td><td>unhappy peasant</td><td>25</td><td>He looks tired and hungry</td><td>X</td></tr> <tr><td>417</td><td>happy peasant</td><td>25</td><td>He looks well fed and full of energy</td><td>X</td></tr> <tr><td>418</td><td>ceril</td><td>9</td><td>It's Sir ceril carnillean a local noblemen</td><td>-</td></tr> <tr><td>419</td><td>butler</td><td>9</td><td>It's the carnillean family butler</td><td>-</td></tr> <tr><td>420</td><td>carnillean guard</td><td>28</td><td>It's a carnillean family guard</td><td>X</td></tr> <tr><td>421</td><td>Tribesman</td><td>39</td><td>A primative warrior</td><td>X</td></tr> <tr><td>422</td><td>henryeta</td><td>2</td><td>It's a wealthy looking woman</td><td>-</td></tr> <tr><td>423</td><td>philipe</td><td>0</td><td>It's a young well dressed boy</td><td>-</td></tr> <tr><td>424</td><td>clivet</td><td>20</td><td>A strange looking man in black </td><td>-</td></tr> <tr><td>425</td><td>cult member</td><td>20</td><td>An suspicous looking man in black </td><td>X</td></tr> <tr><td>426</td><td>Lord hazeel</td><td>100</td><td>He could do with some sun</td><td>X</td></tr> <tr><td>427</td><td>alomone</td><td>42</td><td>A musculer looking man in black </td><td>-</td></tr> <tr><td>428</td><td>Khazard commander</td><td>41</td><td>It's one of General Khazard's commander's</td><td>X</td></tr> <tr><td>429</td><td>claus</td><td>15</td><td>the carnillean family cook</td><td>-</td></tr> <tr><td>430</td><td>1st plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>431</td><td>2nd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>432</td><td>3rd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>433</td><td>4th plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>434</td><td>Farmer brumty</td><td>15</td><td>He looks after livestock in this area</td><td>-</td></tr> <tr><td>435</td><td>Doctor orbon</td><td>15</td><td>A local doctor</td><td>-</td></tr> <tr><td>436</td><td>Councillor Halgrive</td><td>20</td><td>A town counceller</td><td>-</td></tr> <tr><td>437</td><td>Edmond</td><td>20</td><td>A local civilian</td><td>-</td></tr> <tr><td>438</td><td>Citizen</td><td>11</td><td>He look's tired</td><td>X</td></tr> <tr><td>439</td><td>Citizen</td><td>10</td><td>He look's frightened</td><td>X</td></tr> <tr><td>440</td><td>Citizen</td><td>12</td><td>She look's frustrated</td><td>X</td></tr> <tr><td>441</td><td>Citizen</td><td>20</td><td>He look's angry</td><td>X</td></tr> <tr><td>442</td><td>Citizen</td><td>15</td><td>He look's disillusioned</td><td>X</td></tr> <tr><td>443</td><td>Jethick</td><td>15</td><td>A cynical old man</td><td>-</td></tr> <tr><td>444</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>445</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>446</td><td>Ted Rehnison</td><td>9</td><td>The head of the Rehnison family</td><td>-</td></tr> <tr><td>447</td><td>Martha Rehnison</td><td>12</td><td>A fairly poor looking woman</td><td>-</td></tr> <tr><td>448</td><td>Billy Rehnison</td><td>45</td><td>The Rehnisons eldest son</td><td>-</td></tr> <tr><td>449</td><td>Milli Rehnison</td><td>39</td><td>She doesn't seem very happy</td><td>-</td></tr> <tr><td>450</td><td>Alrena</td><td>2</td><td>She look's concerned</td><td>-</td></tr> <tr><td>451</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>452</td><td>Clerk</td><td>2</td><td>A bueracratic administrator</td><td>-</td></tr> <tr><td>453</td><td>Carla</td><td>2</td><td>She look's upset</td><td>-</td></tr> <tr><td>454</td><td>Bravek</td><td>30</td><td>The city warder of West Ardougne</td><td>-</td></tr> <tr><td>455</td><td>Caroline</td><td>2</td><td>A well dressed middle aged lady</td><td>-</td></tr> <tr><td>456</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>457</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>458</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>459</td><td>kent</td><td>45</td><td>caroline's husband</td><td>-</td></tr> <tr><td>460</td><td>bailey</td><td>15</td><td>the fishing platform cook</td><td>-</td></tr> <tr><td>461</td><td>kennith</td><td>0</td><td>A young scared looking boy</td><td>-</td></tr> <tr><td>462</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>463</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>464</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>465</td><td>Elena</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>466</td><td>jinno</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>467</td><td>Watto</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>468</td><td>Recruiter</td><td>51</td><td>A member of the Ardougne royal army</td><td>-</td></tr> <tr><td>469</td><td>Head mourner</td><td>2</td><td>In charge of people with silly outfits</td><td>-</td></tr> <tr><td>470</td><td>Almera</td><td>2</td><td>A woman of the wilderness</td><td>-</td></tr> <tr><td>471</td><td>hudon</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>472</td><td>hadley</td><td>30</td><td>A happy looking fellow</td><td>-</td></tr> <tr><td>473</td><td>Rat</td><td>7</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>474</td><td>Combat instructor</td><td>51</td><td>He will tell me how to fight</td><td>-</td></tr> <tr><td>475</td><td>golrie</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>476</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>477</td><td>King Black Dragon</td><td>245</td><td>The biggest meanest dragon around</td><td>X</td></tr> <tr><td>478</td><td>cooking instructor</td><td>15</td><td>Talk to him to learn about runescape food</td><td>-</td></tr> <tr><td>479</td><td>fishing instructor</td><td>15</td><td>He smells of fish</td><td>-</td></tr> <tr><td>480</td><td>financial advisor</td><td>0</td><td>He knows about money</td><td>-</td></tr> <tr><td>481</td><td>gerald</td><td>15</td><td>An old fisherman</td><td>-</td></tr> <tr><td>482</td><td>mining instructor</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>483</td><td>Elena</td><td>2</td><td>She looks concerned</td><td>-</td></tr> <tr><td>484</td><td>Omart</td><td>30</td><td>A nervous looking fellow</td><td>-</td></tr> <tr><td>485</td><td>Bank assistant</td><td>9</td><td>She can look after my stuff</td><td>-</td></tr> <tr><td>486</td><td>Jerico</td><td>15</td><td>He looks friendly enough</td><td>-</td></tr> <tr><td>487</td><td>Kilron</td><td>15</td><td>He looks shifty</td><td>-</td></tr> <tr><td>488</td><td>Guidor's wife</td><td>2</td><td>She looks rather concerned</td><td>-</td></tr> <tr><td>489</td><td>Quest advisor</td><td>51</td><td>I wonder what advise he has to impart</td><td>-</td></tr> <tr><td>490</td><td>chemist</td><td>4</td><td>human</td><td>-</td></tr> <tr><td>491</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>492</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>493</td><td>Wilderness guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>494</td><td>Magic Instructor</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>495</td><td>Mourner</td><td>22</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>496</td><td>Community instructor</td><td>2</td><td>This is the last advisor - honest</td><td>-</td></tr> <tr><td>497</td><td>boatman</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>498</td><td>skeleton mage</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>499</td><td>controls guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>500</td><td>nurse sarah</td><td>2</td><td>She's quite a looker</td><td>-</td></tr> <tr><td>501</td><td>Tailor</td><td>29</td><td>He's ready for a party</td><td>-</td></tr> <tr><td>502</td><td>Mourner</td><td>25</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>503</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>504</td><td>Chemist</td><td>29</td><td>He looks clever enough</td><td>-</td></tr> <tr><td>505</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>506</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>507</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>508</td><td>Guidor</td><td>29</td><td>He's not that ill</td><td>-</td></tr> <tr><td>509</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>510</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>511</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>512</td><td>king Lathas</td><td>30</td><td>King Lanthas of east ardounge</td><td>-</td></tr> <tr><td>513</td><td>Head wizard</td><td>12</td><td>He runs the wizards guild</td><td>-</td></tr> <tr><td>514</td><td>Magic store owner</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>515</td><td>Wizard Frumscone</td><td>12</td><td>A confused looking wizard</td><td>-</td></tr> <tr><td>516</td><td>target practice zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>517</td><td>Trufitus</td><td>6</td><td>A wise old witch doctor</td><td>-</td></tr> <tr><td>518</td><td>Colonel Radick</td><td>51</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>519</td><td>Soldier</td><td>28</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>520</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>521</td><td>Jungle Spider</td><td>47</td><td>A venomous deadly spider</td><td>X</td></tr> <tr><td>522</td><td>Jiminua</td><td>0</td><td>She looks very interested in selling some of her wares.</td><td>-</td></tr> <tr><td>523</td><td>Jogre</td><td>58</td><td>An aggressive humanoid</td><td>X</td></tr> <tr><td>524</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>525</td><td>Ogre</td><td>58</td><td>Useful for ranged training</td><td>X</td></tr> <tr><td>526</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>527</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>528</td><td>shop keeper</td><td>0</td><td>he sells weapons</td><td>-</td></tr> <tr><td>529</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>530</td><td>Frenita</td><td>0</td><td>runs a cookery shop</td><td>-</td></tr> <tr><td>531</td><td>Ogre chieftan</td><td>78</td><td>A slightly bigger uglier ogre</td><td>X</td></tr> <tr><td>532</td><td>rometti</td><td>3</td><td>It's a well dressed tree gnome</td><td>-</td></tr> <tr><td>533</td><td>Rashiliyia</td><td>80</td><td>A willowy ethereal being who floats above the ground</td><td>-</td></tr> <tr><td>534</td><td>Blurberry</td><td>3</td><td>It's a red faced tree gnome</td><td>-</td></tr> <tr><td>535</td><td>Heckel funch</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>536</td><td>Aluft Gianne</td><td>3</td><td>It's a tree gnome chef</td><td>-</td></tr> <tr><td>537</td><td>Hudo glenfad</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>538</td><td>Irena</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>539</td><td>Mosol</td><td>0</td><td>A jungle warrior</td><td>-</td></tr> <tr><td>540</td><td>Gnome banker</td><td>3</td><td>It's tree gnome banker</td><td>-</td></tr> <tr><td>541</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>542</td><td>UndeadOne</td><td>62</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>543</td><td>Drucas</td><td>20</td><td>engraver</td><td>-</td></tr> <tr><td>544</td><td>tourist</td><td>29</td><td>human</td><td>-</td></tr> <tr><td>545</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>546</td><td>Hazelmere</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>547</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>548</td><td>Shar</td><td>0</td><td>Concerned about the economy</td><td>-</td></tr> <tr><td>549</td><td>Shantay</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>550</td><td>charlie</td><td>0</td><td>Poor guy?</td><td>X</td></tr> <tr><td>551</td><td>Gnome guard</td><td>31</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>552</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>553</td><td>Mehman</td><td>29</td><td>local</td><td>-</td></tr> <tr><td>554</td><td>Ana</td><td>16</td><td>This lady doesn't look as if she belongs here.</td><td>-</td></tr> <tr><td>555</td><td>Chaos Druid warrior</td><td>44</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>556</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>557</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>558</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>559</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>560</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>561</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>562</td><td>Gnome guard</td><td>23</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>563</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>564</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>565</td><td>Anita</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>566</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>567</td><td>Salarin the twisted</td><td>69</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>568</td><td>Black Demon</td><td>175</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>569</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>570</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>571</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>572</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>573</td><td>Sigbert the Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>574</td><td>Yanille Watchman</td><td>33</td><td>He watches out for invading ogres</td><td>X</td></tr> <tr><td>575</td><td>Tower guard</td><td>33</td><td>He stops people going up the tower</td><td>-</td></tr> <tr><td>576</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>577</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>578</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>579</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>580</td><td>Blurberry barman</td><td>3</td><td>He serves cocktails</td><td>-</td></tr> <tr><td>581</td><td>Gnome waiter</td><td>3</td><td>He can serve you gnome food</td><td>-</td></tr> <tr><td>582</td><td>Gnome guard</td><td>27</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>583</td><td>Gnome child</td><td>3</td><td>that's a little gnome</td><td>X</td></tr> <tr><td>584</td><td>Earth warrior</td><td>52</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>585</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>X</td></tr> <tr><td>586</td><td>Gnome child</td><td>3</td><td>hello little gnome</td><td>X</td></tr> <tr><td>587</td><td>Gulluck</td><td>10</td><td>He sells weapons</td><td>-</td></tr> <tr><td>588</td><td>Gunnjorn</td><td>16</td><td>Not civilised looking</td><td>-</td></tr> <tr><td>589</td><td>Zadimus</td><td>0</td><td>Ghostly Visage of the dead Zadimus</td><td>-</td></tr> <tr><td>590</td><td>Brimstail</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>591</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>-</td></tr> <tr><td>592</td><td>Gnome local</td><td>9</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>593</td><td>Gnome local</td><td>3</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>594</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>595</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>596</td><td>Goalie</td><td>70</td><td>A gnome ball goal catcher</td><td>-</td></tr> <tr><td>597</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>598</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>599</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>600</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>601</td><td>Referee</td><td>3</td><td>He controls the game</td><td>-</td></tr> <tr><td>602</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>603</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>604</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>605</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>606</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>607</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>608</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>609</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>610</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>611</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>612</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>613</td><td>Nazastarool Zombie</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>614</td><td>Nazastarool Skeleton</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>615</td><td>Nazastarool Ghost</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>616</td><td>Fernahei</td><td>6</td><td>An enthusiastic fishing shop owner</td><td>-</td></tr> <tr><td>617</td><td>Jungle Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>618</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>619</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>620</td><td>Obli</td><td>0</td><td>An intelligent looking shop owner</td><td>-</td></tr> <tr><td>621</td><td>Kaleb</td><td>0</td><td>This is Kaleb Paramaya - a warm and friendly inn owner</td><td>-</td></tr> <tr><td>622</td><td>Yohnus</td><td>0</td><td>This is Yohnus - he runs the local blacksmiths</td><td>-</td></tr> <tr><td>623</td><td>Serevel</td><td>0</td><td>This is Serevel - he sells tickets for the 'Lady of the Waves'</td><td>-</td></tr> <tr><td>624</td><td>Yanni</td><td>0</td><td>Yanni Salika - He buys and sells antiques.</td><td>-</td></tr> <tr><td>625</td><td>Official</td><td>3</td><td>He helps the referee</td><td>-</td></tr> <tr><td>626</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>627</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>628</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>629</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>630</td><td>Blessed Vermen</td><td>14</td><td>A undead servent of iban</td><td>X</td></tr> <tr><td>631</td><td>Blessed Spider</td><td>35</td><td>One of iban's eight legged friends</td><td>X</td></tr> <tr><td>632</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>633</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>634</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>635</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>636</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>637</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>638</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>639</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>640</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>641</td><td>Kalrag</td><td>78</td><td>I think this is one of Ibans pets</td><td>X</td></tr> <tr><td>642</td><td>Niloof</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>643</td><td>Kardia the Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>644</td><td>Souless</td><td>16</td><td>He seems an empty shell</td><td>X</td></tr> <tr><td>645</td><td>Othainian</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>646</td><td>Doomion</td><td>98</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>647</td><td>Holthion</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>648</td><td>Klank</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>649</td><td>Iban</td><td>21</td><td>You feel terror just looking at him</td><td>-</td></tr> <tr><td>650</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>651</td><td>Goblin guard</td><td>48</td><td>An imposing green creature</td><td>X</td></tr> <tr><td>652</td><td>Observatory Professor</td><td>4</td><td>He works in the observatory</td><td>-</td></tr> <tr><td>653</td><td>Ugthanki</td><td>45</td><td>A dangerous type of spitting camel that can temporarily blind an opponent.</td><td>X</td></tr> <tr><td>654</td><td>Observatory assistant</td><td>4</td><td>The Professor's assistant</td><td>-</td></tr> <tr><td>655</td><td>Souless</td><td>24</td><td>A servent to zamorak</td><td>X</td></tr> <tr><td>656</td><td>Dungeon spider</td><td>22</td><td>A nasty poisonous arachnid</td><td>X</td></tr> <tr><td>657</td><td>Kamen</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>658</td><td>Iban disciple</td><td>19</td><td>An evil follower of Iban</td><td>X</td></tr> <tr><td>659</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>660</td><td>Goblin</td><td>19</td><td>These goblins have grown strong</td><td>X</td></tr> <tr><td>661</td><td>Chadwell</td><td>16</td><td>A sturdy looking gent</td><td>-</td></tr> <tr><td>662</td><td>Professor</td><td>4</td><td>The owner of the observatory</td><td>-</td></tr> <tr><td>663</td><td>San Tojalon</td><td>120</td><td>The animated spirit of San Tojalon</td><td>X</td></tr> <tr><td>664</td><td>Ghost</td><td>29</td><td>A doomed victim of zamorak</td><td>X</td></tr> <tr><td>665</td><td>Spirit of Scorpius</td><td>100</td><td>The undead spirit of the follower of Zamorak</td><td>-</td></tr> <tr><td>666</td><td>Scorpion</td><td>21</td><td>There are nasty scorpions around this grave</td><td>-</td></tr> <tr><td>667</td><td>Dark Mage</td><td>0</td><td>He works in the ways of dark magic</td><td>-</td></tr> <tr><td>668</td><td>Mercenary</td><td>50</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>669</td><td>Mercenary Captain</td><td>64</td><td>He's in control of the local guards.</td><td>X</td></tr> <tr><td>670</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>671</td><td>Mining Slave</td><td>16</td><td>A chained slave forced to mine rocks.</td><td>X</td></tr> <tr><td>672</td><td>Watchtower wizard</td><td>12</td><td>A learned man</td><td>-</td></tr> <tr><td>673</td><td>Ogre Shaman</td><td>100</td><td>An intelligent form of ogre</td><td>-</td></tr> <tr><td>674</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>675</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>676</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>677</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>678</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>679</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>680</td><td>Og</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>681</td><td>Grew</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>682</td><td>Toban</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>683</td><td>Gorad</td><td>78</td><td>A high ranking ogre official</td><td>X</td></tr> <tr><td>684</td><td>Ogre guard</td><td>96</td><td>this creature looks very tough</td><td>X</td></tr> <tr><td>685</td><td>Yanille Watchman</td><td>33</td><td>A captured guard of Yanille</td><td>-</td></tr> <tr><td>686</td><td>Ogre merchant</td><td>58</td><td>He sells ogre-inspired items</td><td>-</td></tr> <tr><td>687</td><td>Ogre trader</td><td>58</td><td>He trades in metals</td><td>-</td></tr> <tr><td>688</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>689</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>690</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>691</td><td>City Guard</td><td>78</td><td>high ranking ogre guards</td><td>-</td></tr> <tr><td>692</td><td>Mercenary</td><td>39</td><td>He seems to be guarding this area</td><td>X</td></tr> <tr><td>693</td><td>Lawgof</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>694</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>695</td><td>lollk</td><td>18</td><td>He looks scared</td><td>-</td></tr> <tr><td>696</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>697</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>X</td></tr> <tr><td>698</td><td>Nulodion</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>699</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>700</td><td>Al Shabim</td><td>0</td><td>The leader of a nomadic Bedabin desert people - sometimes referred to as the 'Tenti's'</td><td>-</td></tr> <tr><td>701</td><td>Bedabin Nomad</td><td>0</td><td>A Bedabin nomad - they live in the harshest extremes in the desert</td><td>-</td></tr> <tr><td>702</td><td>Captain Siad</td><td>48</td><td>He's in control of the whole mining camp.</td><td>X</td></tr> <tr><td>703</td><td>Bedabin Nomad Guard</td><td>70</td><td>A Bedabin nomad guard - he's protecting something important</td><td>X</td></tr> <tr><td>704</td><td>Ogre citizen</td><td>58</td><td>A denizen of Gu'Tanoth</td><td>X</td></tr> <tr><td>705</td><td>Rock of ages</td><td>150</td><td>A huge boulder</td><td>X</td></tr> <tr><td>706</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>707</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>708</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>709</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>710</td><td>Draft Mercenary Guard</td><td>50</td><td>He's quickly drafted in to deal with trouble makers</td><td>X</td></tr> <tr><td>711</td><td>Mining Cart Driver</td><td>15</td><td>He drives the mining cart</td><td>-</td></tr> <tr><td>712</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>-</td></tr> <tr><td>713</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>X</td></tr> <tr><td>714</td><td>Gertrude</td><td>20</td><td>A busy housewife</td><td>-</td></tr> <tr><td>715</td><td>Shilop</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>716</td><td>Rowdy Guard</td><td>50</td><td>He looks as if he's spoiling for trouble</td><td>X</td></tr> <tr><td>717</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>X</td></tr> <tr><td>718</td><td>Rowdy Slave</td><td>16</td><td>A slave who's looking for trouble.</td><td>X</td></tr> <tr><td>719</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>-</td></tr> <tr><td>720</td><td>Assistant</td><td>0</td><td>He is an assistant to Shantay and helps him to run the pass.</td><td>-</td></tr> <tr><td>721</td><td>Desert Wolf</td><td>31</td><td>A vicious Desert wolf</td><td>X</td></tr> <tr><td>722</td><td>Workman</td><td>9</td><td>This person is working on the site</td><td>-</td></tr> <tr><td>723</td><td>Examiner</td><td>2</td><td>As you examine the examiner you examine that she is indeed an examiner!!</td><td>-</td></tr> <tr><td>724</td><td>Student</td><td>0</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>725</td><td>Student</td><td>20</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>726</td><td>Guide</td><td>12</td><td>This person specialises in panning for gold</td><td>-</td></tr> <tr><td>727</td><td>Student</td><td>18</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>728</td><td>Archaeological expert</td><td>15</td><td>An expert on archaeology!</td><td>-</td></tr> <tr><td>729</td><td>civillian</td><td>18</td><td>He looks aggitated!</td><td>X</td></tr> <tr><td>730</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>731</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>732</td><td>civillian</td><td>15</td><td>He looks aggitated!</td><td>-</td></tr> <tr><td>733</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>734</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>735</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>736</td><td>Legends Guild Guard</td><td>50</td><td>This guard is protecting the entrance to the Legends Guild.</td><td>-</td></tr> <tr><td>737</td><td>Escaping Mining Slave</td><td>16</td><td>An emancipated slave with cool Desert Clothes.</td><td>-</td></tr> <tr><td>738</td><td>Workman</td><td>9</td><td>This person is working in the mine</td><td>-</td></tr> <tr><td>739</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>740</td><td>Echned Zekin</td><td>50</td><td>An evil spirit of the underworld.</td><td>-</td></tr> <tr><td>741</td><td>Donovan the Handyman</td><td>9</td><td>It's the family odd jobs man</td><td>-</td></tr> <tr><td>742</td><td>Pierre the Dog Handler</td><td>9</td><td>It's the guy who looks after the family guard dog</td><td>-</td></tr> <tr><td>743</td><td>Hobbes the Butler</td><td>9</td><td>It's the family butler</td><td>-</td></tr> <tr><td>744</td><td>Louisa The Cook</td><td>0</td><td>It's the family cook</td><td>-</td></tr> <tr><td>745</td><td>Mary The Maid</td><td>25</td><td>The family maid</td><td>-</td></tr> <tr><td>746</td><td>Stanford The Gardener</td><td>8</td><td>It's the family Gardener</td><td>-</td></tr> <tr><td>747</td><td>Guard</td><td>28</td><td>He looks like he's in over his head here</td><td>-</td></tr> <tr><td>748</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>-</td></tr> <tr><td>749</td><td>Guard</td><td>8</td><td>***EMPTY PLEASE USE OR REPLACE***</td><td>-</td></tr> <tr><td>750</td><td>Man</td><td>9</td><td>A thirsty looking man</td><td>-</td></tr> <tr><td>751</td><td>Anna Sinclair</td><td>9</td><td>The first child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>752</td><td>Bob Sinclair</td><td>9</td><td>The second child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>753</td><td>Carol Sinclair</td><td>9</td><td>The third child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>754</td><td>David Sinclair</td><td>9</td><td>The fourth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>755</td><td>Elizabeth Sinclair</td><td>9</td><td>The fifth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>756</td><td>Frank Sinclair</td><td>9</td><td>The sixth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>757</td><td>kolodion</td><td>65</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>758</td><td>kolodion</td><td>68</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>759</td><td>kolodion</td><td>46</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>760</td><td>kolodion</td><td>98</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>761</td><td>Irvig Senay</td><td>125</td><td>The animated spirit of Irvig Senay</td><td>X</td></tr> <tr><td>762</td><td>Ranalph Devere</td><td>130</td><td>The animated spirit of Ranalph Devere</td><td>X</td></tr> <tr><td>763</td><td>Poison Salesman</td><td>7</td><td>Peter Potter - Poison Purveyor</td><td>-</td></tr> <tr><td>764</td><td>Gujuo</td><td>60</td><td>A tall charismatic looking jungle native - he approaches with confidence</td><td>-</td></tr> <tr><td>765</td><td>Jungle Forester</td><td>15</td><td>A woodsman who specialises in large and exotic timber</td><td>-</td></tr> <tr><td>766</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman</td><td>X</td></tr> <tr><td>767</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman - he looks very strange with glowing red eyes...</td><td>X</td></tr> <tr><td>768</td><td>Death Wing</td><td>80</td><td>A supernatural creature of the underworld</td><td>X</td></tr> <tr><td>769</td><td>Nezikchened</td><td>172</td><td>An ancient powerful Demon of the Underworld...</td><td>X</td></tr> <tr><td>770</td><td>Dwarf Cannon engineer</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>771</td><td>Dwarf commander</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>772</td><td>Viyeldi</td><td>80</td><td>The spirit of a dead sorcerer</td><td>X</td></tr> <tr><td>773</td><td>Nurmof</td><td>18</td><td>He sells pickaxes</td><td>-</td></tr> <tr><td>774</td><td>Fatigue expert</td><td>10</td><td>He looks wide awake</td><td>-</td></tr> <tr><td>775</td><td>Karamja Wolf</td><td>61</td><td>A hungry</td><td>X</td></tr> <tr><td>776</td><td>Jungle Savage</td><td>87</td><td>A savage and fearless Jungle warrior</td><td>X</td></tr> <tr><td>777</td><td>Oomlie Bird</td><td>32</td><td>A variety of flightless jungle fowl - it has a sharp beak and a bad temper.</td><td>X</td></tr> <tr><td>778</td><td>Sidney Smith</td><td>30</td><td>Sidney Smith - Certification clerk</td><td>-</td></tr> <tr><td>779</td><td>Siegfried Erkle</td><td>25</td><td>An eccentric shop keeper - related to the Grand Vizier of the Legends Guild</td><td>-</td></tr> <tr><td>780</td><td>Tea seller</td><td>9</td><td>He has delicious tea to buy</td><td>-</td></tr> <tr><td>781</td><td>Wilough</td><td>0</td><td>A young son of gertrudes</td><td>-</td></tr> <tr><td>782</td><td>Philop</td><td>0</td><td>Gertrudes youngest</td><td>-</td></tr> <tr><td>783</td><td>Kanel</td><td>0</td><td>Gertrudes youngest's twin brother</td><td>-</td></tr> <tr><td>784</td><td>chamber guardian</td><td>15</td><td>He hasn't seen much sun latley</td><td>-</td></tr> <tr><td>785</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>786</td><td>Pit Scorpion</td><td>35</td><td>Very vicious little scorpions</td><td>X</td></tr> <tr><td>787</td><td>Shadow Warrior</td><td>64</td><td>A sinsistar shadowy figure</td><td>X</td></tr> <tr><td>788</td><td>Fionella</td><td>25</td><td>She runs the legend's general store</td><td>-</td></tr> <tr><td>789</td><td>Battle mage</td><td>52</td><td>He kills in the name of guthix</td><td>X</td></tr> <tr><td>790</td><td>Battle mage</td><td>52</td><td>He kills in the name of zamarok</td><td>X</td></tr> <tr><td>791</td><td>Battle mage</td><td>52</td><td>He kills in the name of Saradomin</td><td>X</td></tr> <tr><td>792</td><td>Gundai</td><td>15</td><td>He must get lonely out here</td><td>-</td></tr> <tr><td>793</td><td>Lundail</td><td>15</td><td>He sells rune stones</td><td>-</td></tr> 120 2011-06-20T04:53:28Z Admin 1 [[Category:RSC]] <table border="1" cellpadding="3" cellspacing="3"> <tr><td><b>id</b></td><td><b>npc name</b></td><td><b>level</b></td><td><b>description</b></td><td><b>attackable</b></td></tr> <tr><td>0</td><td>Unicorn</td><td>21</td><td>It's a unicorn</td><td>X</td></tr> <tr><td>1</td><td>Bob</td><td>2</td><td>An axe seller</td><td>-</td></tr> <tr><td>2</td><td>Sheep</td><td>0</td><td>A very wooly sheep</td><td>-</td></tr> <tr><td>3</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>X</td></tr> <tr><td>4</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>5</td><td>Hans</td><td>3</td><td>A castle servant</td><td>X</td></tr> <tr><td>6</td><td>cow</td><td>8</td><td>It's a multi purpose cow</td><td>X</td></tr> <tr><td>7</td><td>cook</td><td>15</td><td>The head cook of Lumbridge castle</td><td>-</td></tr> <tr><td>8</td><td>Bear</td><td>24</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>9</td><td>Priest</td><td>0</td><td>A priest of Saradomin</td><td>-</td></tr> <tr><td>10</td><td>Urhney</td><td>8</td><td>He looks a little grumpy</td><td>-</td></tr> <tr><td>11</td><td>Man</td><td>9</td><td>One of runescapes many citizens</td><td>X</td></tr> <tr><td>12</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>13</td><td>Camel</td><td>0</td><td>Oh its a camel</td><td>-</td></tr> <tr><td>14</td><td>Gypsy</td><td>0</td><td>An old gypsy lady</td><td>-</td></tr> <tr><td>15</td><td>Ghost</td><td>12</td><td>Ooh spooky</td><td>-</td></tr> <tr><td>16</td><td>Sir Prysin</td><td>40</td><td>One of the king's knights</td><td>-</td></tr> <tr><td>17</td><td>Traiborn the wizard</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>18</td><td>Captain Rovin</td><td>51</td><td>The head of the palace guard</td><td>-</td></tr> <tr><td>19</td><td>Rat</td><td>8</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>20</td><td>Reldo</td><td>12</td><td>I think he's the librarian</td><td>-</td></tr> <tr><td>21</td><td>mugger</td><td>10</td><td>He jumps out and attacks people</td><td>X</td></tr> <tr><td>22</td><td>Lesser Demon</td><td>79</td><td>Lesser but still pretty big</td><td>X</td></tr> <tr><td>23</td><td>Giant Spider</td><td>8</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>24</td><td>Man</td><td>30</td><td>A shifty looking man</td><td>-</td></tr> <tr><td>25</td><td>Jonny the beard</td><td>10</td><td>I can see why he's called the beard</td><td>X</td></tr> <tr><td>26</td><td>Baraek</td><td>30</td><td>A fur trader</td><td>-</td></tr> <tr><td>27</td><td>Katrine</td><td>25</td><td>She doesn't look to friendly</td><td>-</td></tr> <tr><td>28</td><td>Tramp</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>29</td><td>Rat</td><td>2</td><td>A small muddy rat</td><td>X</td></tr> <tr><td>30</td><td>Romeo</td><td>45</td><td>He looks mildly confused</td><td>-</td></tr> <tr><td>31</td><td>Juliet</td><td>2</td><td>She looks a little stressed</td><td>-</td></tr> <tr><td>32</td><td>Father Lawrence</td><td>0</td><td>A kindly looking priest</td><td>-</td></tr> <tr><td>33</td><td>Apothecary</td><td>6</td><td>I wonder if he has any good potions</td><td>-</td></tr> <tr><td>34</td><td>spider</td><td>2</td><td>Incey wincey</td><td>X</td></tr> <tr><td>35</td><td>Delrith</td><td>30</td><td>A freshly summoned demon</td><td>X</td></tr> <tr><td>36</td><td>Veronica</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>37</td><td>Weaponsmaster</td><td>25</td><td>The phoenix gang quartermaster</td><td>X</td></tr> <tr><td>38</td><td>Professor Oddenstein</td><td>4</td><td>A mad scientist if I ever saw one</td><td>-</td></tr> <tr><td>39</td><td>Curator</td><td>2</td><td>He looks like he's daydreaming</td><td>-</td></tr> <tr><td>40</td><td>skeleton</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>41</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>42</td><td>king</td><td>30</td><td>King Roald the VIII</td><td>-</td></tr> <tr><td>43</td><td>Giant bat</td><td>32</td><td>An angry flying rodent</td><td>X</td></tr> <tr><td>44</td><td>Bartender</td><td>0</td><td>A friendly barman</td><td>-</td></tr> <tr><td>45</td><td>skeleton</td><td>31</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>46</td><td>skeleton</td><td>25</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>47</td><td>Rat</td><td>13</td><td>overgrown vermin</td><td>X</td></tr> <tr><td>48</td><td>Horvik the Armourer</td><td>16</td><td>He looks strong</td><td>-</td></tr> <tr><td>49</td><td>Bear</td><td>0</td><td>A bear</td><td>-</td></tr> <tr><td>50</td><td>skeleton</td><td>19</td><td>It rattles when it walks</td><td>X</td></tr> <tr><td>51</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>52</td><td>zombie</td><td>19</td><td>The living dead</td><td>X</td></tr> <tr><td>53</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>54</td><td>Aubury</td><td>0</td><td>I think he might be a shop keeper</td><td>-</td></tr> <tr><td>55</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>56</td><td>shopkeeper</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>57</td><td>Darkwizard</td><td>13</td><td>He works evil magic</td><td>X</td></tr> <tr><td>58</td><td>lowe</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>59</td><td>Thessalia</td><td>0</td><td>A young shop assistant</td><td>-</td></tr> <tr><td>60</td><td>Darkwizard</td><td>25</td><td>He works evil magic</td><td>X</td></tr> <tr><td>61</td><td>Giant</td><td>37</td><td>A very large foe</td><td>X</td></tr> <tr><td>62</td><td>Goblin</td><td>7</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>63</td><td>farmer</td><td>15</td><td>He grows the crops in this area</td><td>X</td></tr> <tr><td>64</td><td>Thief</td><td>21</td><td>He'll take anything that isn't nailed down</td><td>X</td></tr> <tr><td>65</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>X</td></tr> <tr><td>66</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>67</td><td>Hobgoblin</td><td>32</td><td>A large ugly green creature</td><td>X</td></tr> <tr><td>68</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>69</td><td>Zaff</td><td>0</td><td>He trades in staffs</td><td>-</td></tr> <tr><td>70</td><td>Scorpion</td><td>21</td><td>An extremely vicious scorpion</td><td>X</td></tr> <tr><td>71</td><td>silk trader</td><td>0</td><td>He sells silk</td><td>-</td></tr> <tr><td>72</td><td>Man</td><td>9</td><td>One of Runescapes many citizens</td><td>X</td></tr> <tr><td>73</td><td>Guide</td><td>1</td><td>He gives hints to new adventurers</td><td>-</td></tr> <tr><td>74</td><td>Giant Spider</td><td>31</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>75</td><td>Peksa</td><td>9</td><td>A helmet salesman</td><td>-</td></tr> <tr><td>76</td><td>Barbarian</td><td>16</td><td>Not civilised looking</td><td>X</td></tr> <tr><td>77</td><td>Fred the farmer</td><td>9</td><td>An old farmer</td><td>-</td></tr> <tr><td>78</td><td>Gunthor the Brave</td><td>37</td><td>The barbarians fearless leader</td><td>X</td></tr> <tr><td>79</td><td>Witch</td><td>25</td><td>She's got warts</td><td>X</td></tr> <tr><td>80</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>81</td><td>Wizard</td><td>16</td><td>An old wizard</td><td>X</td></tr> <tr><td>82</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>83</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>84</td><td>Zeke</td><td>0</td><td>He sells Scimitars</td><td>-</td></tr> <tr><td>85</td><td>Louie Legs</td><td>0</td><td>He might want to sell something</td><td>-</td></tr> <tr><td>86</td><td>Warrior</td><td>18</td><td>A member of Al Kharid's military</td><td>X</td></tr> <tr><td>87</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>88</td><td>Shop Assistant</td><td>0</td><td>Maybe she'd like to buy some of my junk</td><td>-</td></tr> <tr><td>89</td><td>Highwayman</td><td>13</td><td>He holds up passers by</td><td>X</td></tr> <tr><td>90</td><td>Kebab Seller</td><td>0</td><td>A seller of strange food</td><td>-</td></tr> <tr><td>91</td><td>Chicken</td><td>3</td><td>Yep definitely a chicken</td><td>-</td></tr> <tr><td>92</td><td>Ernest</td><td>3</td><td>A former chicken</td><td>-</td></tr> <tr><td>93</td><td>Monk</td><td>13</td><td>A Peaceful monk</td><td>X</td></tr> <tr><td>94</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>95</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>96</td><td>Count Draynor</td><td>43</td><td>A vicious vampire</td><td>X</td></tr> <tr><td>97</td><td>Morgan</td><td>9</td><td>A frigtened villager</td><td>-</td></tr> <tr><td>98</td><td>Dr Harlow</td><td>9</td><td>His nose is very red</td><td>-</td></tr> <tr><td>99</td><td>Deadly Red spider</td><td>36</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>100</td><td>Guard</td><td>28</td><td>He's here to guard this fortress</td><td>X</td></tr> <tr><td>101</td><td>Cassie</td><td>25</td><td>She sells shields</td><td>-</td></tr> <tr><td>102</td><td>White Knight</td><td>56</td><td>A chivalrous knight</td><td>X</td></tr> <tr><td>103</td><td>Ranael</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>104</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>105</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>106</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>107</td><td>Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>108</td><td>Black Knight</td><td>46</td><td>A sinister looking knight</td><td>X</td></tr> <tr><td>109</td><td>Greldo</td><td>7</td><td>A small green warty creature</td><td>X</td></tr> <tr><td>110</td><td>Sir Amik Varze</td><td>56</td><td>The leader of the white knights</td><td>-</td></tr> <tr><td>111</td><td>Guildmaster</td><td>40</td><td>He's in charge of this place</td><td>-</td></tr> <tr><td>112</td><td>Valaine</td><td>25</td><td>She runs the champion's store</td><td>-</td></tr> <tr><td>113</td><td>Drogo</td><td>18</td><td>He runs a mining store</td><td>-</td></tr> <tr><td>114</td><td>Imp</td><td>5</td><td>A cheeky little imp</td><td>X</td></tr> <tr><td>115</td><td>Flynn</td><td>16</td><td>The mace salesman</td><td>-</td></tr> <tr><td>116</td><td>Wyson the gardener</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>117</td><td>Wizard Mizgog</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>118</td><td>Prince Ali</td><td>20</td><td>A young prince</td><td>-</td></tr> <tr><td>119</td><td>Hassan</td><td>20</td><td>the Chancellor to the emir</td><td>-</td></tr> <tr><td>120</td><td>Osman</td><td>20</td><td>He looks a little shifty</td><td>-</td></tr> <tr><td>121</td><td>Joe</td><td>40</td><td>Lady Keli's head guard</td><td>-</td></tr> <tr><td>122</td><td>Leela</td><td>20</td><td>She comes from Al Kharid</td><td>-</td></tr> <tr><td>123</td><td>Lady Keli</td><td>20</td><td>An Infamous bandit</td><td>-</td></tr> <tr><td>124</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>125</td><td>Aggie</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>126</td><td>Prince Ali</td><td>10</td><td>That is an effective disguise</td><td>-</td></tr> <tr><td>127</td><td>Jailguard</td><td>34</td><td>I wonder what he's guarding</td><td>X</td></tr> <tr><td>128</td><td>Redbeard Frank</td><td>25</td><td>A pirate</td><td>-</td></tr> <tr><td>129</td><td>Wydin</td><td>0</td><td>A grocer</td><td>-</td></tr> <tr><td>130</td><td>shop assistant</td><td>0</td><td>I can buy swords off him</td><td>-</td></tr> <tr><td>131</td><td>Brian</td><td>0</td><td>An axe seller</td><td>-</td></tr> <tr><td>132</td><td>squire</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>133</td><td>Head chef</td><td>15</td><td>He looks after the chef's guild</td><td>-</td></tr> <tr><td>134</td><td>Thurgo</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>135</td><td>Ice Giant</td><td>68</td><td>He's got icicles in his beard</td><td>X</td></tr> <tr><td>136</td><td>King Scorpion</td><td>36</td><td>Wow scorpions shouldn't grow that big</td><td>X</td></tr> <tr><td>137</td><td>Pirate</td><td>27</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>138</td><td>Sir Vyvin</td><td>56</td><td>One of the white knights of Falador</td><td>-</td></tr> <tr><td>139</td><td>Monk of Zamorak</td><td>29</td><td>An evil cleric</td><td>X</td></tr> <tr><td>140</td><td>Monk of Zamorak</td><td>19</td><td>An evil cleric</td><td>X</td></tr> <tr><td>141</td><td>Wayne</td><td>16</td><td>An armourer</td><td>-</td></tr> <tr><td>142</td><td>Barmaid</td><td>25</td><td>a pretty barmaid</td><td>-</td></tr> <tr><td>143</td><td>Dwarven shopkeeper</td><td>18</td><td>I wonder if he wants to buy any of my junk</td><td>-</td></tr> <tr><td>144</td><td>Doric</td><td>18</td><td>A dwarven smith</td><td>-</td></tr> <tr><td>145</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>146</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>147</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>148</td><td>Hetty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>149</td><td>Betty</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>150</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>151</td><td>General wartface</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>152</td><td>General Bentnoze</td><td>13</td><td>An ugly green creature</td><td>-</td></tr> <tr><td>153</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>154</td><td>Goblin</td><td>13</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>155</td><td>Herquin</td><td>0</td><td>A gem merchant</td><td>-</td></tr> <tr><td>156</td><td>Rommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>157</td><td>Grum</td><td>0</td><td>Grum the goldsmith</td><td>-</td></tr> <tr><td>158</td><td>Ice warrior</td><td>57</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>159</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>160</td><td>Thrander</td><td>16</td><td>A smith of some sort</td><td>-</td></tr> <tr><td>161</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>162</td><td>Border Guard</td><td>18</td><td>a guard from Al Kharid</td><td>-</td></tr> <tr><td>163</td><td>Customs Officer</td><td>16</td><td>She is here to stop smugglers</td><td>-</td></tr> <tr><td>164</td><td>Luthas</td><td>16</td><td>The owner of the banana plantation</td><td>-</td></tr> <tr><td>165</td><td>Zambo</td><td>16</td><td>He will sell me exotic rum</td><td>-</td></tr> <tr><td>166</td><td>Captain Tobias</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>167</td><td>Gerrant</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>168</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>169</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>170</td><td>Seaman Lorris</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>171</td><td>Seaman Thresnor</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>172</td><td>Tanner</td><td>45</td><td>He makes leather</td><td>-</td></tr> <tr><td>173</td><td>Dommik</td><td>0</td><td>The owner of the crafting shop</td><td>-</td></tr> <tr><td>174</td><td>Abbot Langley</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>175</td><td>Thordur</td><td>18</td><td>He runs a a tourist attraction</td><td>-</td></tr> <tr><td>176</td><td>Brother Jered</td><td>13</td><td>human</td><td>-</td></tr> <tr><td>177</td><td>Rat</td><td>13</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>178</td><td>Ghost</td><td>25</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>179</td><td>skeleton</td><td>31</td><td>it rattles when it walks</td><td>X</td></tr> <tr><td>180</td><td>zombie</td><td>32</td><td>the living dead</td><td>X</td></tr> <tr><td>181</td><td>Lesser Demon</td><td>79</td><td>Lesser but still very big</td><td>X</td></tr> <tr><td>182</td><td>Melzar the mad</td><td>45</td><td>He looks totally insane</td><td>X</td></tr> <tr><td>183</td><td>Scavvo</td><td>10</td><td>He has lopsided eyes</td><td>-</td></tr> <tr><td>184</td><td>Greater Demon</td><td>87</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>185</td><td>Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>186</td><td>Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>187</td><td>Oziach</td><td>0</td><td>A strange little man</td><td>-</td></tr> <tr><td>188</td><td>Bear</td><td>26</td><td>Eek! A bear!</td><td>X</td></tr> <tr><td>189</td><td>Black Knight</td><td>46</td><td>An armoured follower of Zamorak</td><td>X</td></tr> <tr><td>190</td><td>chaos Dwarf</td><td>59</td><td>a dwarf gone bad</td><td>X</td></tr> <tr><td>191</td><td>dwarf</td><td>18</td><td>A dwarf who looks after the mining guild</td><td>-</td></tr> <tr><td>192</td><td>Wormbrain</td><td>7</td><td>Dumb even by goblin standards</td><td>X</td></tr> <tr><td>193</td><td>Klarense</td><td>20</td><td>A young sailor</td><td>-</td></tr> <tr><td>194</td><td>Ned</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>195</td><td>skeleton</td><td>54</td><td>A Taller than normal skeleton</td><td>X</td></tr> <tr><td>196</td><td>Dragon</td><td>110</td><td>A powerful and ancient dragon</td><td>X</td></tr> <tr><td>197</td><td>Oracle</td><td>57</td><td>A mystic of unknown race</td><td>-</td></tr> <tr><td>198</td><td>Duke of Lumbridge</td><td>30</td><td>Duke Horacio of Lumbridge</td><td>-</td></tr> <tr><td>199</td><td>Dark Warrior</td><td>21</td><td>A warrior touched by chaos</td><td>X</td></tr> <tr><td>200</td><td>Druid</td><td>29</td><td>A worshipper of Guthix</td><td>X</td></tr> <tr><td>201</td><td>Red Dragon</td><td>140</td><td>A big powerful dragon</td><td>X</td></tr> <tr><td>202</td><td>Blue Dragon</td><td>105</td><td>A mother dragon</td><td>X</td></tr> <tr><td>203</td><td>Baby Blue Dragon</td><td>50</td><td>Young but still dangerous</td><td>X</td></tr> <tr><td>204</td><td>Kaqemeex</td><td>29</td><td>A wise druid</td><td>-</td></tr> <tr><td>205</td><td>Sanfew</td><td>29</td><td>An old druid</td><td>-</td></tr> <tr><td>206</td><td>Suit of armour</td><td>29</td><td>A dusty old suit of armour</td><td>-</td></tr> <tr><td>207</td><td>Adventurer</td><td>13</td><td>A cleric</td><td>-</td></tr> <tr><td>208</td><td>Adventurer</td><td>12</td><td>A wizard</td><td>-</td></tr> <tr><td>209</td><td>Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>210</td><td>Adventurer</td><td>25</td><td>An archer</td><td>-</td></tr> <tr><td>211</td><td>Leprechaun</td><td>18</td><td>A funny little man who lives in a tree</td><td>-</td></tr> <tr><td>212</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>213</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>214</td><td>zombie</td><td>32</td><td>The living dead</td><td>X</td></tr> <tr><td>215</td><td>Monk of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>216</td><td>tree spirit</td><td>95</td><td>Ooh spooky</td><td>X</td></tr> <tr><td>217</td><td>cow</td><td>8</td><td>It's a dairy cow</td><td>-</td></tr> <tr><td>218</td><td>Irksol</td><td>2</td><td>Is he invisible or just a set of floating clothes?</td><td>-</td></tr> <tr><td>219</td><td>Fairy Lunderwin</td><td>2</td><td>A fairy merchant</td><td>-</td></tr> <tr><td>220</td><td>Jakut</td><td>2</td><td>An unusual looking merchant</td><td>-</td></tr> <tr><td>221</td><td>Doorman</td><td>56</td><td>He guards the entrance to the faerie market</td><td>-</td></tr> <tr><td>222</td><td>Fairy Shopkeeper</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>223</td><td>Fairy Shop Assistant</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>224</td><td>Fairy banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>225</td><td>Giles</td><td>30</td><td>He runs an ore exchange store</td><td>-</td></tr> <tr><td>226</td><td>Miles</td><td>30</td><td>He runs a bar exchange store</td><td>-</td></tr> <tr><td>227</td><td>Niles</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>228</td><td>Gaius</td><td>16</td><td>he sells very big swords</td><td>-</td></tr> <tr><td>229</td><td>Fairy Ladder attendant</td><td>0</td><td>A worker in the faerie market</td><td>-</td></tr> <tr><td>230</td><td>Jatix</td><td>29</td><td>A hard working druid</td><td>-</td></tr> <tr><td>231</td><td>Master Crafter</td><td>0</td><td>The man in charge of the crafter's guild</td><td>-</td></tr> <tr><td>232</td><td>Bandit</td><td>29</td><td>He's ready for a fight</td><td>X</td></tr> <tr><td>233</td><td>Noterazzo</td><td>29</td><td>A bandit shopkeeper</td><td>-</td></tr> <tr><td>234</td><td>Bandit</td><td>29</td><td>A wilderness outlaw</td><td>X</td></tr> <tr><td>235</td><td>Fat Tony</td><td>15</td><td>A Gourmet Pizza chef</td><td>-</td></tr> <tr><td>236</td><td>Donny the lad</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>237</td><td>Black Heather</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>238</td><td>Speedy Keith</td><td>39</td><td>A bandit leader</td><td>X</td></tr> <tr><td>239</td><td>White wolf sentry</td><td>31</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>240</td><td>Boy</td><td>39</td><td>He doesn't seem very happy</td><td>-</td></tr> <tr><td>241</td><td>Rat</td><td>2</td><td>He seems to live here</td><td>-</td></tr> <tr><td>242</td><td>Nora T Hag</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>243</td><td>Grey wolf</td><td>64</td><td>A sinister looking wolf</td><td>X</td></tr> <tr><td>244</td><td>shapeshifter</td><td>24</td><td>I've not seen anyone like this before</td><td>X</td></tr> <tr><td>245</td><td>shapeshifter</td><td>34</td><td>I think this spider has been genetically modified</td><td>-</td></tr> <tr><td>246</td><td>shapeshifter</td><td>44</td><td>Eek! A bear!</td><td>-</td></tr> <tr><td>247</td><td>shapeshifter</td><td>54</td><td>A sinister looking wolf</td><td>-</td></tr> <tr><td>248</td><td>White wolf</td><td>41</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>249</td><td>Pack leader</td><td>71</td><td>A vicious mountain wolf</td><td>X</td></tr> <tr><td>250</td><td>Harry</td><td>0</td><td>I wonder what he's got for sale</td><td>-</td></tr> <tr><td>251</td><td>Thug</td><td>18</td><td>He likes hitting things</td><td>X</td></tr> <tr><td>252</td><td>Firebird</td><td>6</td><td>Probably not a chicken</td><td>X</td></tr> <tr><td>253</td><td>Achetties</td><td>46</td><td>One of Asgarnia's greatest heros</td><td>-</td></tr> <tr><td>254</td><td>Ice queen</td><td>103</td><td>The leader of the ice warriors</td><td>X</td></tr> <tr><td>255</td><td>Grubor</td><td>15</td><td>A rough looking thief</td><td>-</td></tr> <tr><td>256</td><td>Trobert</td><td>13</td><td>A well dressed thief</td><td>-</td></tr> <tr><td>257</td><td>Garv</td><td>28</td><td>A diligent guard</td><td>-</td></tr> <tr><td>258</td><td>guard</td><td>27</td><td>A vicious pirate</td><td>-</td></tr> <tr><td>259</td><td>Grip</td><td>46</td><td>Scar face petes head guard</td><td>X</td></tr> <tr><td>260</td><td>Alfonse the waiter</td><td>9</td><td>He should get a clean apron</td><td>-</td></tr> <tr><td>261</td><td>Charlie the cook</td><td>15</td><td>Head cook of the Shrimp and parrot</td><td>-</td></tr> <tr><td>262</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>X</td></tr> <tr><td>263</td><td>Ice spider</td><td>64</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>264</td><td>Pirate</td><td>30</td><td>A vicious pirate</td><td>X</td></tr> <tr><td>265</td><td>Jailer</td><td>51</td><td>Guards prisoners for the black knights</td><td>X</td></tr> <tr><td>266</td><td>Lord Darquarius</td><td>76</td><td>A black knight commander</td><td>X</td></tr> <tr><td>267</td><td>Seth</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>268</td><td>Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>269</td><td>Helemos</td><td>46</td><td>A retired hero</td><td>-</td></tr> <tr><td>270</td><td>Chaos Druid</td><td>19</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>271</td><td>Poison Scorpion</td><td>26</td><td>It has a very vicious looking tail</td><td>X</td></tr> <tr><td>272</td><td>Velrak the explorer</td><td>3</td><td>he looks cold and hungry</td><td>-</td></tr> <tr><td>273</td><td>Sir Lancelot</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>274</td><td>Sir Gawain</td><td>56</td><td>A knight of the round table</td><td>-</td></tr> <tr><td>275</td><td>King Arthur</td><td>56</td><td>A wise old king</td><td>-</td></tr> <tr><td>276</td><td>Sir Mordred</td><td>58</td><td>An evil knight</td><td>X</td></tr> <tr><td>277</td><td>Renegade knight</td><td>51</td><td>He isn't very friendly</td><td>X</td></tr> <tr><td>278</td><td>Davon</td><td>27</td><td>An amulet trader</td><td>-</td></tr> <tr><td>279</td><td>Bartender</td><td>0</td><td>I could get some grog off him</td><td>-</td></tr> <tr><td>280</td><td>Arhein</td><td>0</td><td>A merchant</td><td>-</td></tr> <tr><td>281</td><td>Morgan le faye</td><td>25</td><td>An evil sorceress</td><td>-</td></tr> <tr><td>282</td><td>Candlemaker</td><td>16</td><td>He makes and sells candles</td><td>-</td></tr> <tr><td>283</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>284</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>285</td><td>lady</td><td>0</td><td>She has a hint of magic about her</td><td>-</td></tr> <tr><td>286</td><td>Beggar</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>287</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>288</td><td>Thrantax</td><td>90</td><td>A freshly summoned demon</td><td>-</td></tr> <tr><td>289</td><td>Hickton</td><td>0</td><td>The owner of the archery store</td><td>-</td></tr> <tr><td>290</td><td>Black Demon</td><td>156</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>291</td><td>Black Dragon</td><td>200</td><td>A fierce dragon with black scales!</td><td>X</td></tr> <tr><td>292</td><td>Poison Spider</td><td>63</td><td>I think this spider has been genetically modified</td><td>X</td></tr> <tr><td>293</td><td>Monk of Zamorak</td><td>47</td><td>An evil cleric</td><td>X</td></tr> <tr><td>294</td><td>Hellhound</td><td>114</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>295</td><td>Animated axe</td><td>46</td><td>a magic axe with a mind of it's own</td><td>X</td></tr> <tr><td>296</td><td>Black Unicorn</td><td>31</td><td>It's a sort of unicorn</td><td>X</td></tr> <tr><td>297</td><td>Frincos</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>298</td><td>Otherworldly being</td><td>66</td><td>Is he invisible or just a set of floating clothes?</td><td>X</td></tr> <tr><td>299</td><td>Owen</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>300</td><td>Thormac the sorceror</td><td>25</td><td>A powerful sorcerrer</td><td>-</td></tr> <tr><td>301</td><td>Seer</td><td>16</td><td>An old wizard</td><td>-</td></tr> <tr><td>302</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>303</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>304</td><td>Kharid Scorpion</td><td>21</td><td>a smaller less dangerous scorpion</td><td>-</td></tr> <tr><td>305</td><td>Barbarian guard</td><td>16</td><td>Not very civilised</td><td>-</td></tr> <tr><td>306</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>307</td><td>man</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>308</td><td>gem trader</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>309</td><td>Dimintheis</td><td>9</td><td>A well dressed nobleman</td><td>-</td></tr> <tr><td>310</td><td>chef</td><td>15</td><td>A busy looking chef</td><td>-</td></tr> <tr><td>311</td><td>Hobgoblin</td><td>48</td><td>An ugly green creature</td><td>X</td></tr> <tr><td>312</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>313</td><td>Boot the Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>314</td><td>Wizard</td><td>16</td><td>A young wizard</td><td>-</td></tr> <tr><td>315</td><td>Chronozon</td><td>121</td><td>Chronozon the blood demon</td><td>X</td></tr> <tr><td>316</td><td>Captain Barnaby</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>317</td><td>Customs Official</td><td>16</td><td>She's here to stop smugglers</td><td>-</td></tr> <tr><td>318</td><td>Man</td><td>9</td><td>One of Runescape's citizens</td><td>X</td></tr> <tr><td>319</td><td>farmer</td><td>15</td><td>An humble peasant</td><td>X</td></tr> <tr><td>320</td><td>Warrior</td><td>27</td><td>A skilled fighter</td><td>X</td></tr> <tr><td>321</td><td>Guard</td><td>28</td><td>He tries to keep the law and order around here</td><td>X</td></tr> <tr><td>322</td><td>Knight</td><td>56</td><td>A knight of Ardougne</td><td>X</td></tr> <tr><td>323</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>324</td><td>Hero</td><td>83</td><td>A Hero of Ardougne</td><td>X</td></tr> <tr><td>325</td><td>Baker</td><td>15</td><td>He sells hot baked bread</td><td>-</td></tr> <tr><td>326</td><td>silk merchant</td><td>0</td><td>He buys silk</td><td>-</td></tr> <tr><td>327</td><td>Fur trader</td><td>0</td><td>A buyer and seller of animal furs</td><td>-</td></tr> <tr><td>328</td><td>silver merchant</td><td>0</td><td>He deals in silver</td><td>-</td></tr> <tr><td>329</td><td>spice merchant</td><td>15</td><td>He sells exotic spices</td><td>-</td></tr> <tr><td>330</td><td>gem merchant</td><td>0</td><td>He sells gems</td><td>-</td></tr> <tr><td>331</td><td>Zenesha</td><td>25</td><td>A shopkeeper of some sort</td><td>-</td></tr> <tr><td>332</td><td>Kangai Mau</td><td>0</td><td>A tribesman</td><td>-</td></tr> <tr><td>333</td><td>Wizard Cromperty</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>334</td><td>RPDT employee</td><td>12</td><td>A delivery man</td><td>-</td></tr> <tr><td>335</td><td>Horacio</td><td>8</td><td>An old gardener</td><td>-</td></tr> <tr><td>336</td><td>Aemad</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>337</td><td>Kortan</td><td>16</td><td>He helps run the adventurers store</td><td>-</td></tr> <tr><td>338</td><td>zoo keeper</td><td>20</td><td>He looks after Ardougne city zoo</td><td>X</td></tr> <tr><td>339</td><td>Make over mage</td><td>0</td><td>He can change how I look</td><td>-</td></tr> <tr><td>340</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>341</td><td>chuck</td><td>0</td><td>A wood merchant</td><td>-</td></tr> <tr><td>342</td><td>Rogue</td><td>21</td><td>He needs a shave</td><td>X</td></tr> <tr><td>343</td><td>Shadow spider</td><td>53</td><td>Is it a spider or is it a shadow</td><td>X</td></tr> <tr><td>344</td><td>Fire Giant</td><td>109</td><td>A big guy with red glowing skin</td><td>X</td></tr> <tr><td>345</td><td>Grandpa Jack</td><td>20</td><td>A wistful old man</td><td>-</td></tr> <tr><td>346</td><td>Sinister stranger</td><td>43</td><td>not your average fisherman</td><td>-</td></tr> <tr><td>347</td><td>Bonzo</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>348</td><td>Forester</td><td>21</td><td>He looks after McGrubor's wood</td><td>X</td></tr> <tr><td>349</td><td>Morris</td><td>30</td><td>Fishing competition organiser</td><td>-</td></tr> <tr><td>350</td><td>Brother Omad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>351</td><td>Thief</td><td>21</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>352</td><td>Head Thief</td><td>34</td><td>A dastardly blanket thief</td><td>X</td></tr> <tr><td>353</td><td>Big Dave</td><td>15</td><td>A well built fisherman</td><td>-</td></tr> <tr><td>354</td><td>Joshua</td><td>15</td><td>A grumpy fisherman</td><td>-</td></tr> <tr><td>355</td><td>Mountain Dwarf</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>356</td><td>Mountain Dwarf</td><td>28</td><td>A short angry guy</td><td>X</td></tr> <tr><td>357</td><td>Brother Cedric</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>358</td><td>Necromancer</td><td>34</td><td>A crazy evil necromancer</td><td>X</td></tr> <tr><td>359</td><td>zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>360</td><td>Lucien</td><td>21</td><td>He walks with a slight limp</td><td>-</td></tr> <tr><td>361</td><td>The Fire warrior of lesarkus</td><td>63</td><td>A strange red humanoid</td><td>X</td></tr> <tr><td>362</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>363</td><td>guardian of Armadyl</td><td>54</td><td>A worshipper of Armadyl</td><td>-</td></tr> <tr><td>364</td><td>Lucien</td><td>21</td><td>He walks with a limp</td><td>X</td></tr> <tr><td>365</td><td>winelda</td><td>25</td><td>A witch</td><td>-</td></tr> <tr><td>366</td><td>Brother Kojo</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>367</td><td>Dungeon Rat</td><td>16</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>368</td><td>Master fisher</td><td>15</td><td>The man in charge of the fishing guild</td><td>-</td></tr> <tr><td>369</td><td>Orven</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>370</td><td>Padik</td><td>30</td><td>He runs a fish exchange store</td><td>-</td></tr> <tr><td>371</td><td>Shopkeeper</td><td>0</td><td>He smells of fish</td><td>-</td></tr> <tr><td>372</td><td>Lady servil</td><td>2</td><td>She look's wealthy</td><td>-</td></tr> <tr><td>373</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>374</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>375</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>376</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>377</td><td>Jeremy Servil</td><td>0</td><td>A young squire</td><td>-</td></tr> <tr><td>378</td><td>Justin Servil</td><td>0</td><td>Jeremy servil's father</td><td>-</td></tr> <tr><td>379</td><td>fightslave joe</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>380</td><td>fightslave kelvin</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>381</td><td>local</td><td>7</td><td>A scruffy looking chap</td><td>-</td></tr> <tr><td>382</td><td>Khazard Bartender</td><td>0</td><td>A tough looking barman</td><td>-</td></tr> <tr><td>383</td><td>General Khazard</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>384</td><td>Khazard Ogre</td><td>58</td><td>Khazard's strongest ogre warrior</td><td>X</td></tr> <tr><td>385</td><td>Guard</td><td>28</td><td>It's one of General Khazard's guard's</td><td>-</td></tr> <tr><td>386</td><td>Khazard Scorpion</td><td>46</td><td>A large angry scorpion</td><td>X</td></tr> <tr><td>387</td><td>hengrad</td><td>0</td><td>He look's mistreated and weak</td><td>-</td></tr> <tr><td>388</td><td>Bouncer</td><td>122</td><td>Hello nice doggy</td><td>X</td></tr> <tr><td>389</td><td>Stankers</td><td>0</td><td>A cheerful looking fellow</td><td>-</td></tr> <tr><td>390</td><td>Docky</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>391</td><td>Shopkeeper</td><td>0</td><td>Maybe he'd like to buy some of my junk</td><td>-</td></tr> <tr><td>392</td><td>Fairy queen</td><td>2</td><td>A very little queen</td><td>-</td></tr> <tr><td>393</td><td>Merlin</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>394</td><td>Crone</td><td>25</td><td>A strange old lady</td><td>-</td></tr> <tr><td>395</td><td>High priest of entrana</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>396</td><td>elkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>397</td><td>remsai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>398</td><td>bolkoy</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>399</td><td>local gnome</td><td>3</td><td>It's a young tree gnome</td><td>X</td></tr> <tr><td>400</td><td>bolren</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>401</td><td>Black Knight titan</td><td>146</td><td>He is blocking the way</td><td>X</td></tr> <tr><td>402</td><td>kalron</td><td>3</td><td>he look's lost</td><td>X</td></tr> <tr><td>403</td><td>brother Galahad</td><td>13</td><td>A Peaceful monk</td><td>-</td></tr> <tr><td>404</td><td>tracker 1</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>405</td><td>tracker 2</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>406</td><td>tracker 3</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>407</td><td>Khazard troop</td><td>28</td><td>It's one of General Khazard's warrior's</td><td>X</td></tr> <tr><td>408</td><td>commander montai</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>409</td><td>gnome troop</td><td>3</td><td>It's a tree gnome trooper</td><td>X</td></tr> <tr><td>410</td><td>khazard warlord</td><td>100</td><td>He look's real nasty</td><td>X</td></tr> <tr><td>411</td><td>Sir Percival</td><td>56</td><td>He's covered in pieces of straw</td><td>-</td></tr> <tr><td>412</td><td>Fisher king</td><td>30</td><td>an old king</td><td>-</td></tr> <tr><td>413</td><td>maiden</td><td>2</td><td>She has a far away look in her eyes</td><td>-</td></tr> <tr><td>414</td><td>Fisherman</td><td>30</td><td>an old fisherman</td><td>-</td></tr> <tr><td>415</td><td>King Percival</td><td>56</td><td>The new fisher king</td><td>-</td></tr> <tr><td>416</td><td>unhappy peasant</td><td>25</td><td>He looks tired and hungry</td><td>X</td></tr> <tr><td>417</td><td>happy peasant</td><td>25</td><td>He looks well fed and full of energy</td><td>X</td></tr> <tr><td>418</td><td>ceril</td><td>9</td><td>It's Sir ceril carnillean a local noblemen</td><td>-</td></tr> <tr><td>419</td><td>butler</td><td>9</td><td>It's the carnillean family butler</td><td>-</td></tr> <tr><td>420</td><td>carnillean guard</td><td>28</td><td>It's a carnillean family guard</td><td>X</td></tr> <tr><td>421</td><td>Tribesman</td><td>39</td><td>A primative warrior</td><td>X</td></tr> <tr><td>422</td><td>henryeta</td><td>2</td><td>It's a wealthy looking woman</td><td>-</td></tr> <tr><td>423</td><td>philipe</td><td>0</td><td>It's a young well dressed boy</td><td>-</td></tr> <tr><td>424</td><td>clivet</td><td>20</td><td>A strange looking man in black </td><td>-</td></tr> <tr><td>425</td><td>cult member</td><td>20</td><td>An suspicous looking man in black </td><td>X</td></tr> <tr><td>426</td><td>Lord hazeel</td><td>100</td><td>He could do with some sun</td><td>X</td></tr> <tr><td>427</td><td>alomone</td><td>42</td><td>A musculer looking man in black </td><td>-</td></tr> <tr><td>428</td><td>Khazard commander</td><td>41</td><td>It's one of General Khazard's commander's</td><td>X</td></tr> <tr><td>429</td><td>claus</td><td>15</td><td>the carnillean family cook</td><td>-</td></tr> <tr><td>430</td><td>1st plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>431</td><td>2nd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>432</td><td>3rd plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>433</td><td>4th plague sheep</td><td>0</td><td>The sheep has the plague</td><td>-</td></tr> <tr><td>434</td><td>Farmer brumty</td><td>15</td><td>He looks after livestock in this area</td><td>-</td></tr> <tr><td>435</td><td>Doctor orbon</td><td>15</td><td>A local doctor</td><td>-</td></tr> <tr><td>436</td><td>Councillor Halgrive</td><td>20</td><td>A town counceller</td><td>-</td></tr> <tr><td>437</td><td>Edmond</td><td>20</td><td>A local civilian</td><td>-</td></tr> <tr><td>438</td><td>Citizen</td><td>11</td><td>He look's tired</td><td>X</td></tr> <tr><td>439</td><td>Citizen</td><td>10</td><td>He look's frightened</td><td>X</td></tr> <tr><td>440</td><td>Citizen</td><td>12</td><td>She look's frustrated</td><td>X</td></tr> <tr><td>441</td><td>Citizen</td><td>20</td><td>He look's angry</td><td>X</td></tr> <tr><td>442</td><td>Citizen</td><td>15</td><td>He look's disillusioned</td><td>X</td></tr> <tr><td>443</td><td>Jethick</td><td>15</td><td>A cynical old man</td><td>-</td></tr> <tr><td>444</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>445</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>446</td><td>Ted Rehnison</td><td>9</td><td>The head of the Rehnison family</td><td>-</td></tr> <tr><td>447</td><td>Martha Rehnison</td><td>12</td><td>A fairly poor looking woman</td><td>-</td></tr> <tr><td>448</td><td>Billy Rehnison</td><td>45</td><td>The Rehnisons eldest son</td><td>-</td></tr> <tr><td>449</td><td>Milli Rehnison</td><td>39</td><td>She doesn't seem very happy</td><td>-</td></tr> <tr><td>450</td><td>Alrena</td><td>2</td><td>She look's concerned</td><td>-</td></tr> <tr><td>451</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>452</td><td>Clerk</td><td>2</td><td>A bueracratic administrator</td><td>-</td></tr> <tr><td>453</td><td>Carla</td><td>2</td><td>She look's upset</td><td>-</td></tr> <tr><td>454</td><td>Bravek</td><td>30</td><td>The city warder of West Ardougne</td><td>-</td></tr> <tr><td>455</td><td>Caroline</td><td>2</td><td>A well dressed middle aged lady</td><td>-</td></tr> <tr><td>456</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>457</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>458</td><td>Holgart</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>459</td><td>kent</td><td>45</td><td>caroline's husband</td><td>-</td></tr> <tr><td>460</td><td>bailey</td><td>15</td><td>the fishing platform cook</td><td>-</td></tr> <tr><td>461</td><td>kennith</td><td>0</td><td>A young scared looking boy</td><td>-</td></tr> <tr><td>462</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>463</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>464</td><td>Platform Fisherman</td><td>30</td><td>an emotionless fisherman</td><td>X</td></tr> <tr><td>465</td><td>Elena</td><td>2</td><td>She doesn't look too happy</td><td>-</td></tr> <tr><td>466</td><td>jinno</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>467</td><td>Watto</td><td>30</td><td>He doesn't seem to mind his lack of legs</td><td>-</td></tr> <tr><td>468</td><td>Recruiter</td><td>51</td><td>A member of the Ardougne royal army</td><td>-</td></tr> <tr><td>469</td><td>Head mourner</td><td>2</td><td>In charge of people with silly outfits</td><td>-</td></tr> <tr><td>470</td><td>Almera</td><td>2</td><td>A woman of the wilderness</td><td>-</td></tr> <tr><td>471</td><td>hudon</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>472</td><td>hadley</td><td>30</td><td>A happy looking fellow</td><td>-</td></tr> <tr><td>473</td><td>Rat</td><td>7</td><td>Overgrown vermin</td><td>X</td></tr> <tr><td>474</td><td>Combat instructor</td><td>51</td><td>He will tell me how to fight</td><td>-</td></tr> <tr><td>475</td><td>golrie</td><td>3</td><td>It's a tree gnome</td><td>-</td></tr> <tr><td>476</td><td>Guide</td><td>1</td><td>She gives hints to new adventurers</td><td>-</td></tr> <tr><td>477</td><td>King Black Dragon</td><td>245</td><td>The biggest meanest dragon around</td><td>X</td></tr> <tr><td>478</td><td>cooking instructor</td><td>15</td><td>Talk to him to learn about runescape food</td><td>-</td></tr> <tr><td>479</td><td>fishing instructor</td><td>15</td><td>He smells of fish</td><td>-</td></tr> <tr><td>480</td><td>financial advisor</td><td>0</td><td>He knows about money</td><td>-</td></tr> <tr><td>481</td><td>gerald</td><td>15</td><td>An old fisherman</td><td>-</td></tr> <tr><td>482</td><td>mining instructor</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>483</td><td>Elena</td><td>2</td><td>She looks concerned</td><td>-</td></tr> <tr><td>484</td><td>Omart</td><td>30</td><td>A nervous looking fellow</td><td>-</td></tr> <tr><td>485</td><td>Bank assistant</td><td>9</td><td>She can look after my stuff</td><td>-</td></tr> <tr><td>486</td><td>Jerico</td><td>15</td><td>He looks friendly enough</td><td>-</td></tr> <tr><td>487</td><td>Kilron</td><td>15</td><td>He looks shifty</td><td>-</td></tr> <tr><td>488</td><td>Guidor's wife</td><td>2</td><td>She looks rather concerned</td><td>-</td></tr> <tr><td>489</td><td>Quest advisor</td><td>51</td><td>I wonder what advise he has to impart</td><td>-</td></tr> <tr><td>490</td><td>chemist</td><td>4</td><td>human</td><td>-</td></tr> <tr><td>491</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>492</td><td>Mourner</td><td>2</td><td>A mourner or plague healer</td><td>-</td></tr> <tr><td>493</td><td>Wilderness guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>494</td><td>Magic Instructor</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>495</td><td>Mourner</td><td>22</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>496</td><td>Community instructor</td><td>2</td><td>This is the last advisor - honest</td><td>-</td></tr> <tr><td>497</td><td>boatman</td><td>20</td><td>An old sailor</td><td>-</td></tr> <tr><td>498</td><td>skeleton mage</td><td>21</td><td>It rattles as it walks</td><td>X</td></tr> <tr><td>499</td><td>controls guide</td><td>29</td><td>He's ready for a fight</td><td>-</td></tr> <tr><td>500</td><td>nurse sarah</td><td>2</td><td>She's quite a looker</td><td>-</td></tr> <tr><td>501</td><td>Tailor</td><td>29</td><td>He's ready for a party</td><td>-</td></tr> <tr><td>502</td><td>Mourner</td><td>25</td><td>A mourner or plague healer</td><td>X</td></tr> <tr><td>503</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>504</td><td>Chemist</td><td>29</td><td>He looks clever enough</td><td>-</td></tr> <tr><td>505</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>506</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>507</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>508</td><td>Guidor</td><td>29</td><td>He's not that ill</td><td>-</td></tr> <tr><td>509</td><td>Chancy</td><td>29</td><td>He's ready for a bet</td><td>-</td></tr> <tr><td>510</td><td>Hops</td><td>29</td><td>He's drunk</td><td>-</td></tr> <tr><td>511</td><td>DeVinci</td><td>29</td><td>He has a colourful personality</td><td>-</td></tr> <tr><td>512</td><td>king Lathas</td><td>30</td><td>King Lanthas of east ardounge</td><td>-</td></tr> <tr><td>513</td><td>Head wizard</td><td>12</td><td>He runs the wizards guild</td><td>-</td></tr> <tr><td>514</td><td>Magic store owner</td><td>12</td><td>An old wizard</td><td>-</td></tr> <tr><td>515</td><td>Wizard Frumscone</td><td>12</td><td>A confused looking wizard</td><td>-</td></tr> <tr><td>516</td><td>target practice zombie</td><td>24</td><td>The living dead</td><td>X</td></tr> <tr><td>517</td><td>Trufitus</td><td>6</td><td>A wise old witch doctor</td><td>-</td></tr> <tr><td>518</td><td>Colonel Radick</td><td>51</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>519</td><td>Soldier</td><td>28</td><td>A soldier of the town of Yanille</td><td>X</td></tr> <tr><td>520</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>521</td><td>Jungle Spider</td><td>47</td><td>A venomous deadly spider</td><td>X</td></tr> <tr><td>522</td><td>Jiminua</td><td>0</td><td>She looks very interested in selling some of her wares.</td><td>-</td></tr> <tr><td>523</td><td>Jogre</td><td>58</td><td>An aggressive humanoid</td><td>X</td></tr> <tr><td>524</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>525</td><td>Ogre</td><td>58</td><td>Useful for ranged training</td><td>X</td></tr> <tr><td>526</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>527</td><td>Guard</td><td>28</td><td>He tries to keep order around here</td><td>-</td></tr> <tr><td>528</td><td>shop keeper</td><td>0</td><td>he sells weapons</td><td>-</td></tr> <tr><td>529</td><td>Bartender</td><td>0</td><td>I could get a beer off him</td><td>-</td></tr> <tr><td>530</td><td>Frenita</td><td>0</td><td>runs a cookery shop</td><td>-</td></tr> <tr><td>531</td><td>Ogre chieftan</td><td>78</td><td>A slightly bigger uglier ogre</td><td>X</td></tr> <tr><td>532</td><td>rometti</td><td>3</td><td>It's a well dressed tree gnome</td><td>-</td></tr> <tr><td>533</td><td>Rashiliyia</td><td>80</td><td>A willowy ethereal being who floats above the ground</td><td>-</td></tr> <tr><td>534</td><td>Blurberry</td><td>3</td><td>It's a red faced tree gnome</td><td>-</td></tr> <tr><td>535</td><td>Heckel funch</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>536</td><td>Aluft Gianne</td><td>3</td><td>It's a tree gnome chef</td><td>-</td></tr> <tr><td>537</td><td>Hudo glenfad</td><td>3</td><td>It's another jolly tree gnome</td><td>-</td></tr> <tr><td>538</td><td>Irena</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>539</td><td>Mosol</td><td>0</td><td>A jungle warrior</td><td>-</td></tr> <tr><td>540</td><td>Gnome banker</td><td>3</td><td>It's tree gnome banker</td><td>-</td></tr> <tr><td>541</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>542</td><td>UndeadOne</td><td>62</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>543</td><td>Drucas</td><td>20</td><td>engraver</td><td>-</td></tr> <tr><td>544</td><td>tourist</td><td>29</td><td>human</td><td>-</td></tr> <tr><td>545</td><td>King Narnode Shareen</td><td>3</td><td>It's a gnome he look's important</td><td>-</td></tr> <tr><td>546</td><td>Hazelmere</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>547</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>548</td><td>Shar</td><td>0</td><td>Concerned about the economy</td><td>-</td></tr> <tr><td>549</td><td>Shantay</td><td>0</td><td>human</td><td>-</td></tr> <tr><td>550</td><td>charlie</td><td>0</td><td>Poor guy?</td><td>X</td></tr> <tr><td>551</td><td>Gnome guard</td><td>31</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>552</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>553</td><td>Mehman</td><td>29</td><td>local</td><td>-</td></tr> <tr><td>554</td><td>Ana</td><td>16</td><td>This lady doesn't look as if she belongs here.</td><td>-</td></tr> <tr><td>555</td><td>Chaos Druid warrior</td><td>44</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>556</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>557</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>558</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>559</td><td>Shipyard worker</td><td>44</td><td>He look's busy</td><td>X</td></tr> <tr><td>560</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>561</td><td>Shipyard foreman</td><td>62</td><td>He look's busy</td><td>-</td></tr> <tr><td>562</td><td>Gnome guard</td><td>23</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>563</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>564</td><td>Femi</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>565</td><td>Anita</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>566</td><td>Glough</td><td>3</td><td>An rough looking gnome</td><td>-</td></tr> <tr><td>567</td><td>Salarin the twisted</td><td>69</td><td>A crazy evil druid</td><td>X</td></tr> <tr><td>568</td><td>Black Demon</td><td>175</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>569</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>570</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>571</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>572</td><td>Gnome pilot</td><td>3</td><td>He can fly the glider</td><td>-</td></tr> <tr><td>573</td><td>Sigbert the Adventurer</td><td>56</td><td>A Warrior</td><td>-</td></tr> <tr><td>574</td><td>Yanille Watchman</td><td>33</td><td>He watches out for invading ogres</td><td>X</td></tr> <tr><td>575</td><td>Tower guard</td><td>33</td><td>He stops people going up the tower</td><td>-</td></tr> <tr><td>576</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>577</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>578</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>579</td><td>Gnome Trainer</td><td>11</td><td>He can advise on training</td><td>-</td></tr> <tr><td>580</td><td>Blurberry barman</td><td>3</td><td>He serves cocktails</td><td>-</td></tr> <tr><td>581</td><td>Gnome waiter</td><td>3</td><td>He can serve you gnome food</td><td>-</td></tr> <tr><td>582</td><td>Gnome guard</td><td>27</td><td>A tree gnome guard</td><td>X</td></tr> <tr><td>583</td><td>Gnome child</td><td>3</td><td>that's a little gnome</td><td>X</td></tr> <tr><td>584</td><td>Earth warrior</td><td>52</td><td>A strange inhuman warrior</td><td>X</td></tr> <tr><td>585</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>X</td></tr> <tr><td>586</td><td>Gnome child</td><td>3</td><td>hello little gnome</td><td>X</td></tr> <tr><td>587</td><td>Gulluck</td><td>10</td><td>He sells weapons</td><td>-</td></tr> <tr><td>588</td><td>Gunnjorn</td><td>16</td><td>Not civilised looking</td><td>-</td></tr> <tr><td>589</td><td>Zadimus</td><td>0</td><td>Ghostly Visage of the dead Zadimus</td><td>-</td></tr> <tr><td>590</td><td>Brimstail</td><td>3</td><td>An ancient looking gnome</td><td>-</td></tr> <tr><td>591</td><td>Gnome child</td><td>3</td><td>He's a little fellow</td><td>-</td></tr> <tr><td>592</td><td>Gnome local</td><td>9</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>593</td><td>Gnome local</td><td>3</td><td>A tree gnome villager</td><td>X</td></tr> <tr><td>594</td><td>Moss Giant</td><td>62</td><td>his beard seems to have a life of its own</td><td>X</td></tr> <tr><td>595</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>596</td><td>Goalie</td><td>70</td><td>A gnome ball goal catcher</td><td>-</td></tr> <tr><td>597</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>598</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>599</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>600</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>601</td><td>Referee</td><td>3</td><td>He controls the game</td><td>-</td></tr> <tr><td>602</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>603</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>604</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>605</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>606</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>607</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>608</td><td>Gnome Baller</td><td>70</td><td>A tree gnome ball player</td><td>X</td></tr> <tr><td>609</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>610</td><td>Gnome Baller</td><td>70</td><td>He's on your team</td><td>-</td></tr> <tr><td>611</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>612</td><td>Cheerleader</td><td>3</td><td>It's a little tree gnome</td><td>-</td></tr> <tr><td>613</td><td>Nazastarool Zombie</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>614</td><td>Nazastarool Skeleton</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>615</td><td>Nazastarool Ghost</td><td>83</td><td>One of Rashaliyas Minions</td><td>X</td></tr> <tr><td>616</td><td>Fernahei</td><td>6</td><td>An enthusiastic fishing shop owner</td><td>-</td></tr> <tr><td>617</td><td>Jungle Banker</td><td>9</td><td>He can look after my money</td><td>-</td></tr> <tr><td>618</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>619</td><td>Cart Driver</td><td>15</td><td>He drives the cart</td><td>-</td></tr> <tr><td>620</td><td>Obli</td><td>0</td><td>An intelligent looking shop owner</td><td>-</td></tr> <tr><td>621</td><td>Kaleb</td><td>0</td><td>This is Kaleb Paramaya - a warm and friendly inn owner</td><td>-</td></tr> <tr><td>622</td><td>Yohnus</td><td>0</td><td>This is Yohnus - he runs the local blacksmiths</td><td>-</td></tr> <tr><td>623</td><td>Serevel</td><td>0</td><td>This is Serevel - he sells tickets for the 'Lady of the Waves'</td><td>-</td></tr> <tr><td>624</td><td>Yanni</td><td>0</td><td>Yanni Salika - He buys and sells antiques.</td><td>-</td></tr> <tr><td>625</td><td>Official</td><td>3</td><td>He helps the referee</td><td>-</td></tr> <tr><td>626</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>627</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>628</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>629</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>630</td><td>Blessed Vermen</td><td>14</td><td>A undead servent of iban</td><td>X</td></tr> <tr><td>631</td><td>Blessed Spider</td><td>35</td><td>One of iban's eight legged friends</td><td>X</td></tr> <tr><td>632</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>633</td><td>Paladin</td><td>71</td><td>A paladin of Ardougne</td><td>X</td></tr> <tr><td>634</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>635</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>636</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>637</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>638</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>639</td><td>slave</td><td>16</td><td>He seems possessed</td><td>X</td></tr> <tr><td>640</td><td>slave</td><td>16</td><td>He seems to have been here a while</td><td>X</td></tr> <tr><td>641</td><td>Kalrag</td><td>78</td><td>I think this is one of Ibans pets</td><td>X</td></tr> <tr><td>642</td><td>Niloof</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>643</td><td>Kardia the Witch</td><td>25</td><td>She's got warts</td><td>-</td></tr> <tr><td>644</td><td>Souless</td><td>16</td><td>He seems an empty shell</td><td>X</td></tr> <tr><td>645</td><td>Othainian</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>646</td><td>Doomion</td><td>98</td><td>A big scary jet black demon</td><td>X</td></tr> <tr><td>647</td><td>Holthion</td><td>78</td><td>big red and incredibly evil</td><td>X</td></tr> <tr><td>648</td><td>Klank</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>649</td><td>Iban</td><td>21</td><td>You feel terror just looking at him</td><td>-</td></tr> <tr><td>650</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>651</td><td>Goblin guard</td><td>48</td><td>An imposing green creature</td><td>X</td></tr> <tr><td>652</td><td>Observatory Professor</td><td>4</td><td>He works in the observatory</td><td>-</td></tr> <tr><td>653</td><td>Ugthanki</td><td>45</td><td>A dangerous type of spitting camel that can temporarily blind an opponent.</td><td>X</td></tr> <tr><td>654</td><td>Observatory assistant</td><td>4</td><td>The Professor's assistant</td><td>-</td></tr> <tr><td>655</td><td>Souless</td><td>24</td><td>A servent to zamorak</td><td>X</td></tr> <tr><td>656</td><td>Dungeon spider</td><td>22</td><td>A nasty poisonous arachnid</td><td>X</td></tr> <tr><td>657</td><td>Kamen</td><td>18</td><td>A short angry guy</td><td>-</td></tr> <tr><td>658</td><td>Iban disciple</td><td>19</td><td>An evil follower of Iban</td><td>X</td></tr> <tr><td>659</td><td>Koftik</td><td>16</td><td>The kings top tracker</td><td>-</td></tr> <tr><td>660</td><td>Goblin</td><td>19</td><td>These goblins have grown strong</td><td>X</td></tr> <tr><td>661</td><td>Chadwell</td><td>16</td><td>A sturdy looking gent</td><td>-</td></tr> <tr><td>662</td><td>Professor</td><td>4</td><td>The owner of the observatory</td><td>-</td></tr> <tr><td>663</td><td>San Tojalon</td><td>120</td><td>The animated spirit of San Tojalon</td><td>X</td></tr> <tr><td>664</td><td>Ghost</td><td>29</td><td>A doomed victim of zamorak</td><td>X</td></tr> <tr><td>665</td><td>Spirit of Scorpius</td><td>100</td><td>The undead spirit of the follower of Zamorak</td><td>-</td></tr> <tr><td>666</td><td>Scorpion</td><td>21</td><td>There are nasty scorpions around this grave</td><td>-</td></tr> <tr><td>667</td><td>Dark Mage</td><td>0</td><td>He works in the ways of dark magic</td><td>-</td></tr> <tr><td>668</td><td>Mercenary</td><td>50</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>669</td><td>Mercenary Captain</td><td>64</td><td>He's in control of the local guards.</td><td>X</td></tr> <tr><td>670</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>671</td><td>Mining Slave</td><td>16</td><td>A chained slave forced to mine rocks.</td><td>X</td></tr> <tr><td>672</td><td>Watchtower wizard</td><td>12</td><td>A learned man</td><td>-</td></tr> <tr><td>673</td><td>Ogre Shaman</td><td>100</td><td>An intelligent form of ogre</td><td>-</td></tr> <tr><td>674</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>675</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>676</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>677</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>-</td></tr> <tr><td>678</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>679</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>680</td><td>Og</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>681</td><td>Grew</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>682</td><td>Toban</td><td>78</td><td>The chieftan of this ogre tribe</td><td>-</td></tr> <tr><td>683</td><td>Gorad</td><td>78</td><td>A high ranking ogre official</td><td>X</td></tr> <tr><td>684</td><td>Ogre guard</td><td>96</td><td>this creature looks very tough</td><td>X</td></tr> <tr><td>685</td><td>Yanille Watchman</td><td>33</td><td>A captured guard of Yanille</td><td>-</td></tr> <tr><td>686</td><td>Ogre merchant</td><td>58</td><td>He sells ogre-inspired items</td><td>-</td></tr> <tr><td>687</td><td>Ogre trader</td><td>58</td><td>He trades in metals</td><td>-</td></tr> <tr><td>688</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>689</td><td>Ogre trader</td><td>58</td><td>He trades in food</td><td>-</td></tr> <tr><td>690</td><td>Mercenary</td><td>39</td><td>He seems to be guarding an area</td><td>X</td></tr> <tr><td>691</td><td>City Guard</td><td>78</td><td>high ranking ogre guards</td><td>-</td></tr> <tr><td>692</td><td>Mercenary</td><td>39</td><td>He seems to be guarding this area</td><td>X</td></tr> <tr><td>693</td><td>Lawgof</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>694</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>695</td><td>lollk</td><td>18</td><td>He looks scared</td><td>-</td></tr> <tr><td>696</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>697</td><td>Ogre guard</td><td>78</td><td>These ogres protect the city</td><td>X</td></tr> <tr><td>698</td><td>Nulodion</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>699</td><td>Dwarf</td><td>18</td><td>A short angry guy</td><td>X</td></tr> <tr><td>700</td><td>Al Shabim</td><td>0</td><td>The leader of a nomadic Bedabin desert people - sometimes referred to as the 'Tenti's'</td><td>-</td></tr> <tr><td>701</td><td>Bedabin Nomad</td><td>0</td><td>A Bedabin nomad - they live in the harshest extremes in the desert</td><td>-</td></tr> <tr><td>702</td><td>Captain Siad</td><td>48</td><td>He's in control of the whole mining camp.</td><td>X</td></tr> <tr><td>703</td><td>Bedabin Nomad Guard</td><td>70</td><td>A Bedabin nomad guard - he's protecting something important</td><td>X</td></tr> <tr><td>704</td><td>Ogre citizen</td><td>58</td><td>A denizen of Gu'Tanoth</td><td>X</td></tr> <tr><td>705</td><td>Rock of ages</td><td>150</td><td>A huge boulder</td><td>X</td></tr> <tr><td>706</td><td>Ogre</td><td>58</td><td>A large dim looking humanoid</td><td>X</td></tr> <tr><td>707</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>708</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>709</td><td>Skavid</td><td>3</td><td>Servant race to the ogres</td><td>-</td></tr> <tr><td>710</td><td>Draft Mercenary Guard</td><td>50</td><td>He's quickly drafted in to deal with trouble makers</td><td>X</td></tr> <tr><td>711</td><td>Mining Cart Driver</td><td>15</td><td>He drives the mining cart</td><td>-</td></tr> <tr><td>712</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>-</td></tr> <tr><td>713</td><td>kolodion</td><td>12</td><td>He runs the mage arena</td><td>X</td></tr> <tr><td>714</td><td>Gertrude</td><td>20</td><td>A busy housewife</td><td>-</td></tr> <tr><td>715</td><td>Shilop</td><td>0</td><td>A young boisterous looking lad</td><td>-</td></tr> <tr><td>716</td><td>Rowdy Guard</td><td>50</td><td>He looks as if he's spoiling for trouble</td><td>X</td></tr> <tr><td>717</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>X</td></tr> <tr><td>718</td><td>Rowdy Slave</td><td>16</td><td>A slave who's looking for trouble.</td><td>X</td></tr> <tr><td>719</td><td>Shantay Pass Guard</td><td>32</td><td>He seems to be guarding the Shantay Pass</td><td>-</td></tr> <tr><td>720</td><td>Assistant</td><td>0</td><td>He is an assistant to Shantay and helps him to run the pass.</td><td>-</td></tr> <tr><td>721</td><td>Desert Wolf</td><td>31</td><td>A vicious Desert wolf</td><td>X</td></tr> <tr><td>722</td><td>Workman</td><td>9</td><td>This person is working on the site</td><td>-</td></tr> <tr><td>723</td><td>Examiner</td><td>2</td><td>As you examine the examiner you examine that she is indeed an examiner!!</td><td>-</td></tr> <tr><td>724</td><td>Student</td><td>0</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>725</td><td>Student</td><td>20</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>726</td><td>Guide</td><td>12</td><td>This person specialises in panning for gold</td><td>-</td></tr> <tr><td>727</td><td>Student</td><td>18</td><td>A student busily digging!</td><td>-</td></tr> <tr><td>728</td><td>Archaeological expert</td><td>15</td><td>An expert on archaeology!</td><td>-</td></tr> <tr><td>729</td><td>civillian</td><td>18</td><td>He looks aggitated!</td><td>X</td></tr> <tr><td>730</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>731</td><td>civillian</td><td>0</td><td>She looks aggitated!</td><td>-</td></tr> <tr><td>732</td><td>civillian</td><td>15</td><td>He looks aggitated!</td><td>-</td></tr> <tr><td>733</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>734</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>735</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>736</td><td>Legends Guild Guard</td><td>50</td><td>This guard is protecting the entrance to the Legends Guild.</td><td>-</td></tr> <tr><td>737</td><td>Escaping Mining Slave</td><td>16</td><td>An emancipated slave with cool Desert Clothes.</td><td>-</td></tr> <tr><td>738</td><td>Workman</td><td>9</td><td>This person is working in the mine</td><td>-</td></tr> <tr><td>739</td><td>Murphy</td><td>15</td><td>The man in charge of the fishing trawler</td><td>-</td></tr> <tr><td>740</td><td>Echned Zekin</td><td>50</td><td>An evil spirit of the underworld.</td><td>-</td></tr> <tr><td>741</td><td>Donovan the Handyman</td><td>9</td><td>It's the family odd jobs man</td><td>-</td></tr> <tr><td>742</td><td>Pierre the Dog Handler</td><td>9</td><td>It's the guy who looks after the family guard dog</td><td>-</td></tr> <tr><td>743</td><td>Hobbes the Butler</td><td>9</td><td>It's the family butler</td><td>-</td></tr> <tr><td>744</td><td>Louisa The Cook</td><td>0</td><td>It's the family cook</td><td>-</td></tr> <tr><td>745</td><td>Mary The Maid</td><td>25</td><td>The family maid</td><td>-</td></tr> <tr><td>746</td><td>Stanford The Gardener</td><td>8</td><td>It's the family Gardener</td><td>-</td></tr> <tr><td>747</td><td>Guard</td><td>28</td><td>He looks like he's in over his head here</td><td>-</td></tr> <tr><td>748</td><td>Guard Dog</td><td>46</td><td>He doesn't seem pleased to see me</td><td>-</td></tr> <tr><td>749</td><td>Guard</td><td>8</td><td>***EMPTY PLEASE USE OR REPLACE***</td><td>-</td></tr> <tr><td>750</td><td>Man</td><td>9</td><td>A thirsty looking man</td><td>-</td></tr> <tr><td>751</td><td>Anna Sinclair</td><td>9</td><td>The first child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>752</td><td>Bob Sinclair</td><td>9</td><td>The second child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>753</td><td>Carol Sinclair</td><td>9</td><td>The third child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>754</td><td>David Sinclair</td><td>9</td><td>The fourth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>755</td><td>Elizabeth Sinclair</td><td>9</td><td>The fifth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>756</td><td>Frank Sinclair</td><td>9</td><td>The sixth child of the late Lord Sinclair</td><td>-</td></tr> <tr><td>757</td><td>kolodion</td><td>65</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>758</td><td>kolodion</td><td>68</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>759</td><td>kolodion</td><td>46</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>760</td><td>kolodion</td><td>98</td><td>He's a shape shifter</td><td>X</td></tr> <tr><td>761</td><td>Irvig Senay</td><td>125</td><td>The animated spirit of Irvig Senay</td><td>X</td></tr> <tr><td>762</td><td>Ranalph Devere</td><td>130</td><td>The animated spirit of Ranalph Devere</td><td>X</td></tr> <tr><td>763</td><td>Poison Salesman</td><td>7</td><td>Peter Potter - Poison Purveyor</td><td>-</td></tr> <tr><td>764</td><td>Gujuo</td><td>60</td><td>A tall charismatic looking jungle native - he approaches with confidence</td><td>-</td></tr> <tr><td>765</td><td>Jungle Forester</td><td>15</td><td>A woodsman who specialises in large and exotic timber</td><td>-</td></tr> <tr><td>766</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman</td><td>X</td></tr> <tr><td>767</td><td>Ungadulu</td><td>75</td><td>An ancient looking Shaman - he looks very strange with glowing red eyes...</td><td>X</td></tr> <tr><td>768</td><td>Death Wing</td><td>80</td><td>A supernatural creature of the underworld</td><td>X</td></tr> <tr><td>769</td><td>Nezikchened</td><td>172</td><td>An ancient powerful Demon of the Underworld...</td><td>X</td></tr> <tr><td>770</td><td>Dwarf Cannon engineer</td><td>18</td><td>He's the head of black guard weapon development</td><td>-</td></tr> <tr><td>771</td><td>Dwarf commander</td><td>18</td><td>He guards the mines</td><td>-</td></tr> <tr><td>772</td><td>Viyeldi</td><td>80</td><td>The spirit of a dead sorcerer</td><td>X</td></tr> <tr><td>773</td><td>Nurmof</td><td>18</td><td>He sells pickaxes</td><td>-</td></tr> <tr><td>774</td><td>Fatigue expert</td><td>10</td><td>He looks wide awake</td><td>-</td></tr> <tr><td>775</td><td>Karamja Wolf</td><td>61</td><td>A hungry</td><td>X</td></tr> <tr><td>776</td><td>Jungle Savage</td><td>87</td><td>A savage and fearless Jungle warrior</td><td>X</td></tr> <tr><td>777</td><td>Oomlie Bird</td><td>32</td><td>A variety of flightless jungle fowl - it has a sharp beak and a bad temper.</td><td>X</td></tr> <tr><td>778</td><td>Sidney Smith</td><td>30</td><td>Sidney Smith - Certification clerk</td><td>-</td></tr> <tr><td>779</td><td>Siegfried Erkle</td><td>25</td><td>An eccentric shop keeper - related to the Grand Vizier of the Legends Guild</td><td>-</td></tr> <tr><td>780</td><td>Tea seller</td><td>9</td><td>He has delicious tea to buy</td><td>-</td></tr> <tr><td>781</td><td>Wilough</td><td>0</td><td>A young son of gertrudes</td><td>-</td></tr> <tr><td>782</td><td>Philop</td><td>0</td><td>Gertrudes youngest</td><td>-</td></tr> <tr><td>783</td><td>Kanel</td><td>0</td><td>Gertrudes youngest's twin brother</td><td>-</td></tr> <tr><td>784</td><td>chamber guardian</td><td>15</td><td>He hasn't seen much sun latley</td><td>-</td></tr> <tr><td>785</td><td>Sir Radimus Erkle</td><td>10</td><td>A huge muscular man in charge of the Legends Guild</td><td>-</td></tr> <tr><td>786</td><td>Pit Scorpion</td><td>35</td><td>Very vicious little scorpions</td><td>X</td></tr> <tr><td>787</td><td>Shadow Warrior</td><td>64</td><td>A sinsistar shadowy figure</td><td>X</td></tr> <tr><td>788</td><td>Fionella</td><td>25</td><td>She runs the legend's general store</td><td>-</td></tr> <tr><td>789</td><td>Battle mage</td><td>52</td><td>He kills in the name of guthix</td><td>X</td></tr> <tr><td>790</td><td>Battle mage</td><td>52</td><td>He kills in the name of zamarok</td><td>X</td></tr> <tr><td>791</td><td>Battle mage</td><td>52</td><td>He kills in the name of Saradomin</td><td>X</td></tr> <tr><td>792</td><td>Gundai</td><td>15</td><td>He must get lonely out here</td><td>-</td></tr> <tr><td>793</td><td>Lundail</td><td>15</td><td>He sells rune stones</td><td>-</td></tr> 204 Objects 0 25 7k7wifvzp370ydrbghzj3ep9yo721x4 115 2011-06-20T04:51:02Z Admin 1 Created page with "<table border="1" cellpadding="5" cellspacing="3"> <tr><td>id</td><td>object name</td><td>description</td></tr> <tr><td class='a'>0</td><td class='a'>Tree</td><td class='a'>A ..." <table border="1" cellpadding="5" cellspacing="3"> <tr><td>id</td><td>object name</td><td>description</td></tr> <tr><td class='a'>0</td><td class='a'>Tree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>1</td><td class='a'>Tree</td><td class='a'>A leafy tree</td></tr> <tr><td class='a'>2</td><td class='a'>Well</td><td class='a'>The bucket is missing</td></tr> <tr><td class='a'>3</td><td class='a'>Table</td><td class='a'>A mighty fine table</td></tr> <tr><td class='a'>4</td><td class='a'>Treestump</td><td class='a'>Someone has chopped this tree down!</td></tr> <tr><td class='a'>5</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>6</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>7</td><td class='a'>Chair</td><td class='a'>A sturdy looking chair</td></tr> <tr><td class='a'>8</td><td class='a'>logs</td><td class='a'>A pile of logs</td></tr> <tr><td class='a'>9</td><td class='a'>Longtable</td><td class='a'>It has nice candles</td></tr> <tr><td class='a'>10</td><td class='a'>Throne</td><td class='a'>It looks fancy and expensive</td></tr> <tr><td class='a'>11</td><td class='a'>Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>12</td><td class='a'>Gravestone</td><td class='a'>R I P</td></tr> <tr><td class='a'>13</td><td class='a'>Gravestone</td><td class='a'>Its covered in moss</td></tr> <tr><td class='a'>14</td><td class='a'>Bed</td><td class='a'>Ooh nice blankets</td></tr> <tr><td class='a'>15</td><td class='a'>Bed</td><td class='a'>Its a bed - wow</td></tr> <tr><td class='a'>16</td><td class='a'>bar</td><td class='a'>Mmm beer</td></tr> <tr><td class='a'>17</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>18</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>19</td><td class='a'>Altar</td><td class='a'>Its an Altar</td></tr> <tr><td class='a'>20</td><td class='a'>Post</td><td class='a'>What am I examining posts for</td></tr> <tr><td class='a'>21</td><td class='a'>Support</td><td class='a'>A wooden pole</td></tr> <tr><td class='a'>22</td><td class='a'>barrel</td><td class='a'>Its empty</td></tr> <tr><td class='a'>23</td><td class='a'>Bench</td><td class='a'>It doesn't look very comfy</td></tr> <tr><td class='a'>24</td><td class='a'>Portrait</td><td class='a'>A painting of our beloved king</td></tr> <tr><td class='a'>25</td><td class='a'>candles</td><td class='a'>Candles on a fancy candlestick</td></tr> <tr><td class='a'>26</td><td class='a'>fountain</td><td class='a'>The water looks fairly clean</td></tr> <tr><td class='a'>27</td><td class='a'>landscape</td><td class='a'>An oil painting</td></tr> <tr><td class='a'>28</td><td class='a'>Millstones</td><td class='a'>You can use these to make flour</td></tr> <tr><td class='a'>29</td><td class='a'>Counter</td><td class='a'>It's the shop counter</td></tr> <tr><td class='a'>30</td><td class='a'>Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>31</td><td class='a'>Target</td><td class='a'>Coming soon archery practice</td></tr> <tr><td class='a'>32</td><td class='a'>PalmTree</td><td class='a'>A nice palm tree</td></tr> <tr><td class='a'>33</td><td class='a'>PalmTree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>34</td><td class='a'>Fern</td><td class='a'>A leafy plant</td></tr> <tr><td class='a'>35</td><td class='a'>Cactus</td><td class='a'>It looks very spikey</td></tr> <tr><td class='a'>36</td><td class='a'>Bullrushes</td><td class='a'>I wonder why it's called a bullrush</td></tr> <tr><td class='a'>37</td><td class='a'>Flower</td><td class='a'>Ooh thats pretty</td></tr> <tr><td class='a'>38</td><td class='a'>Mushroom</td><td class='a'>I think it's a poisonous one</td></tr> <tr><td class='a'>39</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>40</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>41</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>42</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>43</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>44</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>45</td><td class='a'>railing</td><td class='a'>nice safety measure</td></tr> <tr><td class='a'>46</td><td class='a'>pillar</td><td class='a'>An ornate pillar</td></tr> <tr><td class='a'>47</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>48</td><td class='a'>Sink</td><td class='a'>Its fairly dirty</td></tr> <tr><td class='a'>49</td><td class='a'>Dummy</td><td class='a'>I can practice my fighting here</td></tr> <tr><td class='a'>50</td><td class='a'>anvil</td><td class='a'>heavy metal</td></tr> <tr><td class='a'>51</td><td class='a'>Torch</td><td class='a'>It would be very dark without this</td></tr> <tr><td class='a'>52</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>53</td><td class='a'>chute</td><td class='a'>Flour comes out here</td></tr> <tr><td class='a'>54</td><td class='a'>cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>55</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>56</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>57</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>58</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>59</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>60</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>61</td><td class='a'>signpost</td><td class='a'>To Varrock</td></tr> <tr><td class='a'>62</td><td class='a'>signpost</td><td class='a'>To the tower of wizards</td></tr> <tr><td class='a'>63</td><td class='a'>doors</td><td class='a'>The doors are open</td></tr> <tr><td class='a'>64</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>65</td><td class='a'>signpost</td><td class='a'>To player owned houses</td></tr> <tr><td class='a'>66</td><td class='a'>signpost</td><td class='a'>To Lumbridge Castle</td></tr> <tr><td class='a'>67</td><td class='a'>bookcase</td><td class='a'>It's a bookcase</td></tr> <tr><td class='a'>68</td><td class='a'>henge</td><td class='a'>these look impressive</td></tr> <tr><td class='a'>69</td><td class='a'>Dolmen</td><td class='a'>A sort of ancient altar thingy</td></tr> <tr><td class='a'>70</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>71</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>72</td><td class='a'>Wheat</td><td class='a'>nice ripe looking wheat</td></tr> <tr><td class='a'>73</td><td class='a'>sign</td><td class='a'>The blue moon inn</td></tr> <tr><td class='a'>74</td><td class='a'>sails</td><td class='a'>The windmill's sails</td></tr> <tr><td class='a'>75</td><td class='a'>sign</td><td class='a'>estate agent</td></tr> <tr><td class='a'>76</td><td class='a'>sign</td><td class='a'>The Jolly boar inn</td></tr> <tr><td class='a'>77</td><td class='a'>Drain</td><td class='a'>This drainpipe runs from the kitchen to the sewers</td></tr> <tr><td class='a'>78</td><td class='a'>manhole</td><td class='a'>A manhole cover</td></tr> <tr><td class='a'>79</td><td class='a'>manhole</td><td class='a'>How dangerous - this manhole has been left open</td></tr> <tr><td class='a'>80</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>81</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>82</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>83</td><td class='a'>barrel</td><td class='a'>It seems to be full of newt's eyes</td></tr> <tr><td class='a'>84</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>85</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>86</td><td class='a'>fountain</td><td class='a'>I think I see something in the fountain</td></tr> <tr><td class='a'>87</td><td class='a'>signpost</td><td class='a'>To Draynor Manor</td></tr> <tr><td class='a'>88</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>89</td><td class='a'>sign</td><td class='a'>General Store</td></tr> <tr><td class='a'>90</td><td class='a'>sign</td><td class='a'>Lowe's Archery store</td></tr> <tr><td class='a'>91</td><td class='a'>sign</td><td class='a'>The Clothes Shop</td></tr> <tr><td class='a'>92</td><td class='a'>sign</td><td class='a'>Varrock Swords</td></tr> <tr><td class='a'>93</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>94</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>95</td><td class='a'>sign</td><td class='a'>Bob's axes</td></tr> <tr><td class='a'>96</td><td class='a'>sign</td><td class='a'>The staff shop</td></tr> <tr><td class='a'>97</td><td class='a'>fire</td><td class='a'>A strongly burning fire</td></tr> <tr><td class='a'>98</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>99</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>100</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>101</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>102</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>103</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>104</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>105</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>106</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>107</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>108</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>109</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>110</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>111</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>112</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>113</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>114</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>115</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>116</td><td class='a'>web</td><td class='a'>A spider's web</td></tr> <tr><td class='a'>117</td><td class='a'>web</td><td class='a'>A spider's web</td></tr> <tr><td class='a'>118</td><td class='a'>furnace</td><td class='a'>A red hot furnace</td></tr> <tr><td class='a'>119</td><td class='a'>Cook's Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>120</td><td class='a'>Machine</td><td class='a'>I wonder what it's supposed to do</td></tr> <tr><td class='a'>121</td><td class='a'>Spinning wheel</td><td class='a'>I can spin wool on this</td></tr> <tr><td class='a'>122</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>123</td><td class='a'>Lever</td><td class='a'>The lever is down</td></tr> <tr><td class='a'>124</td><td class='a'>LeverA</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>125</td><td class='a'>LeverB</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>126</td><td class='a'>LeverC</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>127</td><td class='a'>LeverD</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>128</td><td class='a'>LeverE</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>129</td><td class='a'>LeverF</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>130</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>131</td><td class='a'>signpost</td><td class='a'>To the forge</td></tr> <tr><td class='a'>132</td><td class='a'>signpost</td><td class='a'>To the Barbarian's Village</td></tr> <tr><td class='a'>133</td><td class='a'>signpost</td><td class='a'>To Al Kharid</td></tr> <tr><td class='a'>134</td><td class='a'>Compost Heap</td><td class='a'>A smelly pile of compost</td></tr> <tr><td class='a'>135</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>136</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>137</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>138</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>139</td><td class='a'>sign</td><td class='a'>The Bank of runescape</td></tr> <tr><td class='a'>140</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>141</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>142</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>143</td><td class='a'>torch</td><td class='a'>A scary torch</td></tr> <tr><td class='a'>144</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>145</td><td class='a'>Shield</td><td class='a'>A display shield</td></tr> <tr><td class='a'>146</td><td class='a'>Grill</td><td class='a'>some sort of ventilation</td></tr> <tr><td class='a'>147</td><td class='a'>Cauldron</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>148</td><td class='a'>Grill</td><td class='a'>some sort of ventilation</td></tr> <tr><td class='a'>149</td><td class='a'>Mine Cart</td><td class='a'>It's empty</td></tr> <tr><td class='a'>150</td><td class='a'>Buffers</td><td class='a'>Stop the carts falling off the end</td></tr> <tr><td class='a'>151</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>152</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>153</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>154</td><td class='a'>Hole</td><td class='a'>I can see a witches cauldron directly below it</td></tr> <tr><td class='a'>155</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>156</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>157</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>158</td><td class='a'>Emergency escape ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>159</td><td class='a'>sign</td><td class='a'>Wydin's grocery</td></tr> <tr><td class='a'>160</td><td class='a'>sign</td><td class='a'>The Rusty Anchor</td></tr> <tr><td class='a'>161</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>162</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>163</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>164</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>165</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>166</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>167</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>168</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>169</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>170</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>171</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>172</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>173</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>174</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>175</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>176</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>177</td><td class='a'>Doric's anvil</td><td class='a'>Property of Doric the dwarf</td></tr> <tr><td class='a'>178</td><td class='a'>pottery oven</td><td class='a'>I can fire clay pots in this</td></tr> <tr><td class='a'>179</td><td class='a'>potter's wheel</td><td class='a'>I can make clay pots using this</td></tr> <tr><td class='a'>180</td><td class='a'>gate</td><td class='a'>A gate from Lumbridge to Al Kharid</td></tr> <tr><td class='a'>181</td><td class='a'>gate</td><td class='a'>This gate is open</td></tr> <tr><td class='a'>182</td><td class='a'>crate</td><td class='a'>A crate used for storing bananas</td></tr> <tr><td class='a'>183</td><td class='a'>Banana tree</td><td class='a'>A tree with nice ripe bananas growing on it</td></tr> <tr><td class='a'>184</td><td class='a'>Banana tree</td><td class='a'>There are no bananas left on the tree</td></tr> <tr><td class='a'>185</td><td class='a'>crate</td><td class='a'>A crate used for storing bananas</td></tr> <tr><td class='a'>186</td><td class='a'>Chest</td><td class='a'>A battered old chest</td></tr> <tr><td class='a'>187</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>188</td><td class='a'>Flower</td><td class='a'>Ooh thats pretty</td></tr> <tr><td class='a'>189</td><td class='a'>sign</td><td class='a'>Fishing Supplies</td></tr> <tr><td class='a'>190</td><td class='a'>sign</td><td class='a'>Jewellers</td></tr> <tr><td class='a'>191</td><td class='a'>Potato</td><td class='a'>A potato plant</td></tr> <tr><td class='a'>192</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>193</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>194</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>195</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>196</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>197</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>198</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>199</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>200</td><td class='a'>Monks Altar</td><td class='a'>Its an Altar</td></tr> <tr><td class='a'>201</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>202</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>203</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>204</td><td class='a'>Smashed table</td><td class='a'>This table has seen better days</td></tr> <tr><td class='a'>205</td><td class='a'>Fungus</td><td class='a'>A creepy looking fungus</td></tr> <tr><td class='a'>206</td><td class='a'>Smashed chair</td><td class='a'>This chair is broken</td></tr> <tr><td class='a'>207</td><td class='a'>Broken pillar</td><td class='a'>The remains of a pillar</td></tr> <tr><td class='a'>208</td><td class='a'>Fallen tree</td><td class='a'>A fallen tree</td></tr> <tr><td class='a'>209</td><td class='a'>Danger Sign</td><td class='a'>Danger!</td></tr> <tr><td class='a'>210</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>211</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>212</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>213</td><td class='a'>Gravestone</td><td class='a'>A big impressive gravestone</td></tr> <tr><td class='a'>214</td><td class='a'>bone</td><td class='a'>Eep!</td></tr> <tr><td class='a'>215</td><td class='a'>bone</td><td class='a'>This would feed a dog for a month</td></tr> <tr><td class='a'>216</td><td class='a'>carcass</td><td class='a'>I think it's dead</td></tr> <tr><td class='a'>217</td><td class='a'>animalskull</td><td class='a'>I wouldn't like to meet a live one</td></tr> <tr><td class='a'>218</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>219</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>220</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>221</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>222</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>223</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>224</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>225</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>226</td><td class='a'>hole</td><td class='a'>This ship isn't much use with that there</td></tr> <tr><td class='a'>227</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>228</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>229</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>230</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>231</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>232</td><td class='a'>hole</td><td class='a'>This ship isn't much use with that there</td></tr> <tr><td class='a'>233</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>234</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>235</td><td class='a'>Altar of Guthix</td><td class='a'>A sort of ancient altar thingy</td></tr> <tr><td class='a'>236</td><td class='a'>The Cauldron of Thunder</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>237</td><td class='a'>Tree</td><td class='a'>A leafy tree</td></tr> <tr><td class='a'>238</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>239</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>240</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>241</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>242</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>243</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>244</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>245</td><td class='a'>Dramen Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>246</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>247</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>248</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>249</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>250</td><td class='a'>sign</td><td class='a'>2-handed swords sold here</td></tr> <tr><td class='a'>251</td><td class='a'>sign</td><td class='a'>ye olde herbalist</td></tr> <tr><td class='a'>252</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>253</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>254</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>255</td><td class='a'>Door mat</td><td class='a'>If I ever get my boots muddy I know where to come</td></tr> <tr><td class='a'>256</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>257</td><td class='a'>Cauldron</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>258</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>259</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>260</td><td class='a'>gate</td><td class='a'>The bank vault gate</td></tr> <tr><td class='a'>261</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>262</td><td class='a'>sign</td><td class='a'>Harry's fishing shack</td></tr> <tr><td class='a'>263</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>264</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>265</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>266</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>267</td><td class='a'>sign</td><td class='a'>The shrimp and parrot</td></tr> <tr><td class='a'>268</td><td class='a'>signpost</td><td class='a'>Palm Street</td></tr> <tr><td class='a'>269</td><td class='a'>Rockslide</td><td class='a'>A pile of rocks blocks your path</td></tr> <tr><td class='a'>270</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>271</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the lava!</td></tr> <tr><td class='a'>272</td><td class='a'>barrel</td><td class='a'>Its got ale in it</td></tr> <tr><td class='a'>273</td><td class='a'>table</td><td class='a'>It's a sturdy table</td></tr> <tr><td class='a'>274</td><td class='a'>Fireplace</td><td class='a'>It would be very cold without this</td></tr> <tr><td class='a'>275</td><td class='a'>Egg</td><td class='a'>Thats one big egg!</td></tr> <tr><td class='a'>276</td><td class='a'>Eggs</td><td class='a'>They'd make an impressive omlette</td></tr> <tr><td class='a'>277</td><td class='a'>Stalagmites</td><td class='a'>Hmm pointy</td></tr> <tr><td class='a'>278</td><td class='a'>Stool</td><td class='a'>A simple three legged stool</td></tr> <tr><td class='a'>279</td><td class='a'>Bench</td><td class='a'>It doesn't look to comfortable</td></tr> <tr><td class='a'>280</td><td class='a'>table</td><td class='a'>A round table ideal for knights</td></tr> <tr><td class='a'>281</td><td class='a'>table</td><td class='a'>A handy little table</td></tr> <tr><td class='a'>282</td><td class='a'>fountain of heros</td><td class='a'>Use a dragonstone gem here to increase it's abilties</td></tr> <tr><td class='a'>283</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>284</td><td class='a'>hedge</td><td class='a'>A carefully trimmed hedge</td></tr> <tr><td class='a'>285</td><td class='a'>flower</td><td class='a'>A nice colourful flower</td></tr> <tr><td class='a'>286</td><td class='a'>plant</td><td class='a'>Hmm leafy</td></tr> <tr><td class='a'>287</td><td class='a'>Giant crystal</td><td class='a'>How unusual a crystal with a wizard trapped in it</td></tr> <tr><td class='a'>288</td><td class='a'>sign</td><td class='a'>The dead man's chest</td></tr> <tr><td class='a'>289</td><td class='a'>sign</td><td class='a'>The rising sun</td></tr> <tr><td class='a'>290</td><td class='a'>crate</td><td class='a'>A large wooden storage box</td></tr> <tr><td class='a'>291</td><td class='a'>crate</td><td class='a'>A large wooden storage box</td></tr> <tr><td class='a'>292</td><td class='a'>ship</td><td class='a'>A merchant ship</td></tr> <tr><td class='a'>293</td><td class='a'>ship</td><td class='a'>A merchant ship</td></tr> <tr><td class='a'>294</td><td class='a'>beehive</td><td class='a'>It's guarded by angry looking bees</td></tr> <tr><td class='a'>295</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>296</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>297</td><td class='a'>sign</td><td class='a'>Hickton's Archery store</td></tr> <tr><td class='a'>298</td><td class='a'>signpost</td><td class='a'>To Camelot</td></tr> <tr><td class='a'>299</td><td class='a'>Archway</td><td class='a'>A decorative marble arch</td></tr> <tr><td class='a'>300</td><td class='a'>Obelisk of water</td><td class='a'>It doesn't look very wet</td></tr> <tr><td class='a'>301</td><td class='a'>Obelisk of fire</td><td class='a'>It doesn't look very hot</td></tr> <tr><td class='a'>302</td><td class='a'>sand pit</td><td class='a'>I can use a bucket to get sand from here</td></tr> <tr><td class='a'>303</td><td class='a'>Obelisk of air</td><td class='a'>A tall stone pointy thing</td></tr> <tr><td class='a'>304</td><td class='a'>Obelisk of earth</td><td class='a'>A tall stone pointy thing</td></tr> <tr><td class='a'>305</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>306</td><td class='a'>Oak Tree</td><td class='a'>A grand old oak tree</td></tr> <tr><td class='a'>307</td><td class='a'>Willow Tree</td><td class='a'>A weeping willow</td></tr> <tr><td class='a'>308</td><td class='a'>Maple Tree</td><td class='a'>It's got nice shaped leaves</td></tr> <tr><td class='a'>309</td><td class='a'>Yew Tree</td><td class='a'>A tough looking yew tree</td></tr> <tr><td class='a'>310</td><td class='a'>Tree</td><td class='a'>A magical tree</td></tr> <tr><td class='a'>311</td><td class='a'>gate</td><td class='a'>A gate guarded by a fierce barbarian</td></tr> <tr><td class='a'>312</td><td class='a'>sign</td><td class='a'>The forester's arms</td></tr> <tr><td class='a'>313</td><td class='a'>flax</td><td class='a'>A flax plant</td></tr> <tr><td class='a'>314</td><td class='a'>Large treestump</td><td class='a'>Someone has chopped this tree down!</td></tr> <tr><td class='a'>315</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>316</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>317</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>318</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>319</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>320</td><td class='a'>ship</td><td class='a'>A ship bound for Ardougne</td></tr> <tr><td class='a'>321</td><td class='a'>ship</td><td class='a'>A ship bound for Ardougne</td></tr> <tr><td class='a'>322</td><td class='a'>Bakers Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>323</td><td class='a'>Silk Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>324</td><td class='a'>Fur Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>325</td><td class='a'>Silver Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>326</td><td class='a'>Spices Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>327</td><td class='a'>gems Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>328</td><td class='a'>crate</td><td class='a'>A large heavy sealed crate</td></tr> <tr><td class='a'>329</td><td class='a'>crate</td><td class='a'>A large heavy sealed crate</td></tr> <tr><td class='a'>330</td><td class='a'>sign</td><td class='a'>RPDT depot</td></tr> <tr><td class='a'>331</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>332</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>333</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>334</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>335</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>336</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>337</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>338</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>339</td><td class='a'>Chest</td><td class='a'>someone is stealing something from it</td></tr> <tr><td class='a'>340</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>341</td><td class='a'>empty stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>342</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>343</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>344</td><td class='a'>signpost</td><td class='a'>Ardougne city zoo</td></tr> <tr><td class='a'>345</td><td class='a'>sign</td><td class='a'>The flying horse</td></tr> <tr><td class='a'>346</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>347</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>348</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>349</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>350</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>351</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>352</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>353</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>354</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>355</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>356</td><td class='a'>gate</td><td class='a'>The main entrance to McGrubor's wood</td></tr> <tr><td class='a'>357</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>358</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>359</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>360</td><td class='a'>broken cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>361</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>362</td><td class='a'>clock pole blue</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>363</td><td class='a'>clock pole red</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>364</td><td class='a'>clock pole purple</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>365</td><td class='a'>clock pole black</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>366</td><td class='a'>wallclockface</td><td class='a'>It's a large clock face</td></tr> <tr><td class='a'>367</td><td class='a'>Lever Bracket</td><td class='a'>Theres something missing here</td></tr> <tr><td class='a'>368</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>369</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>370</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>371</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>372</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>373</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>374</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>375</td><td class='a'>Foodtrough</td><td class='a'>It's for feeding the rat's</td></tr> <tr><td class='a'>376</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>377</td><td class='a'>spearwall</td><td class='a'>It's a defensive battlement</td></tr> <tr><td class='a'>378</td><td class='a'>hornedskull</td><td class='a'>A horned dragon skull</td></tr> <tr><td class='a'>379</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>380</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>381</td><td class='a'>guardscupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>382</td><td class='a'>guardscupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>383</td><td class='a'>Coal truck</td><td class='a'>I can use this to transport coal</td></tr> <tr><td class='a'>384</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>385</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>386</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>387</td><td class='a'>Tree</td><td class='a'>It's a tree house</td></tr> <tr><td class='a'>388</td><td class='a'>Ballista</td><td class='a'>It's a war machine</td></tr> <tr><td class='a'>389</td><td class='a'>largespear</td><td class='a'></td></tr> <tr><td class='a'>390</td><td class='a'>spirit tree</td><td class='a'>A grand old spirit tree</td></tr> <tr><td class='a'>391</td><td class='a'>young spirit Tree</td><td class='a'>Ancestor of the spirit tree</td></tr> <tr><td class='a'>392</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>393</td><td class='a'>wall</td><td class='a'>A damaged wall</td></tr> <tr><td class='a'>394</td><td class='a'>tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>395</td><td class='a'>tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>396</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>397</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>398</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>399</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>400</td><td class='a'>fly trap</td><td class='a'>A small carnivourous plant</td></tr> <tr><td class='a'>401</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>402</td><td class='a'>Fern</td><td class='a'>An exotic spikey plant</td></tr> <tr><td class='a'>403</td><td class='a'>plant</td><td class='a'>What an unusual plant</td></tr> <tr><td class='a'>404</td><td class='a'>plant</td><td class='a'>An odd looking plant</td></tr> <tr><td class='a'>405</td><td class='a'>plant</td><td class='a'>some nice jungle foliage</td></tr> <tr><td class='a'>406</td><td class='a'>stone head</td><td class='a'>It looks like it's been here some time</td></tr> <tr><td class='a'>407</td><td class='a'>dead Tree</td><td class='a'>A rotting tree</td></tr> <tr><td class='a'>408</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>409</td><td class='a'>khazard open Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>410</td><td class='a'>khazard shut Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>411</td><td class='a'>doorframe</td><td class='a'>It's a stone doorframe</td></tr> <tr><td class='a'>412</td><td class='a'>Sewer valve</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>413</td><td class='a'>Sewer valve 2</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>414</td><td class='a'>Sewer valve 3</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>415</td><td class='a'>Sewer valve 4</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>416</td><td class='a'>Sewer valve 5</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>417</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>418</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>419</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>420</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>421</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>422</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>423</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>424</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>425</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>426</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>427</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>428</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>429</td><td class='a'>Tribal brew</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>430</td><td class='a'>Pineapple tree</td><td class='a'>A tree with nice ripe pineapples growing on it</td></tr> <tr><td class='a'>431</td><td class='a'>Pineapple tree</td><td class='a'>There are no pineapples left on the tree</td></tr> <tr><td class='a'>432</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>433</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>434</td><td class='a'>Tomb of hazeel</td><td class='a'>A clay shrine to lord hazeel</td></tr> <tr><td class='a'>435</td><td class='a'>range</td><td class='a'>A pot of soup slowly cooking</td></tr> <tr><td class='a'>436</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>437</td><td class='a'>Carnillean Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>438</td><td class='a'>Carnillean Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>439</td><td class='a'>crate</td><td class='a'>A crate used for storing food</td></tr> <tr><td class='a'>440</td><td class='a'>Butlers cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>441</td><td class='a'>Butlers cupboard</td><td class='a'>The cupboard is open</td></tr> <tr><td class='a'>442</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>443</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>444</td><td class='a'>Cattle furnace</td><td class='a'>A red hot furnace</td></tr> <tr><td class='a'>445</td><td class='a'>Ardounge wall</td><td class='a'>A huge wall seperating east and west ardounge</td></tr> <tr><td class='a'>446</td><td class='a'>Ardounge wall corner</td><td class='a'>A huge wall seperating east and west ardounge</td></tr> <tr><td class='a'>447</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>448</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>449</td><td class='a'>large Sewer pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>450</td><td class='a'>Ardounge wall gateway</td><td class='a'>A huge set of heavy wooden doors</td></tr> <tr><td class='a'>451</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>452</td><td class='a'>cupboard</td><td class='a'>The cupboard is open</td></tr> <tr><td class='a'>453</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>454</td><td class='a'>Rowboat</td><td class='a'>A reasonably sea worthy two man boat</td></tr> <tr><td class='a'>455</td><td class='a'>Damaged Rowboat</td><td class='a'>A not so sea worthy two man boat</td></tr> <tr><td class='a'>456</td><td class='a'>barrel</td><td class='a'>I wonder what's inside</td></tr> <tr><td class='a'>457</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>458</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>459</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>460</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>461</td><td class='a'>Waterfall</td><td class='a'>it's a waterfall</td></tr> <tr><td class='a'>462</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>463</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>464</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>465</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>466</td><td class='a'>Well</td><td class='a'>An oddly placed well</td></tr> <tr><td class='a'>467</td><td class='a'>Tomb of glarial</td><td class='a'>A stone tomb surrounded by flowers</td></tr> <tr><td class='a'>468</td><td class='a'>Waterfall</td><td class='a'>it's a fast flowing waterfall</td></tr> <tr><td class='a'>469</td><td class='a'>Waterfall</td><td class='a'>it's a fast flowing waterfall</td></tr> <tr><td class='a'>470</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>471</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>472</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>473</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>474</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>475</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>476</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>477</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>478</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>479</td><td class='a'>Glarial's Gravestone</td><td class='a'>There is an indent the size of a pebble in the stone's center</td></tr> <tr><td class='a'>480</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>481</td><td class='a'>crate</td><td class='a'>It's a crate</td></tr> <tr><td class='a'>482</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>483</td><td class='a'>Statue of glarial</td><td class='a'>A statue of queen glarial - something's missing</td></tr> <tr><td class='a'>484</td><td class='a'>Chalice of eternity</td><td class='a'>A magically elevated chalice full of treasure</td></tr> <tr><td class='a'>485</td><td class='a'>Chalice of eternity</td><td class='a'>A magically elevated chalice full of treasure</td></tr> <tr><td class='a'>486</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>487</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>488</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>489</td><td class='a'>log raft remains</td><td class='a'>oops!</td></tr> <tr><td class='a'>490</td><td class='a'>Tree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>491</td><td class='a'> Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>492</td><td class='a'>crate</td><td class='a'>It's an old crate</td></tr> <tr><td class='a'>493</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>494</td><td class='a'>Watch tower</td><td class='a'>They're always watching</td></tr> <tr><td class='a'>495</td><td class='a'>signpost</td><td class='a'>Tourist infomation</td></tr> <tr><td class='a'>496</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>497</td><td class='a'>doors</td><td class='a'>The doors are open</td></tr> <tr><td class='a'>498</td><td class='a'>Rope ladder</td><td class='a'>A hand made ladder</td></tr> <tr><td class='a'>499</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>500</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>501</td><td class='a'>Rope ladder</td><td class='a'>A hand made ladder</td></tr> <tr><td class='a'>502</td><td class='a'>Cooking pot</td><td class='a'>the mourners are busy enjoying this stew</td></tr> <tr><td class='a'>503</td><td class='a'>Gallow</td><td class='a'>Best not hang about!</td></tr> <tr><td class='a'>504</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>505</td><td class='a'>crate</td><td class='a'>A crate used for storing confiscated goods</td></tr> <tr><td class='a'>506</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>507</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>508</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>509</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>510</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>511</td><td class='a'>sign</td><td class='a'>Tailors fancy dress</td></tr> <tr><td class='a'>512</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>513</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>514</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>515</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>516</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>517</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>518</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>519</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>520</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>521</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>522</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>523</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>524</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>525</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>526</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>527</td><td class='a'>climbing rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>528</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>529</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>530</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>531</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>532</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>533</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>534</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>535</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>536</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>537</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>538</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>539</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>540</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>541</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>542</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>543</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>544</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>545</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>546</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>547</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>548</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>549</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>550</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>551</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>552</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>553</td><td class='a'>PalmTree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>554</td><td class='a'>Scorched Earth</td><td class='a'>An area of burnt soil</td></tr> <tr><td class='a'>555</td><td class='a'>Rocks</td><td class='a'>A moss covered rock</td></tr> <tr><td class='a'>556</td><td class='a'>sign</td><td class='a'>The dancing donkey inn</td></tr> <tr><td class='a'>557</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>558</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>559</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>560</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>561</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>562</td><td class='a'>fight Dummy</td><td class='a'>I can practice my fighting here</td></tr> <tr><td class='a'>563</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>564</td><td class='a'>Jungle Vine</td><td class='a'>A deep jungle Vine</td></tr> <tr><td class='a'>565</td><td class='a'>statue</td><td class='a'>hand carved</td></tr> <tr><td class='a'>566</td><td class='a'>sign</td><td class='a'>Ye Olde Dragon Inn</td></tr> <tr><td class='a'>567</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>568</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>569</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>570</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>571</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>572</td><td class='a'>Hillside Entrance</td><td class='a'>Large doors that seem to lead into the hillside</td></tr> <tr><td class='a'>573</td><td class='a'>tree</td><td class='a'>A large exotic looking tree</td></tr> <tr><td class='a'>574</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>575</td><td class='a'>Tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>576</td><td class='a'>Tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>577</td><td class='a'>Metalic Dungeon Gate</td><td class='a'>It seems to be closed</td></tr> <tr><td class='a'>578</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>579</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>580</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>581</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>582</td><td class='a'>Shallow water</td><td class='a'>A small opening in the ground with some spots of water</td></tr> <tr><td class='a'>583</td><td class='a'>Doors</td><td class='a'>Perhaps you should give them a push</td></tr> <tr><td class='a'>584</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>585</td><td class='a'>Tree Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>586</td><td class='a'>Tree Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>587</td><td class='a'>blurberrys cocktail bar</td><td class='a'>the gnome social hot spot</td></tr> <tr><td class='a'>588</td><td class='a'>Gem Rocks</td><td class='a'>A rocky outcrop with a vein of semi precious stones</td></tr> <tr><td class='a'>589</td><td class='a'>Giannes place</td><td class='a'>Eat green eat gnome cruisine</td></tr> <tr><td class='a'>590</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>591</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>592</td><td class='a'>Frame</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>593</td><td class='a'>Tree</td><td class='a'>It has a branch ideal for tying ropes to</td></tr> <tr><td class='a'>594</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>595</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>596</td><td class='a'>cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>597</td><td class='a'>fence</td><td class='a'>it doesn't look too strong</td></tr> <tr><td class='a'>598</td><td class='a'>beam</td><td class='a'>A plank of wood</td></tr> <tr><td class='a'>599</td><td class='a'>Sign</td><td class='a'>read me</td></tr> <tr><td class='a'>600</td><td class='a'>Sign</td><td class='a'>Blurberry's cocktail bar</td></tr> <tr><td class='a'>601</td><td class='a'>Sign</td><td class='a'>Giannes tree gnome cuisine</td></tr> <tr><td class='a'>602</td><td class='a'>Sign</td><td class='a'>Heckel funch's grocery store</td></tr> <tr><td class='a'>603</td><td class='a'>Sign</td><td class='a'>Hudo glenfad's grocery store</td></tr> <tr><td class='a'>604</td><td class='a'>Sign</td><td class='a'>Rometti's fashion outlet</td></tr> <tr><td class='a'>605</td><td class='a'>Sign</td><td class='a'>Tree gnome bank and rometti's fashion outlet</td></tr> <tr><td class='a'>606</td><td class='a'>Sign</td><td class='a'>Tree gnome local swamp</td></tr> <tr><td class='a'>607</td><td class='a'>Sign</td><td class='a'>Agility training course</td></tr> <tr><td class='a'>608</td><td class='a'>Sign</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>609</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>610</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>611</td><td class='a'>Metal Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>612</td><td class='a'>Metal Gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>613</td><td class='a'>A farm cart</td><td class='a'>It is blocking the entrance to the village</td></tr> <tr><td class='a'>614</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>615</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>616</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>617</td><td class='a'>cage</td><td class='a'>i don't like the look of that</td></tr> <tr><td class='a'>618</td><td class='a'>glider</td><td class='a'>i wonder if it flys</td></tr> <tr><td class='a'>619</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>620</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>621</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>622</td><td class='a'>glider</td><td class='a'>i wonder if it flys</td></tr> <tr><td class='a'>623</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>624</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>625</td><td class='a'>chaos altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>626</td><td class='a'>Gnome stronghold gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>627</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>628</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>629</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>630</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>631</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>632</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>633</td><td class='a'>Pile of rubble</td><td class='a'>What a mess</td></tr> <tr><td class='a'>634</td><td class='a'>Stone stand</td><td class='a'>On top our four indents from left to right</td></tr> <tr><td class='a'>635</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>636</td><td class='a'>Pile of rubble</td><td class='a'>What a mess</td></tr> <tr><td class='a'>637</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>638</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>639</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>640</td><td class='a'>Sign</td><td class='a'>Home to the Head tree guardian</td></tr> <tr><td class='a'>641</td><td class='a'>Hammock</td><td class='a'>They've got to sleep somewhere</td></tr> <tr><td class='a'>642</td><td class='a'>Goal</td><td class='a'>You're supposed to throw the ball here</td></tr> <tr><td class='a'>643</td><td class='a'>stone tile</td><td class='a'>It looks as if it might move</td></tr> <tr><td class='a'>644</td><td class='a'>Chest</td><td class='a'>You get a sense of dread from the chest</td></tr> <tr><td class='a'>645</td><td class='a'>Chest</td><td class='a'>You get a sense of dread from the chest</td></tr> <tr><td class='a'>646</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>647</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>648</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>649</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>650</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>651</td><td class='a'>Bumpy Dirt</td><td class='a'>Some disturbed earth</td></tr> <tr><td class='a'>652</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>653</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>654</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>655</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>656</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>657</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>658</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>659</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>660</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>661</td><td class='a'>stronghold spirit Tree</td><td class='a'>Ancestor of the spirit tree</td></tr> <tr><td class='a'>662</td><td class='a'>Tree</td><td class='a'>It has a branch ideal for tying ropes to</td></tr> <tr><td class='a'>663</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>664</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>665</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>666</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>667</td><td class='a'>Cave</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>668</td><td class='a'>stone pebble</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>669</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>670</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>671</td><td class='a'>pipe</td><td class='a'>I might be able to fit through this</td></tr> <tr><td class='a'>672</td><td class='a'>pipe</td><td class='a'>2</td></tr> <tr><td class='a'>673</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>674</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>675</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>676</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>677</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>678</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>679</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>680</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>681</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>682</td><td class='a'>Rotten Gallows</td><td class='a'>A human corpse hangs from the noose</td></tr> <tr><td class='a'>683</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>684</td><td class='a'>ropeswing</td><td class='a'>I wonder what's over here</td></tr> <tr><td class='a'>685</td><td class='a'>ropeswing</td><td class='a'>I wonder what's over here</td></tr> <tr><td class='a'>686</td><td class='a'>ocks</td><td class='a'>A moss covered rock</td></tr> <tr><td class='a'>687</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>688</td><td class='a'>Well stacked rocks</td><td class='a'>Rocks that have been stacked at regular intervals</td></tr> <tr><td class='a'>689</td><td class='a'>Tomb Dolmen</td><td class='a'>An ancient construct for displaying the bones of the deceased</td></tr> <tr><td class='a'>690</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>691</td><td class='a'>Bridge Blockade</td><td class='a'>A crudely constructed fence to stop you going further</td></tr> <tr><td class='a'>692</td><td class='a'>Log Bridge</td><td class='a'>A slippery log that is a make-do bridge</td></tr> <tr><td class='a'>693</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>694</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>695</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>696</td><td class='a'>Wet rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>697</td><td class='a'>Smashed table</td><td class='a'>This table has seen better days</td></tr> <tr><td class='a'>698</td><td class='a'>Crude Raft</td><td class='a'>A crudely constructed raft</td></tr> <tr><td class='a'>699</td><td class='a'>Daconia rock</td><td class='a'>Piles of daconia rock</td></tr> <tr><td class='a'>700</td><td class='a'>statue</td><td class='a'>A statue to mark Taie Bwo Wannai sacred grounds</td></tr> <tr><td class='a'>701</td><td class='a'>Stepping stones</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>702</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>703</td><td class='a'>gate</td><td class='a'>Enter to balance into an agility area</td></tr> <tr><td class='a'>704</td><td class='a'>gate</td><td class='a'>Enter to balance into an agility area</td></tr> <tr><td class='a'>705</td><td class='a'>pipe</td><td class='a'>It looks a tight squeeze</td></tr> <tr><td class='a'>706</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>707</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>708</td><td class='a'>Ledge</td><td class='a'>It doesn't look stable</td></tr> <tr><td class='a'>709</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>710</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>711</td><td class='a'>Wooden Gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>712</td><td class='a'>Wooden Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>713</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>714</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>715</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>716</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>717</td><td class='a'>Stone platform</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>718</td><td class='a'>fence</td><td class='a'>it doesn't look too strong</td></tr> <tr><td class='a'>719</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>720</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>721</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>722</td><td class='a'>Gate of Iban</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>723</td><td class='a'>Wooden Door</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>724</td><td class='a'>Tomb Dolmen</td><td class='a'>An ancient construct for displaying the bones of the deceased</td></tr> <tr><td class='a'>725</td><td class='a'>Cave entrance</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>726</td><td class='a'>Old bridge</td><td class='a'>That's been there a while</td></tr> <tr><td class='a'>727</td><td class='a'>Old bridge</td><td class='a'>That's been there a while</td></tr> <tr><td class='a'>728</td><td class='a'>Crumbled rock</td><td class='a'>climb up to above ground</td></tr> <tr><td class='a'>729</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>730</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>731</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>732</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>733</td><td class='a'>Lever</td><td class='a'>Seems to be some sort of winch</td></tr> <tr><td class='a'>734</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>735</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>736</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>737</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>738</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>739</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>740</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>741</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>742</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>743</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>744</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>745</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>746</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>747</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>748</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>749</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>750</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>751</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>752</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>753</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>754</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>755</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>756</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>757</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>758</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>759</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>760</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>761</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>762</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>763</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>764</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>765</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>766</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>767</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>768</td><td class='a'>Travel Cart</td><td class='a'>A sturdy cart for travelling in</td></tr> <tr><td class='a'>769</td><td class='a'>Travel Cart</td><td class='a'>A sturdy cart for travelling in</td></tr> <tr><td class='a'>770</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>771</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>772</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>773</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>774</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>775</td><td class='a'>sign</td><td class='a'>The Paramaya Hostel</td></tr> <tr><td class='a'>776</td><td class='a'>Ladder</td><td class='a'>A ladder that leads to the dormitory - a ticket is needed</td></tr> <tr><td class='a'>777</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>778</td><td class='a'>Spiked pit</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>779</td><td class='a'>signpost</td><td class='a'>To the Furnace</td></tr> <tr><td class='a'>780</td><td class='a'>Ship</td><td class='a'>A sea faring ship called 'Lady Of The Waves'</td></tr> <tr><td class='a'>781</td><td class='a'>Ship</td><td class='a'>A sea faring ship called 'Lady Of The Waves'</td></tr> <tr><td class='a'>782</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>783</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>784</td><td class='a'>Zamorakian Temple</td><td class='a'>Scary!</td></tr> <tr><td class='a'>785</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>786</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>787</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>788</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>789</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>790</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>791</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>792</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>793</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>794</td><td class='a'>Tomb Doors</td><td class='a'>Ornately carved wooden doors depicting skeletal warriors</td></tr> <tr><td class='a'>795</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>796</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>797</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>798</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>799</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>800</td><td class='a'>Spiked pit</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>801</td><td class='a'>Lever</td><td class='a'>Seems to be some sort of winch</td></tr> <tr><td class='a'>802</td><td class='a'>Cage</td><td class='a'>Seems to be mechanical </td></tr> <tr><td class='a'>803</td><td class='a'>Cage</td><td class='a'>Seems to be mechanical </td></tr> <tr><td class='a'>804</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>805</td><td class='a'>Spear trap</td><td class='a'>Ouch!</td></tr> <tr><td class='a'>806</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>807</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>808</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>809</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>810</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>811</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>812</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>813</td><td class='a'>Furnace</td><td class='a'>Charred bones are slowly burning inside</td></tr> <tr><td class='a'>814</td><td class='a'>Well</td><td class='a'>The remains of a warrior slump over the strange construction</td></tr> <tr><td class='a'>815</td><td class='a'>Passage</td><td class='a'>A strange metal grill covers the passage</td></tr> <tr><td class='a'>816</td><td class='a'>Passage</td><td class='a'>The passage way has swung down to a vertical position</td></tr> <tr><td class='a'>817</td><td class='a'>Passage</td><td class='a'>The passage way has swung down to a vertical position</td></tr> <tr><td class='a'>818</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>819</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>820</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>821</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>822</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>823</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>824</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>825</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>826</td><td class='a'>snap trap</td><td class='a'>aaaarghh</td></tr> <tr><td class='a'>827</td><td class='a'>Wooden planks</td><td class='a'>You can walk across these</td></tr> <tr><td class='a'>828</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>829</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>830</td><td class='a'>Flames of zamorak</td><td class='a'>Careful</td></tr> <tr><td class='a'>831</td><td class='a'>Platform</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>832</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>833</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>834</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>835</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>836</td><td class='a'>wall grill</td><td class='a'>It seems to filter the rotten air through the caverns</td></tr> <tr><td class='a'>837</td><td class='a'>Ledge</td><td class='a'>I might be able to make to the other side</td></tr> <tr><td class='a'>838</td><td class='a'>wall grill</td><td class='a'>It seems to filter the rotten air through the caverns</td></tr> <tr><td class='a'>839</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>840</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>841</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>842</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>843</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>844</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>845</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>846</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>847</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>848</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>849</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>850</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>851</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>852</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>853</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>854</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>855</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>856</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>857</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>858</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>859</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>860</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>861</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>862</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>863</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>864</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>865</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>866</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>867</td><td class='a'>Boulder</td><td class='a'>Could be dangerous!</td></tr> <tr><td class='a'>868</td><td class='a'>crate</td><td class='a'>Someone or something has been here before us</td></tr> <tr><td class='a'>869</td><td class='a'>Door</td><td class='a'>Spooky!</td></tr> <tr><td class='a'>870</td><td class='a'>Platform</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>871</td><td class='a'>Cage remains</td><td class='a'>Poor unicorn!</td></tr> <tr><td class='a'>872</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>873</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>874</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>875</td><td class='a'>Gate of Zamorak</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>876</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>877</td><td class='a'>Bridge support</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>878</td><td class='a'>Tomb of Iban</td><td class='a'>A clay shrine to lord iban</td></tr> <tr><td class='a'>879</td><td class='a'>Claws of Iban</td><td class='a'>claws of iban</td></tr> <tr><td class='a'>880</td><td class='a'>barrel</td><td class='a'>Its stinks of alcohol</td></tr> <tr><td class='a'>881</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>882</td><td class='a'>Rocks</td><td class='a'>More rocks</td></tr> <tr><td class='a'>883</td><td class='a'>Rocks</td><td class='a'>More rocks</td></tr> <tr><td class='a'>884</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>885</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>886</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>887</td><td class='a'>cage</td><td class='a'>That's no way to live</td></tr> <tr><td class='a'>888</td><td class='a'>cage</td><td class='a'>That's no way to live</td></tr> <tr><td class='a'>889</td><td class='a'>Stone steps</td><td class='a'>They lead into the darkness</td></tr> <tr><td class='a'>890</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>891</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>892</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>893</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>894</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>895</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>896</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>897</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>898</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>899</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>900</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>901</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>902</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>903</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>904</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>905</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>906</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>907</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>908</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>909</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>910</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>911</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>912</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>913</td><td class='a'>Pit of the Damned</td><td class='a'>The son of zamoracks alter...</td></tr> <tr><td class='a'>914</td><td class='a'>Open Door</td><td class='a'>Spooky!</td></tr> <tr><td class='a'>915</td><td class='a'>signpost</td><td class='a'>Observatory reception</td></tr> <tr><td class='a'>916</td><td class='a'>Stone Gate</td><td class='a'>A mystical looking object</td></tr> <tr><td class='a'>917</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>918</td><td class='a'>Zodiac</td><td class='a'>A map of the twelve signs of the zodiac</td></tr> <tr><td class='a'>919</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>920</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>921</td><td class='a'>Stone steps</td><td class='a'>They lead into the darkness</td></tr> <tr><td class='a'>922</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>923</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>924</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>925</td><td class='a'>Telescope</td><td class='a'>A device for viewing the heavens</td></tr> <tr><td class='a'>926</td><td class='a'>Gate</td><td class='a'>The entrance to the dungeon jail</td></tr> <tr><td class='a'>927</td><td class='a'>sacks</td><td class='a'>These sacks feels lumpy!</td></tr> <tr><td class='a'>928</td><td class='a'>Ladder</td><td class='a'>the ladder goes down into a dark area</td></tr> <tr><td class='a'>929</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>930</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>931</td><td class='a'>Bookcase</td><td class='a'>A very roughly constructed bookcase.</td></tr> <tr><td class='a'>932</td><td class='a'>Iron Gate</td><td class='a'>A well wrought iron gate - it's locked.</td></tr> <tr><td class='a'>933</td><td class='a'>Ladder</td><td class='a'>the ladder down to the cavern</td></tr> <tr><td class='a'>934</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>935</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>936</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>937</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>938</td><td class='a'>Rockslide</td><td class='a'>A pile of rocks blocks your path</td></tr> <tr><td class='a'>939</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>940</td><td class='a'>column</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>941</td><td class='a'>Grave of Scorpius</td><td class='a'>Here lies Scorpius: dread follower of zamorak</td></tr> <tr><td class='a'>942</td><td class='a'>Bank Chest</td><td class='a'>Allows you to access your bank.</td></tr> <tr><td class='a'>943</td><td class='a'>dwarf multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>944</td><td class='a'>Disturbed sand</td><td class='a'>Footprints in the sand show signs of a struggle</td></tr> <tr><td class='a'>945</td><td class='a'>Disturbed sand</td><td class='a'>Footprints in the sand show signs of a struggle</td></tr> <tr><td class='a'>946</td><td class='a'>dwarf multicannon base</td><td class='a'>bang</td></tr> <tr><td class='a'>947</td><td class='a'>dwarf multicannon stand</td><td class='a'>bang</td></tr> <tr><td class='a'>948</td><td class='a'>dwarf multicannon barrels</td><td class='a'>bang</td></tr> <tr><td class='a'>949</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>950</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>951</td><td class='a'>fence</td><td class='a'>These bridges seem hastily put up</td></tr> <tr><td class='a'>952</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>953</td><td class='a'>Rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>954</td><td class='a'>Rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>955</td><td class='a'>Cave entrance</td><td class='a'>A noxious smell emanates from the cave...</td></tr> <tr><td class='a'>956</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>957</td><td class='a'>Chest</td><td class='a'>I wouldn't like to think where the owner is now</td></tr> <tr><td class='a'>958</td><td class='a'>Wooden Doors</td><td class='a'>Large oak doors constantly watched by guards</td></tr> <tr><td class='a'>959</td><td class='a'>Pedestal</td><td class='a'>something fits on here</td></tr> <tr><td class='a'>960</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>961</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>962</td><td class='a'>Standard</td><td class='a'>A standard with a human skull on it</td></tr> <tr><td class='a'>963</td><td class='a'>Mining Cave</td><td class='a'>A gaping hole that leads to another section of the mine</td></tr> <tr><td class='a'>964</td><td class='a'>Mining Cave</td><td class='a'>A gaping hole that leads to another section of the mine</td></tr> <tr><td class='a'>965</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>966</td><td class='a'>Lift</td><td class='a'>To brings mined rocks to the surface</td></tr> <tr><td class='a'>967</td><td class='a'>Mining Barrel</td><td class='a'>For loading up mined stone from below ground</td></tr> <tr><td class='a'>968</td><td class='a'>Hole</td><td class='a'>I wonder where this leads...</td></tr> <tr><td class='a'>969</td><td class='a'>Hole</td><td class='a'>I wonder where this leads...</td></tr> <tr><td class='a'>970</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>971</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>972</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>973</td><td class='a'>Counter</td><td class='a'>An ogre is selling items here</td></tr> <tr><td class='a'>974</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>975</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>976</td><td class='a'>Mine Cart</td><td class='a'>A heavily constructed and often used mining cart.</td></tr> <tr><td class='a'>977</td><td class='a'>Lift Platform</td><td class='a'>A wooden lift that is operated from the surface.</td></tr> <tr><td class='a'>978</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>979</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>980</td><td class='a'>Watch tower</td><td class='a'>Constructed by the dwarven black guard</td></tr> <tr><td class='a'>981</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>982</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>983</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>984</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>985</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>986</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>987</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>988</td><td class='a'>Gate</td><td class='a'>This gate barrs your way into gu'tanoth</td></tr> <tr><td class='a'>989</td><td class='a'>Gate</td><td class='a'>This gate barrs your way into gu'tanoth</td></tr> <tr><td class='a'>990</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>991</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>992</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>993</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>994</td><td class='a'>multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>995</td><td class='a'>Rocks</td><td class='a'>Some rocks are close to the egde</td></tr> <tr><td class='a'>996</td><td class='a'>Rocks</td><td class='a'>Some rocks are close to the edge</td></tr> <tr><td class='a'>997</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>998</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>999</td><td class='a'>Counter</td><td class='a'>An ogre is selling cakes here</td></tr> <tr><td class='a'>1000</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1001</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1002</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1003</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1004</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>1005</td><td class='a'>Captains Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1006</td><td class='a'>Experimental Anvil</td><td class='a'>An experimental anvil - for developing new techniques in forging</td></tr> <tr><td class='a'>1007</td><td class='a'>Rocks</td><td class='a'>A small pile of stones</td></tr> <tr><td class='a'>1008</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1009</td><td class='a'>Column</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1010</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1011</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1012</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1013</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1014</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>1015</td><td class='a'>Lever</td><td class='a'>The lever is down</td></tr> <tr><td class='a'>1016</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1017</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>1018</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1019</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>1020</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>1021</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>1022</td><td class='a'>shock</td><td class='a'>cosmic energy</td></tr> <tr><td class='a'>1023</td><td class='a'>Desk</td><td class='a'>A very strong looking table with some locked drawers.</td></tr> <tr><td class='a'>1024</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>1025</td><td class='a'>Mining Cart</td><td class='a'>A sturdy well built mining cart with barrels full of rock on the back.</td></tr> <tr><td class='a'>1026</td><td class='a'>Rock of Dalgroth</td><td class='a'>A mysterious boulder of the ogres</td></tr> <tr><td class='a'>1027</td><td class='a'>entrance</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1028</td><td class='a'>Dried Cactus</td><td class='a'>It looks very spikey</td></tr> <tr><td class='a'>1029</td><td class='a'>climbing rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>1030</td><td class='a'>Rocks</td><td class='a'>Strange rocks - who knows why they're wanted?</td></tr> <tr><td class='a'>1031</td><td class='a'>lightning</td><td class='a'>blimey!</td></tr> <tr><td class='a'>1032</td><td class='a'>Crude Desk</td><td class='a'>A very roughly constructed desk</td></tr> <tr><td class='a'>1033</td><td class='a'>Heavy Metal Gate</td><td class='a'>This is an immense and very heavy looking gate made out of thick wrought metal</td></tr> <tr><td class='a'>1034</td><td class='a'>Counter</td><td class='a'>An ogre is selling cakes here</td></tr> <tr><td class='a'>1035</td><td class='a'>Crude bed</td><td class='a'>A flea infested sleeping experience</td></tr> <tr><td class='a'>1036</td><td class='a'>flames</td><td class='a'>looks hot!</td></tr> <tr><td class='a'>1037</td><td class='a'>Carved Rock</td><td class='a'>An ornately carved rock with a pointed recepticle</td></tr> <tr><td class='a'>1038</td><td class='a'>USE</td><td class='a'>FREE SLOT PLEASE USE</td></tr> <tr><td class='a'>1039</td><td class='a'>crate</td><td class='a'>A crate used for storing materials</td></tr> <tr><td class='a'>1040</td><td class='a'>crate</td><td class='a'>A crate used for storing materials</td></tr> <tr><td class='a'>1041</td><td class='a'>barrel</td><td class='a'>Its shut</td></tr> <tr><td class='a'>1042</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1043</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1044</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1045</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1046</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1047</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1048</td><td class='a'>Barrier</td><td class='a'>this section is roped off</td></tr> <tr><td class='a'>1049</td><td class='a'>buried skeleton</td><td class='a'>I hope I don't meet any of these</td></tr> <tr><td class='a'>1050</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1051</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1052</td><td class='a'>Specimen tray</td><td class='a'>A pile of sifted earth</td></tr> <tr><td class='a'>1053</td><td class='a'>winch</td><td class='a'>This winches earth from the dig hole</td></tr> <tr><td class='a'>1054</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>1055</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>1056</td><td class='a'>Urn</td><td class='a'>A large ornamental urn</td></tr> <tr><td class='a'>1057</td><td class='a'>buried skeleton</td><td class='a'>I'm glad this isn't around now</td></tr> <tr><td class='a'>1058</td><td class='a'>panning point</td><td class='a'>a shallow where I can pan for gold</td></tr> <tr><td class='a'>1059</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1060</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1061</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1062</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1063</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1064</td><td class='a'>signpost</td><td class='a'>Digsite educational centre</td></tr> <tr><td class='a'>1065</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1066</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1067</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1068</td><td class='a'>Gate</td><td class='a'>The gate has closed</td></tr> <tr><td class='a'>1069</td><td class='a'>ship</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1070</td><td class='a'>barrel</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1071</td><td class='a'>Leak</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1072</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>1073</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>1074</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1075</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1076</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1077</td><td class='a'>Leak</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1078</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1079</td><td class='a'>Wrought Mithril Gates</td><td class='a'>Magnificent wrought mithril gates giving access to the Legends Guild</td></tr> <tr><td class='a'>1080</td><td class='a'>Legends Hall Doors</td><td class='a'>Solid Oak doors leading to the Hall of Legends</td></tr> <tr><td class='a'>1081</td><td class='a'>Camp bed</td><td class='a'>Not comfortable but useful nonetheless</td></tr> <tr><td class='a'>1082</td><td class='a'>barrel</td><td class='a'>It has a lid on it - I need something to lever it off</td></tr> <tr><td class='a'>1083</td><td class='a'>barrel</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1084</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1085</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1086</td><td class='a'>Dense Jungle Tree</td><td class='a'>Thick vegetation</td></tr> <tr><td class='a'>1087</td><td class='a'>Jungle tree stump</td><td class='a'>A chopped down jungle tree</td></tr> <tr><td class='a'>1088</td><td class='a'>signpost</td><td class='a'>To the digsite</td></tr> <tr><td class='a'>1089</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>1090</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>1091</td><td class='a'>Dense Jungle Tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>1092</td><td class='a'>Dense Jungle Tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>1093</td><td class='a'>Spray</td><td class='a'>There's a strong wind</td></tr> <tr><td class='a'>1094</td><td class='a'>Spray</td><td class='a'>There's a strong wind</td></tr> <tr><td class='a'>1095</td><td class='a'>winch</td><td class='a'>This winches earth from the dig hole</td></tr> <tr><td class='a'>1096</td><td class='a'>Brick</td><td class='a'>It seems these were put here deliberately</td></tr> <tr><td class='a'>1097</td><td class='a'>Rope</td><td class='a'>it's a rope leading upwards</td></tr> <tr><td class='a'>1098</td><td class='a'>Rope</td><td class='a'>it's a rope leading upwards</td></tr> <tr><td class='a'>1099</td><td class='a'>Dense Jungle Palm</td><td class='a'>A hardy palm tree with dense wood</td></tr> <tr><td class='a'>1100</td><td class='a'>Dense Jungle Palm</td><td class='a'>A hardy palm tree with dense wood</td></tr> <tr><td class='a'>1101</td><td class='a'>Trawler net</td><td class='a'>A huge net to catch little fish</td></tr> <tr><td class='a'>1102</td><td class='a'>Trawler net</td><td class='a'>A huge net to catch little fish</td></tr> <tr><td class='a'>1103</td><td class='a'>Brick</td><td class='a'>The bricks are covered in the strange compound</td></tr> <tr><td class='a'>1104</td><td class='a'>Chest</td><td class='a'>I wonder what is inside ?</td></tr> <tr><td class='a'>1105</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1106</td><td class='a'>Trawler catch</td><td class='a'>Smells like fish!</td></tr> <tr><td class='a'>1107</td><td class='a'>Yommi Tree</td><td class='a'>An adolescent rare and mystical looking tree in</td></tr> <tr><td class='a'>1108</td><td class='a'>Grown Yommi Tree</td><td class='a'>A fully grown rare and mystical looking tree</td></tr> <tr><td class='a'>1109</td><td class='a'>Chopped Yommi Tree</td><td class='a'>A mystical looking tree that has recently been felled</td></tr> <tr><td class='a'>1110</td><td class='a'>Trimmed Yommi Tree</td><td class='a'>The trunk of the yommi tree.</td></tr> <tr><td class='a'>1111</td><td class='a'>Totem Pole</td><td class='a'>A nicely crafted wooden totem pole.</td></tr> <tr><td class='a'>1112</td><td class='a'>Baby Yommi Tree</td><td class='a'>A baby Yommi tree - with a mystical aura</td></tr> <tr><td class='a'>1113</td><td class='a'>Fertile earth</td><td class='a'>A very fertile patch of earth</td></tr> <tr><td class='a'>1114</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1115</td><td class='a'>Hanging rope</td><td class='a'>A rope hangs from the ceiling</td></tr> <tr><td class='a'>1116</td><td class='a'>Rocks</td><td class='a'>A large boulder blocking the stream</td></tr> <tr><td class='a'>1117</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1118</td><td class='a'>dwarf multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>1119</td><td class='a'>dwarf multicannon base</td><td class='a'>bang</td></tr> <tr><td class='a'>1120</td><td class='a'>dwarf multicannon stand</td><td class='a'>bang</td></tr> <tr><td class='a'>1121</td><td class='a'>dwarf multicannon barrels</td><td class='a'>bang</td></tr> <tr><td class='a'>1122</td><td class='a'>rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>1123</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1124</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1125</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1126</td><td class='a'>Compost Heap</td><td class='a'>The family gardeners' compost heap</td></tr> <tr><td class='a'>1127</td><td class='a'>beehive</td><td class='a'>An old looking beehive</td></tr> <tr><td class='a'>1128</td><td class='a'>Drain</td><td class='a'>This drainpipe runs from the kitchen to the sewers</td></tr> <tr><td class='a'>1129</td><td class='a'>web</td><td class='a'>An old thick spider's web</td></tr> <tr><td class='a'>1130</td><td class='a'>fountain</td><td class='a'>There seems to be a lot of insects here</td></tr> <tr><td class='a'>1131</td><td class='a'>Sinclair Crest</td><td class='a'>The Sinclair family crest</td></tr> <tr><td class='a'>1132</td><td class='a'>barrel</td><td class='a'>Annas stuff - There seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1133</td><td class='a'>barrel</td><td class='a'>Bobs things - There seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1134</td><td class='a'>barrel</td><td class='a'>Carols belongings - there seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1135</td><td class='a'>barrel</td><td class='a'>Davids equipment - there seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1136</td><td class='a'>barrel</td><td class='a'>Elizabeths clothes - theres something shiny at the bottom</td></tr> <tr><td class='a'>1137</td><td class='a'>barrel</td><td class='a'>Franks barrel seems to have something shiny at the bottom</td></tr> <tr><td class='a'>1138</td><td class='a'>Flour Barrel</td><td class='a'>Its full of flour</td></tr> <tr><td class='a'>1139</td><td class='a'>sacks</td><td class='a'>Full of various gardening tools</td></tr> <tr><td class='a'>1140</td><td class='a'>gate</td><td class='a'>A sturdy and secure wooden gate</td></tr> <tr><td class='a'>1141</td><td class='a'>Dead Yommi Tree</td><td class='a'>A dead Yommi Tree - it looks like a tough axe will be needed to fell this</td></tr> <tr><td class='a'>1142</td><td class='a'>clawspell</td><td class='a'>forces of guthix</td></tr> <tr><td class='a'>1143</td><td class='a'>Rocks</td><td class='a'>The remains of a large rock</td></tr> <tr><td class='a'>1144</td><td class='a'>crate</td><td class='a'>A crate of some kind</td></tr> <tr><td class='a'>1145</td><td class='a'>Cavernous Opening</td><td class='a'>A dark and mysterious cavern</td></tr> <tr><td class='a'>1146</td><td class='a'>Ancient Lava Furnace</td><td class='a'>A badly damaged furnace fueled by red hot Lava - it looks ancient</td></tr> <tr><td class='a'>1147</td><td class='a'>Spellcharge</td><td class='a'>forces of guthix</td></tr> <tr><td class='a'>1148</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1149</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1150</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1151</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>1152</td><td class='a'>Saradomin stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1153</td><td class='a'>Guthix stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1154</td><td class='a'>Zamorak stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1155</td><td class='a'>Magical pool</td><td class='a'>A cosmic portal</td></tr> <tr><td class='a'>1156</td><td class='a'>Wooden Beam</td><td class='a'>Some sort of support - perhaps used with ropes to lower people over the hole</td></tr> <tr><td class='a'>1157</td><td class='a'>Rope down into darkness</td><td class='a'>A scarey downwards trip into possible doom.</td></tr> <tr><td class='a'>1158</td><td class='a'>Cave entrance</td><td class='a'>A dark cave entrance leading to the surface.</td></tr> <tr><td class='a'>1159</td><td class='a'>Cave entrance</td><td class='a'>A small tunnel that leads to a large room beyond.</td></tr> <tr><td class='a'>1160</td><td class='a'>Ancient Wooden Doors</td><td class='a'>The doors are locked shut</td></tr> <tr><td class='a'>1161</td><td class='a'>Table</td><td class='a'>An old rickety table</td></tr> <tr><td class='a'>1162</td><td class='a'>Crude bed</td><td class='a'>Barely a bed at all</td></tr> <tr><td class='a'>1163</td><td class='a'>Tall Reeds</td><td class='a'>A tall plant with a tube for a stem.</td></tr> <tr><td class='a'>1164</td><td class='a'>Goblin foot prints</td><td class='a'>They seem to be heading south east</td></tr> <tr><td class='a'>1165</td><td class='a'>Dark Metal Gate</td><td class='a'>A dark metalic gate which seems to be fused with the rock</td></tr> <tr><td class='a'>1166</td><td class='a'>Magical pool</td><td class='a'>A cosmic portal</td></tr> <tr><td class='a'>1167</td><td class='a'>Rope Up</td><td class='a'>A welcome rope back up and out of this dark place.</td></tr> <tr><td class='a'>1168</td><td class='a'>Half buried remains</td><td class='a'>Some poor unfortunate soul</td></tr> <tr><td class='a'>1169</td><td class='a'>Totem Pole</td><td class='a'>A carved and decorated totem pole</td></tr> <tr><td class='a'>1170</td><td class='a'>Totem Pole</td><td class='a'>A carved and decorated totem pole</td></tr> <tr><td class='a'>1171</td><td class='a'>Comfy bed</td><td class='a'>Its a bed - wow</td></tr> <tr><td class='a'>1172</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing fully grown Yommi Tree</td></tr> <tr><td class='a'>1173</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing felled Yommi Tree</td></tr> <tr><td class='a'>1174</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing Yommi Tree Trunk</td></tr> <tr><td class='a'>1175</td><td class='a'>Rotten Totem Pole</td><td class='a'>A decomposing Totem Pole</td></tr> <tr><td class='a'>1176</td><td class='a'>Leafy Palm Tree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>1177</td><td class='a'>Grand Viziers Desk</td><td class='a'>A very elegant desk - you could knock it to get the Grand Viziers attention.</td></tr> <tr><td class='a'>1178</td><td class='a'>Strange Barrel</td><td class='a'>It might have something inside of it.</td></tr> <tr><td class='a'>1179</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1180</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1181</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1182</td><td class='a'>digsite bed</td><td class='a'>Not comfortable but useful nonetheless</td></tr> <tr><td class='a'>1183</td><td class='a'>Tea stall</td><td class='a'>A stall selling oriental infusions</td></tr> <tr><td class='a'>1184</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1185</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1186</td><td class='a'>Damaged Earth</td><td class='a'>Disturbed earth - it will heal itself in time</td></tr> <tr><td class='a'>1187</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>1188</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> </table> 123 2011-06-20T04:54:18Z Admin 1 [[Category:RSC]] <table border="1" cellpadding="5" cellspacing="3"> <tr><td>id</td><td>object name</td><td>description</td></tr> <tr><td class='a'>0</td><td class='a'>Tree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>1</td><td class='a'>Tree</td><td class='a'>A leafy tree</td></tr> <tr><td class='a'>2</td><td class='a'>Well</td><td class='a'>The bucket is missing</td></tr> <tr><td class='a'>3</td><td class='a'>Table</td><td class='a'>A mighty fine table</td></tr> <tr><td class='a'>4</td><td class='a'>Treestump</td><td class='a'>Someone has chopped this tree down!</td></tr> <tr><td class='a'>5</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>6</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>7</td><td class='a'>Chair</td><td class='a'>A sturdy looking chair</td></tr> <tr><td class='a'>8</td><td class='a'>logs</td><td class='a'>A pile of logs</td></tr> <tr><td class='a'>9</td><td class='a'>Longtable</td><td class='a'>It has nice candles</td></tr> <tr><td class='a'>10</td><td class='a'>Throne</td><td class='a'>It looks fancy and expensive</td></tr> <tr><td class='a'>11</td><td class='a'>Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>12</td><td class='a'>Gravestone</td><td class='a'>R I P</td></tr> <tr><td class='a'>13</td><td class='a'>Gravestone</td><td class='a'>Its covered in moss</td></tr> <tr><td class='a'>14</td><td class='a'>Bed</td><td class='a'>Ooh nice blankets</td></tr> <tr><td class='a'>15</td><td class='a'>Bed</td><td class='a'>Its a bed - wow</td></tr> <tr><td class='a'>16</td><td class='a'>bar</td><td class='a'>Mmm beer</td></tr> <tr><td class='a'>17</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>18</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>19</td><td class='a'>Altar</td><td class='a'>Its an Altar</td></tr> <tr><td class='a'>20</td><td class='a'>Post</td><td class='a'>What am I examining posts for</td></tr> <tr><td class='a'>21</td><td class='a'>Support</td><td class='a'>A wooden pole</td></tr> <tr><td class='a'>22</td><td class='a'>barrel</td><td class='a'>Its empty</td></tr> <tr><td class='a'>23</td><td class='a'>Bench</td><td class='a'>It doesn't look very comfy</td></tr> <tr><td class='a'>24</td><td class='a'>Portrait</td><td class='a'>A painting of our beloved king</td></tr> <tr><td class='a'>25</td><td class='a'>candles</td><td class='a'>Candles on a fancy candlestick</td></tr> <tr><td class='a'>26</td><td class='a'>fountain</td><td class='a'>The water looks fairly clean</td></tr> <tr><td class='a'>27</td><td class='a'>landscape</td><td class='a'>An oil painting</td></tr> <tr><td class='a'>28</td><td class='a'>Millstones</td><td class='a'>You can use these to make flour</td></tr> <tr><td class='a'>29</td><td class='a'>Counter</td><td class='a'>It's the shop counter</td></tr> <tr><td class='a'>30</td><td class='a'>Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>31</td><td class='a'>Target</td><td class='a'>Coming soon archery practice</td></tr> <tr><td class='a'>32</td><td class='a'>PalmTree</td><td class='a'>A nice palm tree</td></tr> <tr><td class='a'>33</td><td class='a'>PalmTree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>34</td><td class='a'>Fern</td><td class='a'>A leafy plant</td></tr> <tr><td class='a'>35</td><td class='a'>Cactus</td><td class='a'>It looks very spikey</td></tr> <tr><td class='a'>36</td><td class='a'>Bullrushes</td><td class='a'>I wonder why it's called a bullrush</td></tr> <tr><td class='a'>37</td><td class='a'>Flower</td><td class='a'>Ooh thats pretty</td></tr> <tr><td class='a'>38</td><td class='a'>Mushroom</td><td class='a'>I think it's a poisonous one</td></tr> <tr><td class='a'>39</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>40</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>41</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>42</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>43</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>44</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>45</td><td class='a'>railing</td><td class='a'>nice safety measure</td></tr> <tr><td class='a'>46</td><td class='a'>pillar</td><td class='a'>An ornate pillar</td></tr> <tr><td class='a'>47</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>48</td><td class='a'>Sink</td><td class='a'>Its fairly dirty</td></tr> <tr><td class='a'>49</td><td class='a'>Dummy</td><td class='a'>I can practice my fighting here</td></tr> <tr><td class='a'>50</td><td class='a'>anvil</td><td class='a'>heavy metal</td></tr> <tr><td class='a'>51</td><td class='a'>Torch</td><td class='a'>It would be very dark without this</td></tr> <tr><td class='a'>52</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>53</td><td class='a'>chute</td><td class='a'>Flour comes out here</td></tr> <tr><td class='a'>54</td><td class='a'>cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>55</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>56</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>57</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>58</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>59</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>60</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>61</td><td class='a'>signpost</td><td class='a'>To Varrock</td></tr> <tr><td class='a'>62</td><td class='a'>signpost</td><td class='a'>To the tower of wizards</td></tr> <tr><td class='a'>63</td><td class='a'>doors</td><td class='a'>The doors are open</td></tr> <tr><td class='a'>64</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>65</td><td class='a'>signpost</td><td class='a'>To player owned houses</td></tr> <tr><td class='a'>66</td><td class='a'>signpost</td><td class='a'>To Lumbridge Castle</td></tr> <tr><td class='a'>67</td><td class='a'>bookcase</td><td class='a'>It's a bookcase</td></tr> <tr><td class='a'>68</td><td class='a'>henge</td><td class='a'>these look impressive</td></tr> <tr><td class='a'>69</td><td class='a'>Dolmen</td><td class='a'>A sort of ancient altar thingy</td></tr> <tr><td class='a'>70</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>71</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>72</td><td class='a'>Wheat</td><td class='a'>nice ripe looking wheat</td></tr> <tr><td class='a'>73</td><td class='a'>sign</td><td class='a'>The blue moon inn</td></tr> <tr><td class='a'>74</td><td class='a'>sails</td><td class='a'>The windmill's sails</td></tr> <tr><td class='a'>75</td><td class='a'>sign</td><td class='a'>estate agent</td></tr> <tr><td class='a'>76</td><td class='a'>sign</td><td class='a'>The Jolly boar inn</td></tr> <tr><td class='a'>77</td><td class='a'>Drain</td><td class='a'>This drainpipe runs from the kitchen to the sewers</td></tr> <tr><td class='a'>78</td><td class='a'>manhole</td><td class='a'>A manhole cover</td></tr> <tr><td class='a'>79</td><td class='a'>manhole</td><td class='a'>How dangerous - this manhole has been left open</td></tr> <tr><td class='a'>80</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>81</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>82</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>83</td><td class='a'>barrel</td><td class='a'>It seems to be full of newt's eyes</td></tr> <tr><td class='a'>84</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>85</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>86</td><td class='a'>fountain</td><td class='a'>I think I see something in the fountain</td></tr> <tr><td class='a'>87</td><td class='a'>signpost</td><td class='a'>To Draynor Manor</td></tr> <tr><td class='a'>88</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>89</td><td class='a'>sign</td><td class='a'>General Store</td></tr> <tr><td class='a'>90</td><td class='a'>sign</td><td class='a'>Lowe's Archery store</td></tr> <tr><td class='a'>91</td><td class='a'>sign</td><td class='a'>The Clothes Shop</td></tr> <tr><td class='a'>92</td><td class='a'>sign</td><td class='a'>Varrock Swords</td></tr> <tr><td class='a'>93</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>94</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>95</td><td class='a'>sign</td><td class='a'>Bob's axes</td></tr> <tr><td class='a'>96</td><td class='a'>sign</td><td class='a'>The staff shop</td></tr> <tr><td class='a'>97</td><td class='a'>fire</td><td class='a'>A strongly burning fire</td></tr> <tr><td class='a'>98</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>99</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>100</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>101</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>102</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>103</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>104</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>105</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>106</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>107</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>108</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>109</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>110</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>111</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>112</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>113</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>114</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>115</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>116</td><td class='a'>web</td><td class='a'>A spider's web</td></tr> <tr><td class='a'>117</td><td class='a'>web</td><td class='a'>A spider's web</td></tr> <tr><td class='a'>118</td><td class='a'>furnace</td><td class='a'>A red hot furnace</td></tr> <tr><td class='a'>119</td><td class='a'>Cook's Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>120</td><td class='a'>Machine</td><td class='a'>I wonder what it's supposed to do</td></tr> <tr><td class='a'>121</td><td class='a'>Spinning wheel</td><td class='a'>I can spin wool on this</td></tr> <tr><td class='a'>122</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>123</td><td class='a'>Lever</td><td class='a'>The lever is down</td></tr> <tr><td class='a'>124</td><td class='a'>LeverA</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>125</td><td class='a'>LeverB</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>126</td><td class='a'>LeverC</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>127</td><td class='a'>LeverD</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>128</td><td class='a'>LeverE</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>129</td><td class='a'>LeverF</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>130</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>131</td><td class='a'>signpost</td><td class='a'>To the forge</td></tr> <tr><td class='a'>132</td><td class='a'>signpost</td><td class='a'>To the Barbarian's Village</td></tr> <tr><td class='a'>133</td><td class='a'>signpost</td><td class='a'>To Al Kharid</td></tr> <tr><td class='a'>134</td><td class='a'>Compost Heap</td><td class='a'>A smelly pile of compost</td></tr> <tr><td class='a'>135</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>136</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>137</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>138</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>139</td><td class='a'>sign</td><td class='a'>The Bank of runescape</td></tr> <tr><td class='a'>140</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>141</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>142</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>143</td><td class='a'>torch</td><td class='a'>A scary torch</td></tr> <tr><td class='a'>144</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>145</td><td class='a'>Shield</td><td class='a'>A display shield</td></tr> <tr><td class='a'>146</td><td class='a'>Grill</td><td class='a'>some sort of ventilation</td></tr> <tr><td class='a'>147</td><td class='a'>Cauldron</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>148</td><td class='a'>Grill</td><td class='a'>some sort of ventilation</td></tr> <tr><td class='a'>149</td><td class='a'>Mine Cart</td><td class='a'>It's empty</td></tr> <tr><td class='a'>150</td><td class='a'>Buffers</td><td class='a'>Stop the carts falling off the end</td></tr> <tr><td class='a'>151</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>152</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>153</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>154</td><td class='a'>Hole</td><td class='a'>I can see a witches cauldron directly below it</td></tr> <tr><td class='a'>155</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>156</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>157</td><td class='a'>ship</td><td class='a'>A ship to Karamja</td></tr> <tr><td class='a'>158</td><td class='a'>Emergency escape ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>159</td><td class='a'>sign</td><td class='a'>Wydin's grocery</td></tr> <tr><td class='a'>160</td><td class='a'>sign</td><td class='a'>The Rusty Anchor</td></tr> <tr><td class='a'>161</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>162</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>163</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>164</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>165</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>166</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>167</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>168</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>169</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>170</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>171</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>172</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>173</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>174</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>175</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>176</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>177</td><td class='a'>Doric's anvil</td><td class='a'>Property of Doric the dwarf</td></tr> <tr><td class='a'>178</td><td class='a'>pottery oven</td><td class='a'>I can fire clay pots in this</td></tr> <tr><td class='a'>179</td><td class='a'>potter's wheel</td><td class='a'>I can make clay pots using this</td></tr> <tr><td class='a'>180</td><td class='a'>gate</td><td class='a'>A gate from Lumbridge to Al Kharid</td></tr> <tr><td class='a'>181</td><td class='a'>gate</td><td class='a'>This gate is open</td></tr> <tr><td class='a'>182</td><td class='a'>crate</td><td class='a'>A crate used for storing bananas</td></tr> <tr><td class='a'>183</td><td class='a'>Banana tree</td><td class='a'>A tree with nice ripe bananas growing on it</td></tr> <tr><td class='a'>184</td><td class='a'>Banana tree</td><td class='a'>There are no bananas left on the tree</td></tr> <tr><td class='a'>185</td><td class='a'>crate</td><td class='a'>A crate used for storing bananas</td></tr> <tr><td class='a'>186</td><td class='a'>Chest</td><td class='a'>A battered old chest</td></tr> <tr><td class='a'>187</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>188</td><td class='a'>Flower</td><td class='a'>Ooh thats pretty</td></tr> <tr><td class='a'>189</td><td class='a'>sign</td><td class='a'>Fishing Supplies</td></tr> <tr><td class='a'>190</td><td class='a'>sign</td><td class='a'>Jewellers</td></tr> <tr><td class='a'>191</td><td class='a'>Potato</td><td class='a'>A potato plant</td></tr> <tr><td class='a'>192</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>193</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>194</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>195</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>196</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>197</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>198</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>199</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>200</td><td class='a'>Monks Altar</td><td class='a'>Its an Altar</td></tr> <tr><td class='a'>201</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>202</td><td class='a'>Coffin</td><td class='a'>This coffin is closed</td></tr> <tr><td class='a'>203</td><td class='a'>Coffin</td><td class='a'>This coffin is open</td></tr> <tr><td class='a'>204</td><td class='a'>Smashed table</td><td class='a'>This table has seen better days</td></tr> <tr><td class='a'>205</td><td class='a'>Fungus</td><td class='a'>A creepy looking fungus</td></tr> <tr><td class='a'>206</td><td class='a'>Smashed chair</td><td class='a'>This chair is broken</td></tr> <tr><td class='a'>207</td><td class='a'>Broken pillar</td><td class='a'>The remains of a pillar</td></tr> <tr><td class='a'>208</td><td class='a'>Fallen tree</td><td class='a'>A fallen tree</td></tr> <tr><td class='a'>209</td><td class='a'>Danger Sign</td><td class='a'>Danger!</td></tr> <tr><td class='a'>210</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>211</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>212</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>213</td><td class='a'>Gravestone</td><td class='a'>A big impressive gravestone</td></tr> <tr><td class='a'>214</td><td class='a'>bone</td><td class='a'>Eep!</td></tr> <tr><td class='a'>215</td><td class='a'>bone</td><td class='a'>This would feed a dog for a month</td></tr> <tr><td class='a'>216</td><td class='a'>carcass</td><td class='a'>I think it's dead</td></tr> <tr><td class='a'>217</td><td class='a'>animalskull</td><td class='a'>I wouldn't like to meet a live one</td></tr> <tr><td class='a'>218</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>219</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>220</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>221</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>222</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>223</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>224</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>225</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>226</td><td class='a'>hole</td><td class='a'>This ship isn't much use with that there</td></tr> <tr><td class='a'>227</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>228</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>229</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>230</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>231</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>232</td><td class='a'>hole</td><td class='a'>This ship isn't much use with that there</td></tr> <tr><td class='a'>233</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>234</td><td class='a'>ship</td><td class='a'>The Lumbridge Lady</td></tr> <tr><td class='a'>235</td><td class='a'>Altar of Guthix</td><td class='a'>A sort of ancient altar thingy</td></tr> <tr><td class='a'>236</td><td class='a'>The Cauldron of Thunder</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>237</td><td class='a'>Tree</td><td class='a'>A leafy tree</td></tr> <tr><td class='a'>238</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>239</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>240</td><td class='a'>ship</td><td class='a'>A ship to Entrana</td></tr> <tr><td class='a'>241</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>242</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>243</td><td class='a'>ship</td><td class='a'>A ship to Port Sarim</td></tr> <tr><td class='a'>244</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>245</td><td class='a'>Dramen Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>246</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>247</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>248</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>249</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>250</td><td class='a'>sign</td><td class='a'>2-handed swords sold here</td></tr> <tr><td class='a'>251</td><td class='a'>sign</td><td class='a'>ye olde herbalist</td></tr> <tr><td class='a'>252</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>253</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>254</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>255</td><td class='a'>Door mat</td><td class='a'>If I ever get my boots muddy I know where to come</td></tr> <tr><td class='a'>256</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>257</td><td class='a'>Cauldron</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>258</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>259</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>260</td><td class='a'>gate</td><td class='a'>The bank vault gate</td></tr> <tr><td class='a'>261</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>262</td><td class='a'>sign</td><td class='a'>Harry's fishing shack</td></tr> <tr><td class='a'>263</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>264</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>265</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>266</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>267</td><td class='a'>sign</td><td class='a'>The shrimp and parrot</td></tr> <tr><td class='a'>268</td><td class='a'>signpost</td><td class='a'>Palm Street</td></tr> <tr><td class='a'>269</td><td class='a'>Rockslide</td><td class='a'>A pile of rocks blocks your path</td></tr> <tr><td class='a'>270</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>271</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the lava!</td></tr> <tr><td class='a'>272</td><td class='a'>barrel</td><td class='a'>Its got ale in it</td></tr> <tr><td class='a'>273</td><td class='a'>table</td><td class='a'>It's a sturdy table</td></tr> <tr><td class='a'>274</td><td class='a'>Fireplace</td><td class='a'>It would be very cold without this</td></tr> <tr><td class='a'>275</td><td class='a'>Egg</td><td class='a'>Thats one big egg!</td></tr> <tr><td class='a'>276</td><td class='a'>Eggs</td><td class='a'>They'd make an impressive omlette</td></tr> <tr><td class='a'>277</td><td class='a'>Stalagmites</td><td class='a'>Hmm pointy</td></tr> <tr><td class='a'>278</td><td class='a'>Stool</td><td class='a'>A simple three legged stool</td></tr> <tr><td class='a'>279</td><td class='a'>Bench</td><td class='a'>It doesn't look to comfortable</td></tr> <tr><td class='a'>280</td><td class='a'>table</td><td class='a'>A round table ideal for knights</td></tr> <tr><td class='a'>281</td><td class='a'>table</td><td class='a'>A handy little table</td></tr> <tr><td class='a'>282</td><td class='a'>fountain of heros</td><td class='a'>Use a dragonstone gem here to increase it's abilties</td></tr> <tr><td class='a'>283</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>284</td><td class='a'>hedge</td><td class='a'>A carefully trimmed hedge</td></tr> <tr><td class='a'>285</td><td class='a'>flower</td><td class='a'>A nice colourful flower</td></tr> <tr><td class='a'>286</td><td class='a'>plant</td><td class='a'>Hmm leafy</td></tr> <tr><td class='a'>287</td><td class='a'>Giant crystal</td><td class='a'>How unusual a crystal with a wizard trapped in it</td></tr> <tr><td class='a'>288</td><td class='a'>sign</td><td class='a'>The dead man's chest</td></tr> <tr><td class='a'>289</td><td class='a'>sign</td><td class='a'>The rising sun</td></tr> <tr><td class='a'>290</td><td class='a'>crate</td><td class='a'>A large wooden storage box</td></tr> <tr><td class='a'>291</td><td class='a'>crate</td><td class='a'>A large wooden storage box</td></tr> <tr><td class='a'>292</td><td class='a'>ship</td><td class='a'>A merchant ship</td></tr> <tr><td class='a'>293</td><td class='a'>ship</td><td class='a'>A merchant ship</td></tr> <tr><td class='a'>294</td><td class='a'>beehive</td><td class='a'>It's guarded by angry looking bees</td></tr> <tr><td class='a'>295</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>296</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>297</td><td class='a'>sign</td><td class='a'>Hickton's Archery store</td></tr> <tr><td class='a'>298</td><td class='a'>signpost</td><td class='a'>To Camelot</td></tr> <tr><td class='a'>299</td><td class='a'>Archway</td><td class='a'>A decorative marble arch</td></tr> <tr><td class='a'>300</td><td class='a'>Obelisk of water</td><td class='a'>It doesn't look very wet</td></tr> <tr><td class='a'>301</td><td class='a'>Obelisk of fire</td><td class='a'>It doesn't look very hot</td></tr> <tr><td class='a'>302</td><td class='a'>sand pit</td><td class='a'>I can use a bucket to get sand from here</td></tr> <tr><td class='a'>303</td><td class='a'>Obelisk of air</td><td class='a'>A tall stone pointy thing</td></tr> <tr><td class='a'>304</td><td class='a'>Obelisk of earth</td><td class='a'>A tall stone pointy thing</td></tr> <tr><td class='a'>305</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>306</td><td class='a'>Oak Tree</td><td class='a'>A grand old oak tree</td></tr> <tr><td class='a'>307</td><td class='a'>Willow Tree</td><td class='a'>A weeping willow</td></tr> <tr><td class='a'>308</td><td class='a'>Maple Tree</td><td class='a'>It's got nice shaped leaves</td></tr> <tr><td class='a'>309</td><td class='a'>Yew Tree</td><td class='a'>A tough looking yew tree</td></tr> <tr><td class='a'>310</td><td class='a'>Tree</td><td class='a'>A magical tree</td></tr> <tr><td class='a'>311</td><td class='a'>gate</td><td class='a'>A gate guarded by a fierce barbarian</td></tr> <tr><td class='a'>312</td><td class='a'>sign</td><td class='a'>The forester's arms</td></tr> <tr><td class='a'>313</td><td class='a'>flax</td><td class='a'>A flax plant</td></tr> <tr><td class='a'>314</td><td class='a'>Large treestump</td><td class='a'>Someone has chopped this tree down!</td></tr> <tr><td class='a'>315</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>316</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>317</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>318</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>319</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>320</td><td class='a'>ship</td><td class='a'>A ship bound for Ardougne</td></tr> <tr><td class='a'>321</td><td class='a'>ship</td><td class='a'>A ship bound for Ardougne</td></tr> <tr><td class='a'>322</td><td class='a'>Bakers Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>323</td><td class='a'>Silk Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>324</td><td class='a'>Fur Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>325</td><td class='a'>Silver Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>326</td><td class='a'>Spices Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>327</td><td class='a'>gems Stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>328</td><td class='a'>crate</td><td class='a'>A large heavy sealed crate</td></tr> <tr><td class='a'>329</td><td class='a'>crate</td><td class='a'>A large heavy sealed crate</td></tr> <tr><td class='a'>330</td><td class='a'>sign</td><td class='a'>RPDT depot</td></tr> <tr><td class='a'>331</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>332</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>333</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>334</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>335</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>336</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>337</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>338</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>339</td><td class='a'>Chest</td><td class='a'>someone is stealing something from it</td></tr> <tr><td class='a'>340</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>341</td><td class='a'>empty stall</td><td class='a'>A market stall</td></tr> <tr><td class='a'>342</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>343</td><td class='a'>hopper</td><td class='a'>You put grain in here</td></tr> <tr><td class='a'>344</td><td class='a'>signpost</td><td class='a'>Ardougne city zoo</td></tr> <tr><td class='a'>345</td><td class='a'>sign</td><td class='a'>The flying horse</td></tr> <tr><td class='a'>346</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>347</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>348</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>349</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>350</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>351</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>352</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>353</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>354</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>355</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>356</td><td class='a'>gate</td><td class='a'>The main entrance to McGrubor's wood</td></tr> <tr><td class='a'>357</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>358</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>359</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>360</td><td class='a'>broken cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>361</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>362</td><td class='a'>clock pole blue</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>363</td><td class='a'>clock pole red</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>364</td><td class='a'>clock pole purple</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>365</td><td class='a'>clock pole black</td><td class='a'>A pole - a pole to put cog's on</td></tr> <tr><td class='a'>366</td><td class='a'>wallclockface</td><td class='a'>It's a large clock face</td></tr> <tr><td class='a'>367</td><td class='a'>Lever Bracket</td><td class='a'>Theres something missing here</td></tr> <tr><td class='a'>368</td><td class='a'>Lever</td><td class='a'>It's a lever</td></tr> <tr><td class='a'>369</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>370</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>371</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>372</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>373</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>374</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>375</td><td class='a'>Foodtrough</td><td class='a'>It's for feeding the rat's</td></tr> <tr><td class='a'>376</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>377</td><td class='a'>spearwall</td><td class='a'>It's a defensive battlement</td></tr> <tr><td class='a'>378</td><td class='a'>hornedskull</td><td class='a'>A horned dragon skull</td></tr> <tr><td class='a'>379</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>380</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>381</td><td class='a'>guardscupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>382</td><td class='a'>guardscupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>383</td><td class='a'>Coal truck</td><td class='a'>I can use this to transport coal</td></tr> <tr><td class='a'>384</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>385</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>386</td><td class='a'>ship</td><td class='a'>A ship to Port Birmhaven</td></tr> <tr><td class='a'>387</td><td class='a'>Tree</td><td class='a'>It's a tree house</td></tr> <tr><td class='a'>388</td><td class='a'>Ballista</td><td class='a'>It's a war machine</td></tr> <tr><td class='a'>389</td><td class='a'>largespear</td><td class='a'></td></tr> <tr><td class='a'>390</td><td class='a'>spirit tree</td><td class='a'>A grand old spirit tree</td></tr> <tr><td class='a'>391</td><td class='a'>young spirit Tree</td><td class='a'>Ancestor of the spirit tree</td></tr> <tr><td class='a'>392</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>393</td><td class='a'>wall</td><td class='a'>A damaged wall</td></tr> <tr><td class='a'>394</td><td class='a'>tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>395</td><td class='a'>tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>396</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>397</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>398</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>399</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>400</td><td class='a'>fly trap</td><td class='a'>A small carnivourous plant</td></tr> <tr><td class='a'>401</td><td class='a'>Fern</td><td class='a'>An exotic leafy plant</td></tr> <tr><td class='a'>402</td><td class='a'>Fern</td><td class='a'>An exotic spikey plant</td></tr> <tr><td class='a'>403</td><td class='a'>plant</td><td class='a'>What an unusual plant</td></tr> <tr><td class='a'>404</td><td class='a'>plant</td><td class='a'>An odd looking plant</td></tr> <tr><td class='a'>405</td><td class='a'>plant</td><td class='a'>some nice jungle foliage</td></tr> <tr><td class='a'>406</td><td class='a'>stone head</td><td class='a'>It looks like it's been here some time</td></tr> <tr><td class='a'>407</td><td class='a'>dead Tree</td><td class='a'>A rotting tree</td></tr> <tr><td class='a'>408</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>409</td><td class='a'>khazard open Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>410</td><td class='a'>khazard shut Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>411</td><td class='a'>doorframe</td><td class='a'>It's a stone doorframe</td></tr> <tr><td class='a'>412</td><td class='a'>Sewer valve</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>413</td><td class='a'>Sewer valve 2</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>414</td><td class='a'>Sewer valve 3</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>415</td><td class='a'>Sewer valve 4</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>416</td><td class='a'>Sewer valve 5</td><td class='a'>It changes the water flow of the sewer's</td></tr> <tr><td class='a'>417</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>418</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>419</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>420</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>421</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>422</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>423</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>424</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>425</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>426</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>427</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>428</td><td class='a'>tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>429</td><td class='a'>Tribal brew</td><td class='a'>A very large pot</td></tr> <tr><td class='a'>430</td><td class='a'>Pineapple tree</td><td class='a'>A tree with nice ripe pineapples growing on it</td></tr> <tr><td class='a'>431</td><td class='a'>Pineapple tree</td><td class='a'>There are no pineapples left on the tree</td></tr> <tr><td class='a'>432</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>433</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>434</td><td class='a'>Tomb of hazeel</td><td class='a'>A clay shrine to lord hazeel</td></tr> <tr><td class='a'>435</td><td class='a'>range</td><td class='a'>A pot of soup slowly cooking</td></tr> <tr><td class='a'>436</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>437</td><td class='a'>Carnillean Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>438</td><td class='a'>Carnillean Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>439</td><td class='a'>crate</td><td class='a'>A crate used for storing food</td></tr> <tr><td class='a'>440</td><td class='a'>Butlers cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>441</td><td class='a'>Butlers cupboard</td><td class='a'>The cupboard is open</td></tr> <tr><td class='a'>442</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>443</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>444</td><td class='a'>Cattle furnace</td><td class='a'>A red hot furnace</td></tr> <tr><td class='a'>445</td><td class='a'>Ardounge wall</td><td class='a'>A huge wall seperating east and west ardounge</td></tr> <tr><td class='a'>446</td><td class='a'>Ardounge wall corner</td><td class='a'>A huge wall seperating east and west ardounge</td></tr> <tr><td class='a'>447</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>448</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>449</td><td class='a'>large Sewer pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>450</td><td class='a'>Ardounge wall gateway</td><td class='a'>A huge set of heavy wooden doors</td></tr> <tr><td class='a'>451</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>452</td><td class='a'>cupboard</td><td class='a'>The cupboard is open</td></tr> <tr><td class='a'>453</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>454</td><td class='a'>Rowboat</td><td class='a'>A reasonably sea worthy two man boat</td></tr> <tr><td class='a'>455</td><td class='a'>Damaged Rowboat</td><td class='a'>A not so sea worthy two man boat</td></tr> <tr><td class='a'>456</td><td class='a'>barrel</td><td class='a'>I wonder what's inside</td></tr> <tr><td class='a'>457</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>458</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>459</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>460</td><td class='a'>Fishing crane</td><td class='a'>For hauling in large catches of fish</td></tr> <tr><td class='a'>461</td><td class='a'>Waterfall</td><td class='a'>it's a waterfall</td></tr> <tr><td class='a'>462</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>463</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>464</td><td class='a'>log raft</td><td class='a'>A mighty fine raft</td></tr> <tr><td class='a'>465</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>466</td><td class='a'>Well</td><td class='a'>An oddly placed well</td></tr> <tr><td class='a'>467</td><td class='a'>Tomb of glarial</td><td class='a'>A stone tomb surrounded by flowers</td></tr> <tr><td class='a'>468</td><td class='a'>Waterfall</td><td class='a'>it's a fast flowing waterfall</td></tr> <tr><td class='a'>469</td><td class='a'>Waterfall</td><td class='a'>it's a fast flowing waterfall</td></tr> <tr><td class='a'>470</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>471</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>472</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>473</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>474</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>475</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>476</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>477</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>478</td><td class='a'>Stone stand</td><td class='a'>On top is an indent the size of a rune stone</td></tr> <tr><td class='a'>479</td><td class='a'>Glarial's Gravestone</td><td class='a'>There is an indent the size of a pebble in the stone's center</td></tr> <tr><td class='a'>480</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>481</td><td class='a'>crate</td><td class='a'>It's a crate</td></tr> <tr><td class='a'>482</td><td class='a'>leaflessTree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>483</td><td class='a'>Statue of glarial</td><td class='a'>A statue of queen glarial - something's missing</td></tr> <tr><td class='a'>484</td><td class='a'>Chalice of eternity</td><td class='a'>A magically elevated chalice full of treasure</td></tr> <tr><td class='a'>485</td><td class='a'>Chalice of eternity</td><td class='a'>A magically elevated chalice full of treasure</td></tr> <tr><td class='a'>486</td><td class='a'>doors</td><td class='a'>The doors are shut</td></tr> <tr><td class='a'>487</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>488</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>489</td><td class='a'>log raft remains</td><td class='a'>oops!</td></tr> <tr><td class='a'>490</td><td class='a'>Tree</td><td class='a'>A pointy tree</td></tr> <tr><td class='a'>491</td><td class='a'> Range</td><td class='a'>A hot well stoked range</td></tr> <tr><td class='a'>492</td><td class='a'>crate</td><td class='a'>It's an old crate</td></tr> <tr><td class='a'>493</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>494</td><td class='a'>Watch tower</td><td class='a'>They're always watching</td></tr> <tr><td class='a'>495</td><td class='a'>signpost</td><td class='a'>Tourist infomation</td></tr> <tr><td class='a'>496</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>497</td><td class='a'>doors</td><td class='a'>The doors are open</td></tr> <tr><td class='a'>498</td><td class='a'>Rope ladder</td><td class='a'>A hand made ladder</td></tr> <tr><td class='a'>499</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>500</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>501</td><td class='a'>Rope ladder</td><td class='a'>A hand made ladder</td></tr> <tr><td class='a'>502</td><td class='a'>Cooking pot</td><td class='a'>the mourners are busy enjoying this stew</td></tr> <tr><td class='a'>503</td><td class='a'>Gallow</td><td class='a'>Best not hang about!</td></tr> <tr><td class='a'>504</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>505</td><td class='a'>crate</td><td class='a'>A crate used for storing confiscated goods</td></tr> <tr><td class='a'>506</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>507</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>508</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>509</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>510</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>511</td><td class='a'>sign</td><td class='a'>Tailors fancy dress</td></tr> <tr><td class='a'>512</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>513</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>514</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>515</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>516</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>517</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>518</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>519</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>520</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>521</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>522</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>523</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>524</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>525</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>526</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>527</td><td class='a'>climbing rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>528</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>529</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>530</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>531</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>532</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>533</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>534</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>535</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>536</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>537</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>538</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>539</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>540</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>541</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>542</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>543</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>544</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>545</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>546</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>547</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>548</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>549</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>550</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>551</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>552</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>553</td><td class='a'>PalmTree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>554</td><td class='a'>Scorched Earth</td><td class='a'>An area of burnt soil</td></tr> <tr><td class='a'>555</td><td class='a'>Rocks</td><td class='a'>A moss covered rock</td></tr> <tr><td class='a'>556</td><td class='a'>sign</td><td class='a'>The dancing donkey inn</td></tr> <tr><td class='a'>557</td><td class='a'>fish</td><td class='a'>I can see fish swimming in the water</td></tr> <tr><td class='a'>558</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>559</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>560</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>561</td><td class='a'>Rocky Walkway</td><td class='a'>A precarious rocky walkway</td></tr> <tr><td class='a'>562</td><td class='a'>fight Dummy</td><td class='a'>I can practice my fighting here</td></tr> <tr><td class='a'>563</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>564</td><td class='a'>Jungle Vine</td><td class='a'>A deep jungle Vine</td></tr> <tr><td class='a'>565</td><td class='a'>statue</td><td class='a'>hand carved</td></tr> <tr><td class='a'>566</td><td class='a'>sign</td><td class='a'>Ye Olde Dragon Inn</td></tr> <tr><td class='a'>567</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>568</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>569</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>570</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>571</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>572</td><td class='a'>Hillside Entrance</td><td class='a'>Large doors that seem to lead into the hillside</td></tr> <tr><td class='a'>573</td><td class='a'>tree</td><td class='a'>A large exotic looking tree</td></tr> <tr><td class='a'>574</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>575</td><td class='a'>Tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>576</td><td class='a'>Tree platform</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>577</td><td class='a'>Metalic Dungeon Gate</td><td class='a'>It seems to be closed</td></tr> <tr><td class='a'>578</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>579</td><td class='a'>Log bridge</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>580</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>581</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>582</td><td class='a'>Shallow water</td><td class='a'>A small opening in the ground with some spots of water</td></tr> <tr><td class='a'>583</td><td class='a'>Doors</td><td class='a'>Perhaps you should give them a push</td></tr> <tr><td class='a'>584</td><td class='a'>grand tree</td><td class='a'>the grand tree</td></tr> <tr><td class='a'>585</td><td class='a'>Tree Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>586</td><td class='a'>Tree Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>587</td><td class='a'>blurberrys cocktail bar</td><td class='a'>the gnome social hot spot</td></tr> <tr><td class='a'>588</td><td class='a'>Gem Rocks</td><td class='a'>A rocky outcrop with a vein of semi precious stones</td></tr> <tr><td class='a'>589</td><td class='a'>Giannes place</td><td class='a'>Eat green eat gnome cruisine</td></tr> <tr><td class='a'>590</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>591</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>592</td><td class='a'>Frame</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>593</td><td class='a'>Tree</td><td class='a'>It has a branch ideal for tying ropes to</td></tr> <tr><td class='a'>594</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>595</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>596</td><td class='a'>cart</td><td class='a'>A farm cart</td></tr> <tr><td class='a'>597</td><td class='a'>fence</td><td class='a'>it doesn't look too strong</td></tr> <tr><td class='a'>598</td><td class='a'>beam</td><td class='a'>A plank of wood</td></tr> <tr><td class='a'>599</td><td class='a'>Sign</td><td class='a'>read me</td></tr> <tr><td class='a'>600</td><td class='a'>Sign</td><td class='a'>Blurberry's cocktail bar</td></tr> <tr><td class='a'>601</td><td class='a'>Sign</td><td class='a'>Giannes tree gnome cuisine</td></tr> <tr><td class='a'>602</td><td class='a'>Sign</td><td class='a'>Heckel funch's grocery store</td></tr> <tr><td class='a'>603</td><td class='a'>Sign</td><td class='a'>Hudo glenfad's grocery store</td></tr> <tr><td class='a'>604</td><td class='a'>Sign</td><td class='a'>Rometti's fashion outlet</td></tr> <tr><td class='a'>605</td><td class='a'>Sign</td><td class='a'>Tree gnome bank and rometti's fashion outlet</td></tr> <tr><td class='a'>606</td><td class='a'>Sign</td><td class='a'>Tree gnome local swamp</td></tr> <tr><td class='a'>607</td><td class='a'>Sign</td><td class='a'>Agility training course</td></tr> <tr><td class='a'>608</td><td class='a'>Sign</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>609</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>610</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>611</td><td class='a'>Metal Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>612</td><td class='a'>Metal Gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>613</td><td class='a'>A farm cart</td><td class='a'>It is blocking the entrance to the village</td></tr> <tr><td class='a'>614</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>615</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>616</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>617</td><td class='a'>cage</td><td class='a'>i don't like the look of that</td></tr> <tr><td class='a'>618</td><td class='a'>glider</td><td class='a'>i wonder if it flys</td></tr> <tr><td class='a'>619</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>620</td><td class='a'>cupboard</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>621</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>622</td><td class='a'>glider</td><td class='a'>i wonder if it flys</td></tr> <tr><td class='a'>623</td><td class='a'>gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>624</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>625</td><td class='a'>chaos altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>626</td><td class='a'>Gnome stronghold gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>627</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>628</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>629</td><td class='a'>stairs</td><td class='a'>These lead upstairs</td></tr> <tr><td class='a'>630</td><td class='a'>stairs</td><td class='a'>These lead downstairs</td></tr> <tr><td class='a'>631</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>632</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>633</td><td class='a'>Pile of rubble</td><td class='a'>What a mess</td></tr> <tr><td class='a'>634</td><td class='a'>Stone stand</td><td class='a'>On top our four indents from left to right</td></tr> <tr><td class='a'>635</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>636</td><td class='a'>Pile of rubble</td><td class='a'>What a mess</td></tr> <tr><td class='a'>637</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>638</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>639</td><td class='a'>Root</td><td class='a'>To the grand tree</td></tr> <tr><td class='a'>640</td><td class='a'>Sign</td><td class='a'>Home to the Head tree guardian</td></tr> <tr><td class='a'>641</td><td class='a'>Hammock</td><td class='a'>They've got to sleep somewhere</td></tr> <tr><td class='a'>642</td><td class='a'>Goal</td><td class='a'>You're supposed to throw the ball here</td></tr> <tr><td class='a'>643</td><td class='a'>stone tile</td><td class='a'>It looks as if it might move</td></tr> <tr><td class='a'>644</td><td class='a'>Chest</td><td class='a'>You get a sense of dread from the chest</td></tr> <tr><td class='a'>645</td><td class='a'>Chest</td><td class='a'>You get a sense of dread from the chest</td></tr> <tr><td class='a'>646</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>647</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>648</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>649</td><td class='a'>Watch tower</td><td class='a'>A tree gnome construction</td></tr> <tr><td class='a'>650</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>651</td><td class='a'>Bumpy Dirt</td><td class='a'>Some disturbed earth</td></tr> <tr><td class='a'>652</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>653</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>654</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>655</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>656</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>657</td><td class='a'>pipe</td><td class='a'>a dirty sewer pipe</td></tr> <tr><td class='a'>658</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>659</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>660</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>661</td><td class='a'>stronghold spirit Tree</td><td class='a'>Ancestor of the spirit tree</td></tr> <tr><td class='a'>662</td><td class='a'>Tree</td><td class='a'>It has a branch ideal for tying ropes to</td></tr> <tr><td class='a'>663</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>664</td><td class='a'>Tree</td><td class='a'>I wonder who put that rope there</td></tr> <tr><td class='a'>665</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>666</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>667</td><td class='a'>Cave</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>668</td><td class='a'>stone pebble</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>669</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>670</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>671</td><td class='a'>pipe</td><td class='a'>I might be able to fit through this</td></tr> <tr><td class='a'>672</td><td class='a'>pipe</td><td class='a'>2</td></tr> <tr><td class='a'>673</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>674</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>675</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>676</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>677</td><td class='a'>net</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>678</td><td class='a'>Ledge</td><td class='a'>It looks rather thin</td></tr> <tr><td class='a'>679</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>680</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>681</td><td class='a'>log</td><td class='a'>It looks slippery</td></tr> <tr><td class='a'>682</td><td class='a'>Rotten Gallows</td><td class='a'>A human corpse hangs from the noose</td></tr> <tr><td class='a'>683</td><td class='a'>Pile of rubble</td><td class='a'>Rocks that have caved in</td></tr> <tr><td class='a'>684</td><td class='a'>ropeswing</td><td class='a'>I wonder what's over here</td></tr> <tr><td class='a'>685</td><td class='a'>ropeswing</td><td class='a'>I wonder what's over here</td></tr> <tr><td class='a'>686</td><td class='a'>ocks</td><td class='a'>A moss covered rock</td></tr> <tr><td class='a'>687</td><td class='a'>Tree</td><td class='a'>This tree doesn't look too healthy</td></tr> <tr><td class='a'>688</td><td class='a'>Well stacked rocks</td><td class='a'>Rocks that have been stacked at regular intervals</td></tr> <tr><td class='a'>689</td><td class='a'>Tomb Dolmen</td><td class='a'>An ancient construct for displaying the bones of the deceased</td></tr> <tr><td class='a'>690</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>691</td><td class='a'>Bridge Blockade</td><td class='a'>A crudely constructed fence to stop you going further</td></tr> <tr><td class='a'>692</td><td class='a'>Log Bridge</td><td class='a'>A slippery log that is a make-do bridge</td></tr> <tr><td class='a'>693</td><td class='a'>Handholds</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>694</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>695</td><td class='a'>Tree</td><td class='a'>they look fun to swing on</td></tr> <tr><td class='a'>696</td><td class='a'>Wet rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>697</td><td class='a'>Smashed table</td><td class='a'>This table has seen better days</td></tr> <tr><td class='a'>698</td><td class='a'>Crude Raft</td><td class='a'>A crudely constructed raft</td></tr> <tr><td class='a'>699</td><td class='a'>Daconia rock</td><td class='a'>Piles of daconia rock</td></tr> <tr><td class='a'>700</td><td class='a'>statue</td><td class='a'>A statue to mark Taie Bwo Wannai sacred grounds</td></tr> <tr><td class='a'>701</td><td class='a'>Stepping stones</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>702</td><td class='a'>gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>703</td><td class='a'>gate</td><td class='a'>Enter to balance into an agility area</td></tr> <tr><td class='a'>704</td><td class='a'>gate</td><td class='a'>Enter to balance into an agility area</td></tr> <tr><td class='a'>705</td><td class='a'>pipe</td><td class='a'>It looks a tight squeeze</td></tr> <tr><td class='a'>706</td><td class='a'>ropeswing</td><td class='a'>A good place to train agility</td></tr> <tr><td class='a'>707</td><td class='a'>Stone</td><td class='a'>Looks like a stone</td></tr> <tr><td class='a'>708</td><td class='a'>Ledge</td><td class='a'>It doesn't look stable</td></tr> <tr><td class='a'>709</td><td class='a'>Vine</td><td class='a'>A creepy creeper</td></tr> <tr><td class='a'>710</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>711</td><td class='a'>Wooden Gate</td><td class='a'>The gate is open</td></tr> <tr><td class='a'>712</td><td class='a'>Wooden Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>713</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>714</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>715</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>716</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>717</td><td class='a'>Stone platform</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>718</td><td class='a'>fence</td><td class='a'>it doesn't look too strong</td></tr> <tr><td class='a'>719</td><td class='a'>Rocks</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>720</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>721</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>722</td><td class='a'>Gate of Iban</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>723</td><td class='a'>Wooden Door</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>724</td><td class='a'>Tomb Dolmen</td><td class='a'>An ancient construct for displaying the bones of the deceased</td></tr> <tr><td class='a'>725</td><td class='a'>Cave entrance</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>726</td><td class='a'>Old bridge</td><td class='a'>That's been there a while</td></tr> <tr><td class='a'>727</td><td class='a'>Old bridge</td><td class='a'>That's been there a while</td></tr> <tr><td class='a'>728</td><td class='a'>Crumbled rock</td><td class='a'>climb up to above ground</td></tr> <tr><td class='a'>729</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>730</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>731</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>732</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>733</td><td class='a'>Lever</td><td class='a'>Seems to be some sort of winch</td></tr> <tr><td class='a'>734</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>735</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>736</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>737</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>738</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>739</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>740</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>741</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>742</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>743</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>744</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>745</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>746</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>747</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>748</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>749</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>750</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>751</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>752</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>753</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>754</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>755</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>756</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>757</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>758</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>759</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>760</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>761</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>762</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>763</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>764</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>765</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>766</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>767</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>768</td><td class='a'>Travel Cart</td><td class='a'>A sturdy cart for travelling in</td></tr> <tr><td class='a'>769</td><td class='a'>Travel Cart</td><td class='a'>A sturdy cart for travelling in</td></tr> <tr><td class='a'>770</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>771</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>772</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>773</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>774</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>775</td><td class='a'>sign</td><td class='a'>The Paramaya Hostel</td></tr> <tr><td class='a'>776</td><td class='a'>Ladder</td><td class='a'>A ladder that leads to the dormitory - a ticket is needed</td></tr> <tr><td class='a'>777</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>778</td><td class='a'>Spiked pit</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>779</td><td class='a'>signpost</td><td class='a'>To the Furnace</td></tr> <tr><td class='a'>780</td><td class='a'>Ship</td><td class='a'>A sea faring ship called 'Lady Of The Waves'</td></tr> <tr><td class='a'>781</td><td class='a'>Ship</td><td class='a'>A sea faring ship called 'Lady Of The Waves'</td></tr> <tr><td class='a'>782</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>783</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>784</td><td class='a'>Zamorakian Temple</td><td class='a'>Scary!</td></tr> <tr><td class='a'>785</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>786</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>787</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>788</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>789</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>790</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>791</td><td class='a'>Grill</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>792</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>793</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>794</td><td class='a'>Tomb Doors</td><td class='a'>Ornately carved wooden doors depicting skeletal warriors</td></tr> <tr><td class='a'>795</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>796</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>797</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>798</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>799</td><td class='a'>stalactite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>800</td><td class='a'>Spiked pit</td><td class='a'>They looks suspicious</td></tr> <tr><td class='a'>801</td><td class='a'>Lever</td><td class='a'>Seems to be some sort of winch</td></tr> <tr><td class='a'>802</td><td class='a'>Cage</td><td class='a'>Seems to be mechanical </td></tr> <tr><td class='a'>803</td><td class='a'>Cage</td><td class='a'>Seems to be mechanical </td></tr> <tr><td class='a'>804</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>805</td><td class='a'>Spear trap</td><td class='a'>Ouch!</td></tr> <tr><td class='a'>806</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>807</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>808</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>809</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>810</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>811</td><td class='a'>Rocks</td><td class='a'>More rocks!</td></tr> <tr><td class='a'>812</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>813</td><td class='a'>Furnace</td><td class='a'>Charred bones are slowly burning inside</td></tr> <tr><td class='a'>814</td><td class='a'>Well</td><td class='a'>The remains of a warrior slump over the strange construction</td></tr> <tr><td class='a'>815</td><td class='a'>Passage</td><td class='a'>A strange metal grill covers the passage</td></tr> <tr><td class='a'>816</td><td class='a'>Passage</td><td class='a'>The passage way has swung down to a vertical position</td></tr> <tr><td class='a'>817</td><td class='a'>Passage</td><td class='a'>The passage way has swung down to a vertical position</td></tr> <tr><td class='a'>818</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>819</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>820</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>821</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>822</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>823</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>824</td><td class='a'>Rocks</td><td class='a'>You should be able to move these</td></tr> <tr><td class='a'>825</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>826</td><td class='a'>snap trap</td><td class='a'>aaaarghh</td></tr> <tr><td class='a'>827</td><td class='a'>Wooden planks</td><td class='a'>You can walk across these</td></tr> <tr><td class='a'>828</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>829</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>830</td><td class='a'>Flames of zamorak</td><td class='a'>Careful</td></tr> <tr><td class='a'>831</td><td class='a'>Platform</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>832</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>833</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>834</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>835</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>836</td><td class='a'>wall grill</td><td class='a'>It seems to filter the rotten air through the caverns</td></tr> <tr><td class='a'>837</td><td class='a'>Ledge</td><td class='a'>I might be able to make to the other side</td></tr> <tr><td class='a'>838</td><td class='a'>wall grill</td><td class='a'>It seems to filter the rotten air through the caverns</td></tr> <tr><td class='a'>839</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>840</td><td class='a'>Dug up soil</td><td class='a'>A freshly dug pile of mud</td></tr> <tr><td class='a'>841</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>842</td><td class='a'>stalagmite</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>843</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>844</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>845</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>846</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>847</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>848</td><td class='a'>Spiked pit</td><td class='a'>I don't want to go down there</td></tr> <tr><td class='a'>849</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>850</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>851</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>852</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>853</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>854</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>855</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>856</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>857</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>858</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>859</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>860</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>861</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>862</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>863</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>864</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>865</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>866</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>867</td><td class='a'>Boulder</td><td class='a'>Could be dangerous!</td></tr> <tr><td class='a'>868</td><td class='a'>crate</td><td class='a'>Someone or something has been here before us</td></tr> <tr><td class='a'>869</td><td class='a'>Door</td><td class='a'>Spooky!</td></tr> <tr><td class='a'>870</td><td class='a'>Platform</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>871</td><td class='a'>Cage remains</td><td class='a'>Poor unicorn!</td></tr> <tr><td class='a'>872</td><td class='a'>Ledge</td><td class='a'>I might be able to climb that</td></tr> <tr><td class='a'>873</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>874</td><td class='a'>Passage</td><td class='a'>Looks suspicous!</td></tr> <tr><td class='a'>875</td><td class='a'>Gate of Zamorak</td><td class='a'>It doesn't look very inviting</td></tr> <tr><td class='a'>876</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>877</td><td class='a'>Bridge support</td><td class='a'>An ancient construction</td></tr> <tr><td class='a'>878</td><td class='a'>Tomb of Iban</td><td class='a'>A clay shrine to lord iban</td></tr> <tr><td class='a'>879</td><td class='a'>Claws of Iban</td><td class='a'>claws of iban</td></tr> <tr><td class='a'>880</td><td class='a'>barrel</td><td class='a'>Its stinks of alcohol</td></tr> <tr><td class='a'>881</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>882</td><td class='a'>Rocks</td><td class='a'>More rocks</td></tr> <tr><td class='a'>883</td><td class='a'>Rocks</td><td class='a'>More rocks</td></tr> <tr><td class='a'>884</td><td class='a'>Swamp</td><td class='a'>That smells horrid</td></tr> <tr><td class='a'>885</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>886</td><td class='a'>Stone bridge</td><td class='a'>An ancient stone construction</td></tr> <tr><td class='a'>887</td><td class='a'>cage</td><td class='a'>That's no way to live</td></tr> <tr><td class='a'>888</td><td class='a'>cage</td><td class='a'>That's no way to live</td></tr> <tr><td class='a'>889</td><td class='a'>Stone steps</td><td class='a'>They lead into the darkness</td></tr> <tr><td class='a'>890</td><td class='a'>Pile of mud</td><td class='a'>Mud and rocks piled up</td></tr> <tr><td class='a'>891</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>892</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>893</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>894</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>895</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>896</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>897</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>898</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>899</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>900</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>901</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>902</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>903</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>904</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>905</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>906</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>907</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>908</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>909</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>910</td><td class='a'>Stone bridge</td><td class='a'>The bridge has partly collapsed</td></tr> <tr><td class='a'>911</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>912</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>913</td><td class='a'>Pit of the Damned</td><td class='a'>The son of zamoracks alter...</td></tr> <tr><td class='a'>914</td><td class='a'>Open Door</td><td class='a'>Spooky!</td></tr> <tr><td class='a'>915</td><td class='a'>signpost</td><td class='a'>Observatory reception</td></tr> <tr><td class='a'>916</td><td class='a'>Stone Gate</td><td class='a'>A mystical looking object</td></tr> <tr><td class='a'>917</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>918</td><td class='a'>Zodiac</td><td class='a'>A map of the twelve signs of the zodiac</td></tr> <tr><td class='a'>919</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>920</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>921</td><td class='a'>Stone steps</td><td class='a'>They lead into the darkness</td></tr> <tr><td class='a'>922</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>923</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>924</td><td class='a'>Rock</td><td class='a'>Scripture has been carved into the rock</td></tr> <tr><td class='a'>925</td><td class='a'>Telescope</td><td class='a'>A device for viewing the heavens</td></tr> <tr><td class='a'>926</td><td class='a'>Gate</td><td class='a'>The entrance to the dungeon jail</td></tr> <tr><td class='a'>927</td><td class='a'>sacks</td><td class='a'>These sacks feels lumpy!</td></tr> <tr><td class='a'>928</td><td class='a'>Ladder</td><td class='a'>the ladder goes down into a dark area</td></tr> <tr><td class='a'>929</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>930</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>931</td><td class='a'>Bookcase</td><td class='a'>A very roughly constructed bookcase.</td></tr> <tr><td class='a'>932</td><td class='a'>Iron Gate</td><td class='a'>A well wrought iron gate - it's locked.</td></tr> <tr><td class='a'>933</td><td class='a'>Ladder</td><td class='a'>the ladder down to the cavern</td></tr> <tr><td class='a'>934</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>935</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>936</td><td class='a'>Chest</td><td class='a'>Perhaps there is something inside</td></tr> <tr><td class='a'>937</td><td class='a'>Chest</td><td class='a'>All these chests look the same!</td></tr> <tr><td class='a'>938</td><td class='a'>Rockslide</td><td class='a'>A pile of rocks blocks your path</td></tr> <tr><td class='a'>939</td><td class='a'>Altar</td><td class='a'>An altar to the evil God Zamorak</td></tr> <tr><td class='a'>940</td><td class='a'>column</td><td class='a'>Formed over thousands of years</td></tr> <tr><td class='a'>941</td><td class='a'>Grave of Scorpius</td><td class='a'>Here lies Scorpius: dread follower of zamorak</td></tr> <tr><td class='a'>942</td><td class='a'>Bank Chest</td><td class='a'>Allows you to access your bank.</td></tr> <tr><td class='a'>943</td><td class='a'>dwarf multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>944</td><td class='a'>Disturbed sand</td><td class='a'>Footprints in the sand show signs of a struggle</td></tr> <tr><td class='a'>945</td><td class='a'>Disturbed sand</td><td class='a'>Footprints in the sand show signs of a struggle</td></tr> <tr><td class='a'>946</td><td class='a'>dwarf multicannon base</td><td class='a'>bang</td></tr> <tr><td class='a'>947</td><td class='a'>dwarf multicannon stand</td><td class='a'>bang</td></tr> <tr><td class='a'>948</td><td class='a'>dwarf multicannon barrels</td><td class='a'>bang</td></tr> <tr><td class='a'>949</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>950</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>951</td><td class='a'>fence</td><td class='a'>These bridges seem hastily put up</td></tr> <tr><td class='a'>952</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>953</td><td class='a'>Rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>954</td><td class='a'>Rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>955</td><td class='a'>Cave entrance</td><td class='a'>A noxious smell emanates from the cave...</td></tr> <tr><td class='a'>956</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>957</td><td class='a'>Chest</td><td class='a'>I wouldn't like to think where the owner is now</td></tr> <tr><td class='a'>958</td><td class='a'>Wooden Doors</td><td class='a'>Large oak doors constantly watched by guards</td></tr> <tr><td class='a'>959</td><td class='a'>Pedestal</td><td class='a'>something fits on here</td></tr> <tr><td class='a'>960</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>961</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>962</td><td class='a'>Standard</td><td class='a'>A standard with a human skull on it</td></tr> <tr><td class='a'>963</td><td class='a'>Mining Cave</td><td class='a'>A gaping hole that leads to another section of the mine</td></tr> <tr><td class='a'>964</td><td class='a'>Mining Cave</td><td class='a'>A gaping hole that leads to another section of the mine</td></tr> <tr><td class='a'>965</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>966</td><td class='a'>Lift</td><td class='a'>To brings mined rocks to the surface</td></tr> <tr><td class='a'>967</td><td class='a'>Mining Barrel</td><td class='a'>For loading up mined stone from below ground</td></tr> <tr><td class='a'>968</td><td class='a'>Hole</td><td class='a'>I wonder where this leads...</td></tr> <tr><td class='a'>969</td><td class='a'>Hole</td><td class='a'>I wonder where this leads...</td></tr> <tr><td class='a'>970</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>971</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>972</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>973</td><td class='a'>Counter</td><td class='a'>An ogre is selling items here</td></tr> <tr><td class='a'>974</td><td class='a'>Track</td><td class='a'>Train track</td></tr> <tr><td class='a'>975</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>976</td><td class='a'>Mine Cart</td><td class='a'>A heavily constructed and often used mining cart.</td></tr> <tr><td class='a'>977</td><td class='a'>Lift Platform</td><td class='a'>A wooden lift that is operated from the surface.</td></tr> <tr><td class='a'>978</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>979</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>980</td><td class='a'>Watch tower</td><td class='a'>Constructed by the dwarven black guard</td></tr> <tr><td class='a'>981</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>982</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>983</td><td class='a'>Pile of mud</td><td class='a'>Mud caved in from above</td></tr> <tr><td class='a'>984</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>985</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>986</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>987</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>988</td><td class='a'>Gate</td><td class='a'>This gate barrs your way into gu'tanoth</td></tr> <tr><td class='a'>989</td><td class='a'>Gate</td><td class='a'>This gate barrs your way into gu'tanoth</td></tr> <tr><td class='a'>990</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>991</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>992</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>993</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>994</td><td class='a'>multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>995</td><td class='a'>Rocks</td><td class='a'>Some rocks are close to the egde</td></tr> <tr><td class='a'>996</td><td class='a'>Rocks</td><td class='a'>Some rocks are close to the edge</td></tr> <tr><td class='a'>997</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>998</td><td class='a'>Cave entrance</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>999</td><td class='a'>Counter</td><td class='a'>An ogre is selling cakes here</td></tr> <tr><td class='a'>1000</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1001</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1002</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1003</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1004</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>1005</td><td class='a'>Captains Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1006</td><td class='a'>Experimental Anvil</td><td class='a'>An experimental anvil - for developing new techniques in forging</td></tr> <tr><td class='a'>1007</td><td class='a'>Rocks</td><td class='a'>A small pile of stones</td></tr> <tr><td class='a'>1008</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1009</td><td class='a'>Column</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1010</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1011</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1012</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1013</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1014</td><td class='a'>Lever</td><td class='a'>The lever is up</td></tr> <tr><td class='a'>1015</td><td class='a'>Lever</td><td class='a'>The lever is down</td></tr> <tr><td class='a'>1016</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1017</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> <tr><td class='a'>1018</td><td class='a'>Wall</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1019</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>1020</td><td class='a'>Gate</td><td class='a'>The gate is closed</td></tr> <tr><td class='a'>1021</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>1022</td><td class='a'>shock</td><td class='a'>cosmic energy</td></tr> <tr><td class='a'>1023</td><td class='a'>Desk</td><td class='a'>A very strong looking table with some locked drawers.</td></tr> <tr><td class='a'>1024</td><td class='a'>Cave</td><td class='a'>I wonder what's inside!</td></tr> <tr><td class='a'>1025</td><td class='a'>Mining Cart</td><td class='a'>A sturdy well built mining cart with barrels full of rock on the back.</td></tr> <tr><td class='a'>1026</td><td class='a'>Rock of Dalgroth</td><td class='a'>A mysterious boulder of the ogres</td></tr> <tr><td class='a'>1027</td><td class='a'>entrance</td><td class='a'>Created by ancient mages</td></tr> <tr><td class='a'>1028</td><td class='a'>Dried Cactus</td><td class='a'>It looks very spikey</td></tr> <tr><td class='a'>1029</td><td class='a'>climbing rocks</td><td class='a'>I wonder if I can climb up these</td></tr> <tr><td class='a'>1030</td><td class='a'>Rocks</td><td class='a'>Strange rocks - who knows why they're wanted?</td></tr> <tr><td class='a'>1031</td><td class='a'>lightning</td><td class='a'>blimey!</td></tr> <tr><td class='a'>1032</td><td class='a'>Crude Desk</td><td class='a'>A very roughly constructed desk</td></tr> <tr><td class='a'>1033</td><td class='a'>Heavy Metal Gate</td><td class='a'>This is an immense and very heavy looking gate made out of thick wrought metal</td></tr> <tr><td class='a'>1034</td><td class='a'>Counter</td><td class='a'>An ogre is selling cakes here</td></tr> <tr><td class='a'>1035</td><td class='a'>Crude bed</td><td class='a'>A flea infested sleeping experience</td></tr> <tr><td class='a'>1036</td><td class='a'>flames</td><td class='a'>looks hot!</td></tr> <tr><td class='a'>1037</td><td class='a'>Carved Rock</td><td class='a'>An ornately carved rock with a pointed recepticle</td></tr> <tr><td class='a'>1038</td><td class='a'>USE</td><td class='a'>FREE SLOT PLEASE USE</td></tr> <tr><td class='a'>1039</td><td class='a'>crate</td><td class='a'>A crate used for storing materials</td></tr> <tr><td class='a'>1040</td><td class='a'>crate</td><td class='a'>A crate used for storing materials</td></tr> <tr><td class='a'>1041</td><td class='a'>barrel</td><td class='a'>Its shut</td></tr> <tr><td class='a'>1042</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1043</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1044</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1045</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1046</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1047</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1048</td><td class='a'>Barrier</td><td class='a'>this section is roped off</td></tr> <tr><td class='a'>1049</td><td class='a'>buried skeleton</td><td class='a'>I hope I don't meet any of these</td></tr> <tr><td class='a'>1050</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1051</td><td class='a'>Brick</td><td class='a'>A stone brick</td></tr> <tr><td class='a'>1052</td><td class='a'>Specimen tray</td><td class='a'>A pile of sifted earth</td></tr> <tr><td class='a'>1053</td><td class='a'>winch</td><td class='a'>This winches earth from the dig hole</td></tr> <tr><td class='a'>1054</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>1055</td><td class='a'>crate</td><td class='a'>A crate</td></tr> <tr><td class='a'>1056</td><td class='a'>Urn</td><td class='a'>A large ornamental urn</td></tr> <tr><td class='a'>1057</td><td class='a'>buried skeleton</td><td class='a'>I'm glad this isn't around now</td></tr> <tr><td class='a'>1058</td><td class='a'>panning point</td><td class='a'>a shallow where I can pan for gold</td></tr> <tr><td class='a'>1059</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1060</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1061</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1062</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1063</td><td class='a'>signpost</td><td class='a'>a signpost</td></tr> <tr><td class='a'>1064</td><td class='a'>signpost</td><td class='a'>Digsite educational centre</td></tr> <tr><td class='a'>1065</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1066</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1067</td><td class='a'>soil</td><td class='a'>soil</td></tr> <tr><td class='a'>1068</td><td class='a'>Gate</td><td class='a'>The gate has closed</td></tr> <tr><td class='a'>1069</td><td class='a'>ship</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1070</td><td class='a'>barrel</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1071</td><td class='a'>Leak</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1072</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>1073</td><td class='a'>bush</td><td class='a'>A leafy bush</td></tr> <tr><td class='a'>1074</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1075</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1076</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1077</td><td class='a'>Leak</td><td class='a'>The ship is sinking</td></tr> <tr><td class='a'>1078</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1079</td><td class='a'>Wrought Mithril Gates</td><td class='a'>Magnificent wrought mithril gates giving access to the Legends Guild</td></tr> <tr><td class='a'>1080</td><td class='a'>Legends Hall Doors</td><td class='a'>Solid Oak doors leading to the Hall of Legends</td></tr> <tr><td class='a'>1081</td><td class='a'>Camp bed</td><td class='a'>Not comfortable but useful nonetheless</td></tr> <tr><td class='a'>1082</td><td class='a'>barrel</td><td class='a'>It has a lid on it - I need something to lever it off</td></tr> <tr><td class='a'>1083</td><td class='a'>barrel</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1084</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1085</td><td class='a'>Chest</td><td class='a'>I wonder what is inside...</td></tr> <tr><td class='a'>1086</td><td class='a'>Dense Jungle Tree</td><td class='a'>Thick vegetation</td></tr> <tr><td class='a'>1087</td><td class='a'>Jungle tree stump</td><td class='a'>A chopped down jungle tree</td></tr> <tr><td class='a'>1088</td><td class='a'>signpost</td><td class='a'>To the digsite</td></tr> <tr><td class='a'>1089</td><td class='a'>gate</td><td class='a'>You can pass through this on the members server</td></tr> <tr><td class='a'>1090</td><td class='a'>Bookcase</td><td class='a'>A large collection of books</td></tr> <tr><td class='a'>1091</td><td class='a'>Dense Jungle Tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>1092</td><td class='a'>Dense Jungle Tree</td><td class='a'>An exotic looking tree</td></tr> <tr><td class='a'>1093</td><td class='a'>Spray</td><td class='a'>There's a strong wind</td></tr> <tr><td class='a'>1094</td><td class='a'>Spray</td><td class='a'>There's a strong wind</td></tr> <tr><td class='a'>1095</td><td class='a'>winch</td><td class='a'>This winches earth from the dig hole</td></tr> <tr><td class='a'>1096</td><td class='a'>Brick</td><td class='a'>It seems these were put here deliberately</td></tr> <tr><td class='a'>1097</td><td class='a'>Rope</td><td class='a'>it's a rope leading upwards</td></tr> <tr><td class='a'>1098</td><td class='a'>Rope</td><td class='a'>it's a rope leading upwards</td></tr> <tr><td class='a'>1099</td><td class='a'>Dense Jungle Palm</td><td class='a'>A hardy palm tree with dense wood</td></tr> <tr><td class='a'>1100</td><td class='a'>Dense Jungle Palm</td><td class='a'>A hardy palm tree with dense wood</td></tr> <tr><td class='a'>1101</td><td class='a'>Trawler net</td><td class='a'>A huge net to catch little fish</td></tr> <tr><td class='a'>1102</td><td class='a'>Trawler net</td><td class='a'>A huge net to catch little fish</td></tr> <tr><td class='a'>1103</td><td class='a'>Brick</td><td class='a'>The bricks are covered in the strange compound</td></tr> <tr><td class='a'>1104</td><td class='a'>Chest</td><td class='a'>I wonder what is inside ?</td></tr> <tr><td class='a'>1105</td><td class='a'>Chest</td><td class='a'>Perhaps I should search it</td></tr> <tr><td class='a'>1106</td><td class='a'>Trawler catch</td><td class='a'>Smells like fish!</td></tr> <tr><td class='a'>1107</td><td class='a'>Yommi Tree</td><td class='a'>An adolescent rare and mystical looking tree in</td></tr> <tr><td class='a'>1108</td><td class='a'>Grown Yommi Tree</td><td class='a'>A fully grown rare and mystical looking tree</td></tr> <tr><td class='a'>1109</td><td class='a'>Chopped Yommi Tree</td><td class='a'>A mystical looking tree that has recently been felled</td></tr> <tr><td class='a'>1110</td><td class='a'>Trimmed Yommi Tree</td><td class='a'>The trunk of the yommi tree.</td></tr> <tr><td class='a'>1111</td><td class='a'>Totem Pole</td><td class='a'>A nicely crafted wooden totem pole.</td></tr> <tr><td class='a'>1112</td><td class='a'>Baby Yommi Tree</td><td class='a'>A baby Yommi tree - with a mystical aura</td></tr> <tr><td class='a'>1113</td><td class='a'>Fertile earth</td><td class='a'>A very fertile patch of earth</td></tr> <tr><td class='a'>1114</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1115</td><td class='a'>Hanging rope</td><td class='a'>A rope hangs from the ceiling</td></tr> <tr><td class='a'>1116</td><td class='a'>Rocks</td><td class='a'>A large boulder blocking the stream</td></tr> <tr><td class='a'>1117</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1118</td><td class='a'>dwarf multicannon</td><td class='a'>fires metal balls</td></tr> <tr><td class='a'>1119</td><td class='a'>dwarf multicannon base</td><td class='a'>bang</td></tr> <tr><td class='a'>1120</td><td class='a'>dwarf multicannon stand</td><td class='a'>bang</td></tr> <tr><td class='a'>1121</td><td class='a'>dwarf multicannon barrels</td><td class='a'>bang</td></tr> <tr><td class='a'>1122</td><td class='a'>rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>1123</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1124</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1125</td><td class='a'>Rock Hewn Stairs</td><td class='a'>steps cut out of the living rock</td></tr> <tr><td class='a'>1126</td><td class='a'>Compost Heap</td><td class='a'>The family gardeners' compost heap</td></tr> <tr><td class='a'>1127</td><td class='a'>beehive</td><td class='a'>An old looking beehive</td></tr> <tr><td class='a'>1128</td><td class='a'>Drain</td><td class='a'>This drainpipe runs from the kitchen to the sewers</td></tr> <tr><td class='a'>1129</td><td class='a'>web</td><td class='a'>An old thick spider's web</td></tr> <tr><td class='a'>1130</td><td class='a'>fountain</td><td class='a'>There seems to be a lot of insects here</td></tr> <tr><td class='a'>1131</td><td class='a'>Sinclair Crest</td><td class='a'>The Sinclair family crest</td></tr> <tr><td class='a'>1132</td><td class='a'>barrel</td><td class='a'>Annas stuff - There seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1133</td><td class='a'>barrel</td><td class='a'>Bobs things - There seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1134</td><td class='a'>barrel</td><td class='a'>Carols belongings - there seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1135</td><td class='a'>barrel</td><td class='a'>Davids equipment - there seems to be something shiny at the bottom</td></tr> <tr><td class='a'>1136</td><td class='a'>barrel</td><td class='a'>Elizabeths clothes - theres something shiny at the bottom</td></tr> <tr><td class='a'>1137</td><td class='a'>barrel</td><td class='a'>Franks barrel seems to have something shiny at the bottom</td></tr> <tr><td class='a'>1138</td><td class='a'>Flour Barrel</td><td class='a'>Its full of flour</td></tr> <tr><td class='a'>1139</td><td class='a'>sacks</td><td class='a'>Full of various gardening tools</td></tr> <tr><td class='a'>1140</td><td class='a'>gate</td><td class='a'>A sturdy and secure wooden gate</td></tr> <tr><td class='a'>1141</td><td class='a'>Dead Yommi Tree</td><td class='a'>A dead Yommi Tree - it looks like a tough axe will be needed to fell this</td></tr> <tr><td class='a'>1142</td><td class='a'>clawspell</td><td class='a'>forces of guthix</td></tr> <tr><td class='a'>1143</td><td class='a'>Rocks</td><td class='a'>The remains of a large rock</td></tr> <tr><td class='a'>1144</td><td class='a'>crate</td><td class='a'>A crate of some kind</td></tr> <tr><td class='a'>1145</td><td class='a'>Cavernous Opening</td><td class='a'>A dark and mysterious cavern</td></tr> <tr><td class='a'>1146</td><td class='a'>Ancient Lava Furnace</td><td class='a'>A badly damaged furnace fueled by red hot Lava - it looks ancient</td></tr> <tr><td class='a'>1147</td><td class='a'>Spellcharge</td><td class='a'>forces of guthix</td></tr> <tr><td class='a'>1148</td><td class='a'>Rocks</td><td class='a'>A small rocky outcrop</td></tr> <tr><td class='a'>1149</td><td class='a'>cupboard</td><td class='a'>The cupboard is shut</td></tr> <tr><td class='a'>1150</td><td class='a'>sacks</td><td class='a'>Yep they're sacks</td></tr> <tr><td class='a'>1151</td><td class='a'>Rock</td><td class='a'>A rocky outcrop</td></tr> <tr><td class='a'>1152</td><td class='a'>Saradomin stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1153</td><td class='a'>Guthix stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1154</td><td class='a'>Zamorak stone</td><td class='a'>A faith stone</td></tr> <tr><td class='a'>1155</td><td class='a'>Magical pool</td><td class='a'>A cosmic portal</td></tr> <tr><td class='a'>1156</td><td class='a'>Wooden Beam</td><td class='a'>Some sort of support - perhaps used with ropes to lower people over the hole</td></tr> <tr><td class='a'>1157</td><td class='a'>Rope down into darkness</td><td class='a'>A scarey downwards trip into possible doom.</td></tr> <tr><td class='a'>1158</td><td class='a'>Cave entrance</td><td class='a'>A dark cave entrance leading to the surface.</td></tr> <tr><td class='a'>1159</td><td class='a'>Cave entrance</td><td class='a'>A small tunnel that leads to a large room beyond.</td></tr> <tr><td class='a'>1160</td><td class='a'>Ancient Wooden Doors</td><td class='a'>The doors are locked shut</td></tr> <tr><td class='a'>1161</td><td class='a'>Table</td><td class='a'>An old rickety table</td></tr> <tr><td class='a'>1162</td><td class='a'>Crude bed</td><td class='a'>Barely a bed at all</td></tr> <tr><td class='a'>1163</td><td class='a'>Tall Reeds</td><td class='a'>A tall plant with a tube for a stem.</td></tr> <tr><td class='a'>1164</td><td class='a'>Goblin foot prints</td><td class='a'>They seem to be heading south east</td></tr> <tr><td class='a'>1165</td><td class='a'>Dark Metal Gate</td><td class='a'>A dark metalic gate which seems to be fused with the rock</td></tr> <tr><td class='a'>1166</td><td class='a'>Magical pool</td><td class='a'>A cosmic portal</td></tr> <tr><td class='a'>1167</td><td class='a'>Rope Up</td><td class='a'>A welcome rope back up and out of this dark place.</td></tr> <tr><td class='a'>1168</td><td class='a'>Half buried remains</td><td class='a'>Some poor unfortunate soul</td></tr> <tr><td class='a'>1169</td><td class='a'>Totem Pole</td><td class='a'>A carved and decorated totem pole</td></tr> <tr><td class='a'>1170</td><td class='a'>Totem Pole</td><td class='a'>A carved and decorated totem pole</td></tr> <tr><td class='a'>1171</td><td class='a'>Comfy bed</td><td class='a'>Its a bed - wow</td></tr> <tr><td class='a'>1172</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing fully grown Yommi Tree</td></tr> <tr><td class='a'>1173</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing felled Yommi Tree</td></tr> <tr><td class='a'>1174</td><td class='a'>Rotten Yommi Tree</td><td class='a'>A decomposing Yommi Tree Trunk</td></tr> <tr><td class='a'>1175</td><td class='a'>Rotten Totem Pole</td><td class='a'>A decomposing Totem Pole</td></tr> <tr><td class='a'>1176</td><td class='a'>Leafy Palm Tree</td><td class='a'>A shady palm tree</td></tr> <tr><td class='a'>1177</td><td class='a'>Grand Viziers Desk</td><td class='a'>A very elegant desk - you could knock it to get the Grand Viziers attention.</td></tr> <tr><td class='a'>1178</td><td class='a'>Strange Barrel</td><td class='a'>It might have something inside of it.</td></tr> <tr><td class='a'>1179</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1180</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1181</td><td class='a'>ship</td><td class='a'>A sturdy sailing ship</td></tr> <tr><td class='a'>1182</td><td class='a'>digsite bed</td><td class='a'>Not comfortable but useful nonetheless</td></tr> <tr><td class='a'>1183</td><td class='a'>Tea stall</td><td class='a'>A stall selling oriental infusions</td></tr> <tr><td class='a'>1184</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1185</td><td class='a'>Boulder</td><td class='a'>A large boulder blocking the way</td></tr> <tr><td class='a'>1186</td><td class='a'>Damaged Earth</td><td class='a'>Disturbed earth - it will heal itself in time</td></tr> <tr><td class='a'>1187</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading upwards</td></tr> <tr><td class='a'>1188</td><td class='a'>Ladder</td><td class='a'>it's a ladder leading downwards</td></tr> </table> 204 Protocol 0 21 od3m92a1o9gbpqxmhqs9eg9kihcdcue 100 2011-06-20T04:23:41Z Admin 1 Created page with "{{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data'''..." {{Crappy}} This page refers to the RSC #202 client revision (the original distribution by eXemplar) == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 31 // acknowledge logout command from server #define IDO_PING 67 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 132 // add name to ignore list #define IDO_IGNORE_REMOVE 241 // remove name from ignore list #define IDO_FRIENDS_ADD 195 // add name to friends list #define IDO_FRIENDS_REMOVE 167 // remove name from friends list #define IDO_PM_FRIEND 218 // send pm to someone in friends list #define IDO_SEND_CHAT 216 #define IDO_SEND_SERVER_CMD 38 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 64 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 102 #define IDO_CHAR_DESIGN 235 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 45 #define IDO_NEW_PLAYER_ACK 163 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 3 #define IDO_WALKCMD_1 16 #define IDO_WALKCMD_2 187 #define IDO_CLICKDIALOGITEM 116 #define IDO_SETCOMBATSTYLE 29 #define IDO_WITHDRAW 22 #define IDO_DEPOSIT 23 #define IDO_CLOSE_BANK 212 #define IDO_BUYITEM 236 #define IDO_SELLITEM 221 #define IDO_CLOSE_SHOP 166 #define IDO_CANCEL_TRADE 230 #define IDO_CONFIRM_TRADE 104 #define IDO_TRADE_UPDATE 46 #define IDO_ACCEPT_TRADE 55 #define IDO_DUEL_CONFIRM_1 77 #define IDO_DUEL_UPDATE 33 #define IDO_DUEL_FLAG_1 8 #define IDO_DUEL_FLAG_2 176 #define IDO_CANCEL_DUEL 197 #define IDO_PRAYER_OFF 254 #define IDO_PRAYER_ON 60 #define IDO_CHANGE_SETTINGS 111 // action commands... #define IDO_CAST_GR_ITEM 249 #define IDO_USEWITH_GR_ITEM 53 #define IDO_TAKE_ITEM 247 #define IDO_CAST_WALLOBJ 180 #define IDO_USEWITH_WALLOBJ 161 #define IDO_WALLOBJ_CMD1 14 #define IDO_WALLOBJ_CMD2 127 #define IDO_CAST_OBJECT 99 #define IDO_USEWITH_OBJECT 115 #define IDO_OBJECT_CMD1 136 #define IDO_OBJECT_CMD2 79 #define IDO_CAST_INVITEM 4 #define IDO_USEWITH_INVITEM 91 #define IDO_REMOVE_ITEM 170 #define IDO_WEAR_ITEM 169 #define IDO_INVITEM_CMD 90 #define IDO_DROP_ITEM 246 #define IDO_CAST_NPC 50 #define IDO_USEWITH_NPC 135 #define IDO_TALK_NPC 153 #define IDO_NPC_CMD 202 #define IDO_ATTACK_NPC 190 #define IDO_CAST_PLAYER 229 #define IDO_USEWITH_PLAYER 113 #define IDO_ATTACK_PLAYER 171 #define IDO_DUEL_PLAYER 103 #define IDO_TRADE_PLAYER 142 #define IDO_FOLLOW_PLAYER 165 #define IDO_CAST_GROUND 158 #define IDO_CAST_SELF 137 #define IDO_REPORT_ABUSE 206 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 131 // (game) messages from server #define IDI_LOGOUT 4 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 183 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 71 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 149 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 109 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 51 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 120 // someone pm'd us #define IDI_PLAYER_MOVEMENT 191 // player movement update #define IDI_GRITEMS_UPDATE 99 // update ground items #define IDI_OBJECTS_UPDATE 48 #define IDI_INV_LOAD 53 // load inventory #define IDI_PLAYER_UPDATE 234 #define IDI_WALLOBJ_UPDATE 91 #define IDI_NPC_MOVEMENT 79 // npc movement update #define IDI_NPC_UPDATE 104 #define IDI_DIALOG_SHOW 245 #define IDI_DIALOG_CLOSE 252 #define IDI_LOAD_NEWMAPAREA 25 // entering a new region (maparea) #define IDI_XP_LOAD 156 // load xp and stats #define IDI_EQUIP_UPDATE 153 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 83 #define IDI_LOADWORLD 211 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 59 #define IDI_OPEN_TRADE_1 92 #define IDI_CLOSE_TRADE 128 #define IDI_TRADE_UPDATE 97 // opponents offer was updated #define IDI_TRADE_B_UPDATE 162 // update of opponents acception status #define IDI_SHOP_OPEN 101 #define IDI_SHOP_CLOSE 137 #define IDI_TRADE_A_UPDATE 15 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 240 // camera angle, sound, mousebutton settings #define IDI_PRAYER 206 #define IDI_QUESTS 5 #define IDI_BANK_OPEN 42 #define IDI_BANK_CLOSE 203 #define IDI_XP_UPDATE 33 #define IDI_OPEN_DUEL_1 176 #define IDI_CLOSE_DUEL 225 #define IDI_OPEN_TRADE_2 20 // trade confirmation window #define IDI_DUEL_UPDATE 6 // opponents offer was updated #define IDI_DUELOPT_UPDATE 30 // update duel options #define IDI_BANK_UPDATE 249 #define IDI_INV_ADD 90 #define IDI_INV_REMOVE 123 #define IDI_STAT_UPDATE 159 #define IDI_DUEL_B_UPDATE 253 // update of opponents acception status #define IDI_DUEL_A_UPDATE 210 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 172 // duel confirmation window #define IDI_SOUND 204 #define IDI_SPLASH 36 #define IDI_WELCOMEWINDOW 182 #define IDI_MESSAGE_1 89 #define IDI_MESSAGE_2 222 #define IDI_FATIGUE_UPDATE 114 #define IDI_NEW_SLEEPWORD 117 #define IDI_FATIGUE_SLEEPN 244 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 84 #define IDI_SLEEP_FAILED 194 #define IDI_SYSTEM_UPDATE 52 #define IDX_ACCOUNT_STOLEN 18 // "Account suspected stolen.", "Press 'recover a locked account' on front page." #define IDX_ACCOUNT_NOT_RSC 21 // "Unable to login.", "That is not an RS-Classic account" #define IDX_PASSWD_STOLEN 22 // "Password suspected stolen.", "Press 'change your password' on front page." </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 101 2011-06-20T04:24:35Z Admin 1 {{Crappy}} This page refers to the RSC #204 client revision, all of the opcodes are the same with the exception of the last three in the Outgoing Data section. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 31 // acknowledge logout command from server #define IDO_PING 67 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 132 // add name to ignore list #define IDO_IGNORE_REMOVE 241 // remove name from ignore list #define IDO_FRIENDS_ADD 195 // add name to friends list #define IDO_FRIENDS_REMOVE 167 // remove name from friends list #define IDO_PM_FRIEND 218 // send pm to someone in friends list #define IDO_SEND_CHAT 216 #define IDO_SEND_SERVER_CMD 38 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 64 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 102 #define IDO_CHAR_DESIGN 235 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 45 #define IDO_NEW_PLAYER_ACK 163 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 3 #define IDO_WALKCMD_1 16 #define IDO_WALKCMD_2 187 #define IDO_CLICKDIALOGITEM 116 #define IDO_SETCOMBATSTYLE 29 #define IDO_WITHDRAW 22 #define IDO_DEPOSIT 23 #define IDO_CLOSE_BANK 212 #define IDO_BUYITEM 236 #define IDO_SELLITEM 221 #define IDO_CLOSE_SHOP 166 #define IDO_CANCEL_TRADE 230 #define IDO_CONFIRM_TRADE 104 #define IDO_TRADE_UPDATE 46 #define IDO_ACCEPT_TRADE 55 #define IDO_DUEL_CONFIRM_1 77 #define IDO_DUEL_UPDATE 33 #define IDO_DUEL_FLAG_1 8 #define IDO_DUEL_FLAG_2 176 #define IDO_CANCEL_DUEL 197 #define IDO_PRAYER_OFF 254 #define IDO_PRAYER_ON 60 #define IDO_CHANGE_SETTINGS 111 // action commands... #define IDO_CAST_GR_ITEM 249 #define IDO_USEWITH_GR_ITEM 53 #define IDO_TAKE_ITEM 247 #define IDO_CAST_WALLOBJ 180 #define IDO_USEWITH_WALLOBJ 161 #define IDO_WALLOBJ_CMD1 14 #define IDO_WALLOBJ_CMD2 127 #define IDO_CAST_OBJECT 99 #define IDO_USEWITH_OBJECT 115 #define IDO_OBJECT_CMD1 136 #define IDO_OBJECT_CMD2 79 #define IDO_CAST_INVITEM 4 #define IDO_USEWITH_INVITEM 91 #define IDO_REMOVE_ITEM 170 #define IDO_WEAR_ITEM 169 #define IDO_INVITEM_CMD 90 #define IDO_DROP_ITEM 246 #define IDO_CAST_NPC 50 #define IDO_USEWITH_NPC 135 #define IDO_TALK_NPC 153 #define IDO_NPC_CMD 202 #define IDO_ATTACK_NPC 190 #define IDO_CAST_PLAYER 229 #define IDO_USEWITH_PLAYER 113 #define IDO_ATTACK_PLAYER 171 #define IDO_DUEL_PLAYER 103 #define IDO_TRADE_PLAYER 142 #define IDO_FOLLOW_PLAYER 165 #define IDO_CAST_GROUND 158 #define IDO_CAST_SELF 137 #define IDO_REPORT_ABUSE 206 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 131 // (game) messages from server #define IDI_LOGOUT 4 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 183 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 71 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 149 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 109 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 51 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 120 // someone pm'd us #define IDI_PLAYER_MOVEMENT 191 // player movement update #define IDI_GRITEMS_UPDATE 99 // update ground items #define IDI_OBJECTS_UPDATE 48 #define IDI_INV_LOAD 53 // load inventory #define IDI_PLAYER_UPDATE 234 #define IDI_WALLOBJ_UPDATE 91 #define IDI_NPC_MOVEMENT 79 // npc movement update #define IDI_NPC_UPDATE 104 #define IDI_DIALOG_SHOW 245 #define IDI_DIALOG_CLOSE 252 #define IDI_LOAD_NEWMAPAREA 25 // entering a new region (maparea) #define IDI_XP_LOAD 156 // load xp and stats #define IDI_EQUIP_UPDATE 153 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 83 #define IDI_LOADWORLD 211 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 59 #define IDI_OPEN_TRADE_1 92 #define IDI_CLOSE_TRADE 128 #define IDI_TRADE_UPDATE 97 // opponents offer was updated #define IDI_TRADE_B_UPDATE 162 // update of opponents acception status #define IDI_SHOP_OPEN 101 #define IDI_SHOP_CLOSE 137 #define IDI_TRADE_A_UPDATE 15 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 240 // camera angle, sound, mousebutton settings #define IDI_PRAYER 206 #define IDI_QUESTS 5 #define IDI_BANK_OPEN 42 #define IDI_BANK_CLOSE 203 #define IDI_XP_UPDATE 33 #define IDI_OPEN_DUEL_1 176 #define IDI_CLOSE_DUEL 225 #define IDI_OPEN_TRADE_2 20 // trade confirmation window #define IDI_DUEL_UPDATE 6 // opponents offer was updated #define IDI_DUELOPT_UPDATE 30 // update duel options #define IDI_BANK_UPDATE 249 #define IDI_INV_ADD 90 #define IDI_INV_REMOVE 123 #define IDI_STAT_UPDATE 159 #define IDI_DUEL_B_UPDATE 253 // update of opponents acception status #define IDI_DUEL_A_UPDATE 210 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 172 // duel confirmation window #define IDI_SOUND 204 #define IDI_SPLASH 36 #define IDI_WELCOMEWINDOW 182 #define IDI_MESSAGE_1 89 #define IDI_MESSAGE_2 222 #define IDI_FATIGUE_UPDATE 114 #define IDI_NEW_SLEEPWORD 117 #define IDI_FATIGUE_SLEEPN 244 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 84 #define IDI_SLEEP_FAILED 194 #define IDI_SYSTEM_UPDATE 52 #define IDX_ACCOUNT_STOLEN 18 // "Account suspected stolen.", "Press 'recover a locked account' on front page." #define IDX_ACCOUNT_NOT_RSC 21 // "Unable to login.", "That is not an RS-Classic account" #define IDX_PASSWD_STOLEN 22 // "Password suspected stolen.", "Press 'change your password' on front page." </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 124 2011-06-20T04:54:39Z Admin 1 [[Category:RSC]] This page refers to the RSC #204 client revision, all of the opcodes are the same with the exception of the last three in the Outgoing Data section. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <pre> #define IDX_WEIRD_USERNAME 32 #define IDX_LOGIN 0 #define IDO_LOGOUT_ACK 31 // acknowledge logout command from server #define IDO_PING 67 // send ping to server, so it knows we're still there #define IDO_IGNORE_ADD 132 // add name to ignore list #define IDO_IGNORE_REMOVE 241 // remove name from ignore list #define IDO_FRIENDS_ADD 195 // add name to friends list #define IDO_FRIENDS_REMOVE 167 // remove name from friends list #define IDO_PM_FRIEND 218 // send pm to someone in friends list #define IDO_SEND_CHAT 216 #define IDO_SEND_SERVER_CMD 38 // sends a command to the server (type "::xxx" in chat and it sends command 'xxx') #define IDO_UPDATE_SETTINGS 64 // changes settings (chatblock, privateblock, tradeblock, duelblock) #define IDO_LOGOUT 102 #define IDO_CHAR_DESIGN 235 // send character design (makeover mage, creation) #define IDO_SLEEPWORD 45 #define IDO_NEW_PLAYER_ACK 163 // send ids of newly added player back to server, if it wants to #define IDO_EXCEPTION_SEND 3 #define IDO_WALKCMD_1 16 #define IDO_WALKCMD_2 187 #define IDO_CLICKDIALOGITEM 116 #define IDO_SETCOMBATSTYLE 29 #define IDO_WITHDRAW 22 #define IDO_DEPOSIT 23 #define IDO_CLOSE_BANK 212 #define IDO_BUYITEM 236 #define IDO_SELLITEM 221 #define IDO_CLOSE_SHOP 166 #define IDO_CANCEL_TRADE 230 #define IDO_CONFIRM_TRADE 104 #define IDO_TRADE_UPDATE 46 #define IDO_ACCEPT_TRADE 55 #define IDO_DUEL_CONFIRM_1 77 #define IDO_DUEL_UPDATE 33 #define IDO_DUEL_FLAG_1 8 #define IDO_DUEL_FLAG_2 176 #define IDO_CANCEL_DUEL 197 #define IDO_PRAYER_OFF 254 #define IDO_PRAYER_ON 60 #define IDO_CHANGE_SETTINGS 111 // action commands... #define IDO_CAST_GR_ITEM 249 #define IDO_USEWITH_GR_ITEM 53 #define IDO_TAKE_ITEM 247 #define IDO_CAST_WALLOBJ 180 #define IDO_USEWITH_WALLOBJ 161 #define IDO_WALLOBJ_CMD1 14 #define IDO_WALLOBJ_CMD2 127 #define IDO_CAST_OBJECT 99 #define IDO_USEWITH_OBJECT 115 #define IDO_OBJECT_CMD1 136 #define IDO_OBJECT_CMD2 79 #define IDO_CAST_INVITEM 4 #define IDO_USEWITH_INVITEM 91 #define IDO_REMOVE_ITEM 170 #define IDO_WEAR_ITEM 169 #define IDO_INVITEM_CMD 90 #define IDO_DROP_ITEM 246 #define IDO_CAST_NPC 50 #define IDO_USEWITH_NPC 135 #define IDO_TALK_NPC 153 #define IDO_NPC_CMD 202 #define IDO_ATTACK_NPC 190 #define IDO_CAST_PLAYER 229 #define IDO_USEWITH_PLAYER 113 #define IDO_ATTACK_PLAYER 171 #define IDO_DUEL_PLAYER 103 #define IDO_TRADE_PLAYER 142 #define IDO_FOLLOW_PLAYER 165 #define IDO_CAST_GROUND 158 #define IDO_CAST_SELF 137 #define IDO_REPORT_ABUSE 206 </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <pre> // login responses... #define IDX_MOD_ACCEPTED 25 // logged in as player mod #define IDX_LOGIN_SUCCESS 0 #define IDX_RELOGIN_SUCCESS 1 // connection reestablished after lost connection... #define IDX_WRONG_PWD 3 #define IDX_NAME_LOGGED_IN 4 #define IDX_CLIENT_UPDATED 5 #define IDX_IP_IN_USE 6 #define IDX_LOGINS_EXCEEDED 7 #define IDX_SERV_REJECTED 8 #define IDX_LOGINSERV_REJCT 9 #define IDX_NAME_IN_USE 10 #define IDX_TEMP_DISABLED 11 #define IDX_PERM_DISABLED 12 #define IDX_SERVER_FULL 14 #define IDX_MEMBERACC_REQ 15 // requires member account to login here #define IDX_LOGINSERV_DOWN 16 #define IDX_DECODE_FAIL 17 #define IDX_LOGIN_MISMATCH 20 #define IDI_MESSAGE 131 // (game) messages from server #define IDI_LOGOUT 4 // logout command from server (forced, or initiated by client IDO_LOGOUT) #define IDI_LOGOUT_REJECT 183 // not allowed to log out (e.g. when in combat) #define IDI_FRIENDS_LOAD 71 // when logging in, sends the whole friends list to the client #define IDI_FRIEND_LOGGED 149 // a friend from friends list logged in or out (also used to add a friend to friends list) #define IDI_IGNORE_LOAD 109 // when logging in, sends the whole ignore list to the client #define IDI_SETTINGS_LOAD 51 // load settings upon logging in (blocks) #define IDI_FRIENDS_PM 120 // someone pm'd us #define IDI_PLAYER_MOVEMENT 191 // player movement update #define IDI_GRITEMS_UPDATE 99 // update ground items #define IDI_OBJECTS_UPDATE 48 #define IDI_INV_LOAD 53 // load inventory #define IDI_PLAYER_UPDATE 234 #define IDI_WALLOBJ_UPDATE 91 #define IDI_NPC_MOVEMENT 79 // npc movement update #define IDI_NPC_UPDATE 104 #define IDI_DIALOG_SHOW 245 #define IDI_DIALOG_CLOSE 252 #define IDI_LOAD_NEWMAPAREA 25 // entering a new region (maparea) #define IDI_XP_LOAD 156 // load xp and stats #define IDI_EQUIP_UPDATE 153 // equipment stats (armour, magic, prayer, weapaim/power) #define IDI_PLAYER_DIED 83 #define IDI_LOADWORLD 211 // load objects, wallobjects, items #define IDI_DESIGN_CHAR 59 #define IDI_OPEN_TRADE_1 92 #define IDI_CLOSE_TRADE 128 #define IDI_TRADE_UPDATE 97 // opponents offer was updated #define IDI_TRADE_B_UPDATE 162 // update of opponents acception status #define IDI_SHOP_OPEN 101 #define IDI_SHOP_CLOSE 137 #define IDI_TRADE_A_UPDATE 15 // update of thisplayers acception status #define IDI_LOAD_OPTIONS 240 // camera angle, sound, mousebutton settings #define IDI_PRAYER 206 #define IDI_QUESTS 5 #define IDI_BANK_OPEN 42 #define IDI_BANK_CLOSE 203 #define IDI_XP_UPDATE 33 #define IDI_OPEN_DUEL_1 176 #define IDI_CLOSE_DUEL 225 #define IDI_OPEN_TRADE_2 20 // trade confirmation window #define IDI_DUEL_UPDATE 6 // opponents offer was updated #define IDI_DUELOPT_UPDATE 30 // update duel options #define IDI_BANK_UPDATE 249 #define IDI_INV_ADD 90 #define IDI_INV_REMOVE 123 #define IDI_STAT_UPDATE 159 #define IDI_DUEL_B_UPDATE 253 // update of opponents acception status #define IDI_DUEL_A_UPDATE 210 // update of thisplayers acception status #define IDI_OPEN_DUEL_2 172 // duel confirmation window #define IDI_SOUND 204 #define IDI_SPLASH 36 #define IDI_WELCOMEWINDOW 182 #define IDI_MESSAGE_1 89 #define IDI_MESSAGE_2 222 #define IDI_FATIGUE_UPDATE 114 #define IDI_NEW_SLEEPWORD 117 #define IDI_FATIGUE_SLEEPN 244 // fatigue update in sleeping window #define IDI_SLEEP_SUCCESS 84 #define IDI_SLEEP_FAILED 194 #define IDI_SYSTEM_UPDATE 52 #define IDX_ACCOUNT_STOLEN 18 // "Account suspected stolen.", "Press 'recover a locked account' on front page." #define IDX_ACCOUNT_NOT_RSC 21 // "Unable to login.", "That is not an RS-Classic account" #define IDX_PASSWD_STOLEN 22 // "Password suspected stolen.", "Press 'change your password' on front page." </pre> <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> OB3 0 222 m4b55gy9v6he8wpvze7m6ct2dtjvtcy 760 2012-11-23T19:26:03Z .S. 122 Created page with "[[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. [Unsigned Short] v..." [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. [Unsigned Short] vertex_count [Unsigned Short] face_count for (int i = 0; i < vertex_count; i++) [Signed Short] vert_x for (int i = 0; i < vertex_count; i++) [Signed Short] vert_z for (int i = 0; i < vertex_count; i++) [Signed Short] vert_y for (int i = 0; i < face_count; i++) [Unsigned Byte] face_vert_count for (int i = 0; i < face_count; i++) [Signed Short] face_back for (int i = 0; i < face_count; i++) [Signed Short] face_front for (int i = 0; i < face_count; i++) [Unsigned Byte] Unknown boolean, something to do with shading. for (int i = 0; i < face_count; i++) { for (int j = 0; j < face_vert_count[i]; j++) { if (vertex_count < 256) [Unsigned Byte] Unknown else [Unsigned Short] Unknown } } == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 763 2012-11-25T17:38:43Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. [Unsigned Short] vertex_count [Unsigned Short] face_count for (int i = 0; i < vertex_count; i++) [Signed Short] vert_x for (int i = 0; i < vertex_count; i++) [Signed Short] vert_z for (int i = 0; i < vertex_count; i++) [Signed Short] vert_y for (int i = 0; i < face_count; i++) [Unsigned Byte] face_vert_count for (int i = 0; i < face_count; i++) [Signed Short] face_back for (int i = 0; i < face_count; i++) [Signed Short] face_front for (int i = 0; i < face_count; i++) [Unsigned Byte] Boolean. Gourad shading? for (int i = 0; i < face_count; i++) { for (int j = 0; j < face_vert_count[i]; j++) { if (vertex_count < 256) [Unsigned Byte] Unknown else [Unsigned Short] Unknown } } == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 764 2012-11-25T18:36:07Z Protocol 120 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre> import util.Data; public class Ob3Model { public int faceCount; public int vertexCount; public int faceVertexCount[]; public int faceBack[]; public int faceFront[]; public int verticesX[]; public int verticesZ[]; public int verticesY[]; private static final int trigger = 0xbc614e; public Ob3Model(byte data[], int position) { int vertexCount = Data.readInt16(data, position); position += 2; int faceCount = Data.readInt16(data, position); position += 2; verticesX = new int[vertexCount]; verticesY = new int[vertexCount]; verticesZ = new int[vertexCount]; faceBack = new int[faceCount]; faceFront = new int[faceCount]; faceVertexCount = new int[faceCount]; for (int i = 0; i < vertexCount; i++) { verticesX[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < vertexCount; i++) { verticesZ[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < vertexCount; i++) { verticesY[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < faceCount; i++) faceVertexCount[i] = data[position++] & 0xff; for (int i = 0; i < faceCount; i++) { faceBack[i] = Data.readSignedInt16(data, position); position += 2; if (faceBack[i] == 32767) faceBack[i] = trigger; } for (int i = 0; i < faceCount; i++) { faceFront[i] = Data.readSignedInt16(data, position); position += 2; if (faceFront[i] == 32767) faceFront[i] = trigger; } position += faceCount - 1; for (int i = 0; i < faceCount; i++) { for (int j = 0; j < faceVertexCount[i]; j++) { if (vertexCount < 256) { position++; } else { Data.readInt16(data, position); position += 2; } } } this.vertexCount = vertexCount; this.faceCount = faceCount; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 765 2012-11-25T18:36:22Z Protocol 120 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre> import util.Data; public class Ob3Model { public int faceCount; public int vertexCount; public int faceVertexCount[]; public int faceBack[]; public int faceFront[]; public int verticesX[]; public int verticesZ[]; public int verticesY[]; private static final int trigger = 0xbc614e; public Ob3Model(byte data[], int position) { int vertexCount = Data.readInt16(data, position); position += 2; int faceCount = Data.readInt16(data, position); position += 2; verticesX = new int[vertexCount]; verticesY = new int[vertexCount]; verticesZ = new int[vertexCount]; faceBack = new int[faceCount]; faceFront = new int[faceCount]; faceVertexCount = new int[faceCount]; for (int i = 0; i < vertexCount; i++) { verticesX[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < vertexCount; i++) { verticesZ[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < vertexCount; i++) { verticesY[i] = Data.readSignedInt16(data, position); position += 2; } for (int i = 0; i < faceCount; i++) faceVertexCount[i] = data[position++] & 0xff; for (int i = 0; i < faceCount; i++) { faceBack[i] = Data.readSignedInt16(data, position); position += 2; if (faceBack[i] == 32767) faceBack[i] = trigger; } for (int i = 0; i < faceCount; i++) { faceFront[i] = Data.readSignedInt16(data, position); position += 2; if (faceFront[i] == 32767) faceFront[i] = trigger; } position += faceCount - 1; for (int i = 0; i < faceCount; i++) { for (int j = 0; j < faceVertexCount[i]; j++) { if (vertexCount < 256) { position++; } else { Data.readInt16(data, position); position += 2; } } } this.vertexCount = vertexCount; this.faceCount = faceCount; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 766 2012-11-25T18:38:45Z Protocol 120 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre> [Unsigned Short] vertex_count [Unsigned Short] face_count for (int i = 0; i < vertex_count; i++) [Signed Short] vert_x for (int i = 0; i < vertex_count; i++) [Signed Short] vert_z for (int i = 0; i < vertex_count; i++) [Signed Short] vert_y for (int i = 0; i < face_count; i++) [Unsigned Byte] face_vert_count for (int i = 0; i < face_count; i++) [Signed Short] face_back for (int i = 0; i < face_count; i++) [Signed Short] face_front for (int i = 0; i < face_count; i++) [Unsigned Byte] Boolean. Gourad shading? for (int i = 0; i < face_count; i++) { for (int j = 0; j < face_vert_count[i]; j++) { if (vertex_count < 256) [Unsigned Byte] Unknown else [Unsigned Short] Unknown } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 767 2012-11-25T18:40:07Z Protocol 120 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre> [Unsigned Short] vertex_count [Unsigned Short] face_count for (int i = 0; i < vertex_count; i++) [Signed Short] vert_x for (int i = 0; i < vertex_count; i++) [Signed Short] vert_z for (int i = 0; i < vertex_count; i++) [Signed Short] vert_y for (int i = 0; i < face_count; i++) [Unsigned Byte] face_vert_count for (int i = 0; i < face_count; i++) [Signed Short] face_back for (int i = 0; i < face_count; i++) [Signed Short] face_front for (int i = 0; i < face_count; i++) [Unsigned Byte] Boolean. Gourad shading? for (int i = 0; i < face_count; i++) { for (int j = 0; j < face_vert_count[i]; j++) { if (vertex_count < 256) [Unsigned Byte] Unknown else [Unsigned Short] Unknown } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. == '''Shading''' == The hex value '''0xbc614e''' (or 12345678 in decimal) is believed to be used as a trigger for Gouraud shading. 768 2012-11-25T18:40:21Z Protocol 120 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre> [Unsigned Short] vertex_count [Unsigned Short] face_count for (int i = 0; i < vertex_count; i++) [Signed Short] vert_x for (int i = 0; i < vertex_count; i++) [Signed Short] vert_z for (int i = 0; i < vertex_count; i++) [Signed Short] vert_y for (int i = 0; i < face_count; i++) [Unsigned Byte] face_vert_count for (int i = 0; i < face_count; i++) [Signed Short] face_back for (int i = 0; i < face_count; i++) [Signed Short] face_front for (int i = 0; i < face_count; i++) [Unsigned Byte] Boolean. Gourad shading? for (int i = 0; i < face_count; i++) { for (int j = 0; j < face_vert_count[i]; j++) { if (vertex_count < 256) [Unsigned Byte] Unknown else [Unsigned Short] Unknown } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. == '''Shading''' == The hex value '''0xbc614e''' (or '''12345678''' in decimal) is believed to be used as a trigger for Gouraud shading. 769 2012-11-25T18:43:36Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_z[]; public int vert_y[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. 770 2012-11-25T18:47:29Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_z[]; public int vert_y[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's sprite array. 771 2012-11-25T21:09:23Z .S. 122 irc argument about what depth is [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's sprite array. 772 2012-11-25T21:30:51Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. 773 2012-11-25T22:08:28Z Vortex 126 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since version #74. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. 774 2012-11-25T22:08:38Z Vortex 126 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. 775 2012-11-25T22:19:57Z Vortex 126 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Face sides''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. 776 2012-11-26T15:07:36Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face values are one less than the OBJ face values. 777 2012-11-26T15:36:07Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>package jagex.client; import jagex.Data; public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = Data.getUnsignedShort(data, offset); offset += 2; int face_count = Data.getUnsignedShort(data, offset); offset += 2; vert_x = new int[vert_count]; vert_y = new int[vert_count]; vert_z = new int[vert_count]; face_v_count = new int[face_count]; faces = new int[face_count][]; face_back = new int[face_count]; face_front = new int[face_count]; gouraud_shade = new int[face_count]; for (int v = 0; v < vert_count; v++) { vert_x[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = Data.getSignedShort(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = Data.getSignedShort(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = (data[offset++] & 0xff); for (int f = 0; f < face_count; f++) { face_back[f] = Data.getSignedShort(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = Data.getSignedShort(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = data[offset++] & 0xff; if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face[f][fv] = data[offset++] & 0xff; } else { face[f][fv] = Data.getUnsignedShort(data, offset); offset += 2; } } } this.face_count = face_count; } }</pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face values are one less than the OBJ face values. 779 2012-11-26T21:37:35Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int faces[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = get_u_short(data, offset); offset += 2; int face_count = get_u_short(data, offset); offset += 2; vert_x = new int[vert_count]; vert_y = new int[vert_count]; vert_z = new int[vert_count]; face_v_count = new int[face_count]; faces = new int[face_count][]; face_back = new int[face_count]; face_front = new int[face_count]; gouraud_shade = new int[face_count]; for (int v = 0; v < vert_count; v++) { vert_x[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = get_short(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = get_u_byte(data[offset++]); for (int f = 0; f < face_count; f++) { face_back[f] = get_short(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = get_short(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_u_byte(data[offset++]); if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { faces[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { faces[f][fv] = get_u_byte(data[offset++]); } else { faces[f][fv] = get_u_short(data, offset); offset += 2; } } } this.face_count = face_count; } public static int get_u_byte(byte b) { return (b & 0xff); } public static int get_u_short(byte b[], int start) { return ((b[start] & 0xff) << 8) + (b[start + 1] & 0xff); } public static int get_short(byte b[], int start) { int i = get_u_byte(b[start]) * 256 + get_u_byte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face values are one less than the OBJ face values. 785 2012-12-05T11:52:15Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face_v[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = get_u_short(data, offset); offset += 2; int face_count = get_u_short(data, offset); offset += 2; vert_x = new int[vert_count]; vert_y = new int[vert_count]; vert_z = new int[vert_count]; face_v_count = new int[face_count]; faces = new int[face_count][]; face_back = new int[face_count]; face_front = new int[face_count]; gouraud_shade = new int[face_count]; for (int v = 0; v < vert_count; v++) { vert_x[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = get_short(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = get_u_byte(data[offset++]); for (int f = 0; f < face_count; f++) { face_back[f] = get_short(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = get_short(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_u_byte(data[offset++]); if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_v[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face_v[f][fv] = get_u_byte(data[offset++]); } else { face_v[f][fv] = get_u_short(data, offset); offset += 2; } } } this.face_count = face_count; } public static int get_u_byte(byte b) { return (b & 0xff); } public static int get_u_short(byte b[], int start) { return ((b[start] & 0xff) << 8) + (b[start + 1] & 0xff); } public static int get_short(byte b[], int start) { int i = get_u_byte(b[start]) * 256 + get_u_byte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face values are one less than the OBJ face values. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> 786 2012-12-05T12:07:54Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face_v[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = get_u_short(data, offset); offset += 2; int face_count = get_u_short(data, offset); offset += 2; vert_x = new int[vert_count]; vert_y = new int[vert_count]; vert_z = new int[vert_count]; face_v_count = new int[face_count]; faces = new int[face_count][]; face_back = new int[face_count]; face_front = new int[face_count]; gouraud_shade = new int[face_count]; for (int v = 0; v < vert_count; v++) { vert_x[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = get_short(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = get_u_byte(data[offset++]); for (int f = 0; f < face_count; f++) { face_back[f] = get_short(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = get_short(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_u_byte(data[offset++]); if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_v[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face_v[f][fv] = get_u_byte(data[offset++]); } else { face_v[f][fv] = get_u_short(data, offset); offset += 2; } } } this.face_count = face_count; } public static int get_u_byte(byte b) { return (b & 0xff); } public static int get_u_short(byte b[], int start) { return ((b[start] & 0xff) << 8) + (b[start + 1] & 0xff); } public static int get_short(byte b[], int start) { int i = get_u_byte(b[start]) * 256 + get_u_byte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face vertices are one less than the OBJ face vertices. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> 787 2012-12-10T23:49:56Z .S. 122 [[Category:RSC]] Work in progress. This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int gouraud_shade[]; public int vert_count; public int vert_x[]; public int vert_y[]; public int vert_z[]; public int face_count; public int face_v_count[]; public int face_v[][]; public int face_back[]; public int face_front[]; public OB3Model(byte data[], int offset) { int vert_count = get_u_short(data, offset); offset += 2; int face_count = get_u_short(data, offset); offset += 2; vert_x = new int[vert_count]; vert_y = new int[vert_count]; vert_z = new int[vert_count]; face_v_count = new int[face_count]; faces = new int[face_count][]; face_back = new int[face_count]; face_front = new int[face_count]; gouraud_shade = new int[face_count]; for (int v = 0; v < vert_count; v++) { vert_x[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_y[v] = get_short(data, offset); offset += 2; } for (int v = 0; v < vert_count; v++) { vert_z[v] = get_short(data, offset); offset += 2; } this.vert_count = vert_count; for (int f = 0; f < face_count; f++) face_v_count[f] = get_u_byte(data[offset++]); for (int f = 0; f < face_count; f++) { face_back[f] = get_short(data, offset); offset += 2; if (face_back[f] == 32767) face_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_front[f] = get_short(data, offset); offset += 2; if (face_front[f] == 32767) face_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_u_byte(data[offset++]); if (i == 0) gouraud_shade[f] = 0; else gouraud_shade[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_v[f] = new int[face_v_count[f]]; for (int fv = 0; fv < face_v_count[f]; fv++) { if (vert_count < 256) { face_v[f][fv] = get_u_byte(data[offset++]); } else { face_v[f][fv] = get_u_short(data, offset); offset += 2; } } } this.face_count = face_count; } public static int get_u_byte(byte b) { return (b & 0xff); } public static int get_u_short(byte b[], int start) { return ((b[start] & 0xff) << 8) + (b[start + 1] & 0xff); } public static int get_short(byte b[], int start) { int i = get_u_byte(b[start]) * 256 + get_u_byte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face vertices are one less than the OBJ face vertices. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> <pre>public static final int encode_colour(int r, int g, int b) { return -1 - (r / 8) * 1024 - (g / 8) * 32 - b / 8; } </pre> 791 2012-12-22T12:44:19Z .S. 122 cleaning this up since i'll never touch it again [[Category:RSC]] This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int vertex_count; public int vertices_x[]; public int vertices_y[]; public int vertices_z[]; public int face_count; public int face_vertex_count[]; public int face_vertices[][]; public int face_fill_back[]; public int face_fill_front[]; public int face_gouraud[]; public OB3Model(byte data[], int offset) { int vertex_count = get_uint16(data, offset); offset += 2; int face_count = get_uint16(data, offset); offset += 2; vertices_x = new int[vertex_count]; vertices_y = new int[vertex_count]; vertices_z = new int[vertex_count]; face_vertex_count = new int[face_count]; face_vertices = new int[face_count][]; face_fill_back = new int[face_count]; face_fill_front = new int[face_count]; face_gouraud = new int[face_count]; for (int v = 0; v < vertex_count; v++) { vertices_x[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_y[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_z[v] = get_int16b(data, offset); offset += 2; } this.vertex_count = vertex_count; for (int f = 0; f < face_count; f++) face_vertex_count[f] = get_ubyte(data[offset++]); for (int f = 0; f < face_count; f++) { face_fill_back[f] = get_int16b(data, offset); offset += 2; if (face_fill_back[f] == 32767) face_fill_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_fill_front[f] = get_int16b(data, offset); offset += 2; if (face_fill_front[f] == 32767) face_fill_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_ubyte(data[offset++]); if (i == 0) face_gouraud[f] = 0; else face_gouraud[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_vertices[f] = new int[face_vertex_count[f]]; for (int fv = 0; fv < face_vertex_count[f]; fv++) { if (vertex_count < 256) { face_vertices[f][fv] = get_ubyte(data[offset++]); } else { face_vertices[f][fv] = get_uint16(data, offset); offset += 2; } } } this.face_count = face_count; } private static int get_ubyte(byte b) { return (b & 0xff); } private static int get_uint16(byte b[], int start) { return (get_ubyte(b[start]) << 8) + get_ubyte(b[start + 1]); } private static int get_int16b(byte b[], int start) { int i = get_ubyte(b[start]) * 256 + get_ubyte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_back or face_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face vertices are one less than the OBJ face vertices. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> <pre>public static int encode_colour(int r, int g, int b) { return -1 - (r / 8) * 1024 - (g / 8) * 32 - b / 8; } </pre> 793 2012-12-22T12:59:29Z .S. 122 [[Category:RSC]] This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; public int vertex_count; public int vertices_x[]; public int vertices_y[]; public int vertices_z[]; public int face_count; public int face_vertex_count[]; public int face_vertices[][]; public int face_fill_back[]; public int face_fill_front[]; public int face_gouraud[]; public OB3Model(byte data[], int offset) { int vertex_count = get_uint16(data, offset); offset += 2; int face_count = get_uint16(data, offset); offset += 2; vertices_x = new int[vertex_count]; vertices_y = new int[vertex_count]; vertices_z = new int[vertex_count]; face_vertex_count = new int[face_count]; face_vertices = new int[face_count][]; face_fill_back = new int[face_count]; face_fill_front = new int[face_count]; face_gouraud = new int[face_count]; for (int v = 0; v < vertex_count; v++) { vertices_x[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_y[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_z[v] = get_int16b(data, offset); offset += 2; } this.vertex_count = vertex_count; for (int f = 0; f < face_count; f++) face_vertex_count[f] = get_ubyte(data[offset++]); for (int f = 0; f < face_count; f++) { face_fill_back[f] = get_int16b(data, offset); offset += 2; if (face_fill_back[f] == 32767) face_fill_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_fill_front[f] = get_int16b(data, offset); offset += 2; if (face_fill_front[f] == 32767) face_fill_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_ubyte(data[offset++]); if (i == 0) face_gouraud[f] = 0; else face_gouraud[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_vertices[f] = new int[face_vertex_count[f]]; for (int fv = 0; fv < face_vertex_count[f]; fv++) { if (vertex_count < 256) { face_vertices[f][fv] = get_ubyte(data[offset++]); } else { face_vertices[f][fv] = get_uint16(data, offset); offset += 2; } } } this.face_count = face_count; } private static int get_ubyte(byte b) { return (b & 0xff); } private static int get_uint16(byte b[], int start) { return (get_ubyte(b[start]) << 8) + get_ubyte(b[start + 1]); } private static int get_int16b(byte b[], int start) { int i = get_ubyte(b[start]) * 256 + get_ubyte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_fill_back or face_fill_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face vertices are one less than the OBJ face vertices. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> <pre>public static int encode_colour(int r, int g, int b) { return -1 - (r / 8) * 1024 - (g / 8) * 32 - b / 8; } </pre> 794 2012-12-22T12:59:55Z .S. 122 [[Category:RSC]] This page refers to .ob3, a custom format for 3D models created by Jagex. It is used by the RuneScape Classic engine since client version #74. For the earlier version of the format see [[OB2|OB2]]. <pre>public class OB3Model { private static final int num_seq = 0xbc614e; // 12345678 public int vertex_count; public int vertices_x[]; public int vertices_y[]; public int vertices_z[]; public int face_count; public int face_vertex_count[]; public int face_vertices[][]; public int face_fill_back[]; public int face_fill_front[]; public int face_gouraud[]; public OB3Model(byte data[], int offset) { int vertex_count = get_uint16(data, offset); offset += 2; int face_count = get_uint16(data, offset); offset += 2; vertices_x = new int[vertex_count]; vertices_y = new int[vertex_count]; vertices_z = new int[vertex_count]; face_vertex_count = new int[face_count]; face_vertices = new int[face_count][]; face_fill_back = new int[face_count]; face_fill_front = new int[face_count]; face_gouraud = new int[face_count]; for (int v = 0; v < vertex_count; v++) { vertices_x[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_y[v] = get_int16b(data, offset); offset += 2; } for (int v = 0; v < vertex_count; v++) { vertices_z[v] = get_int16b(data, offset); offset += 2; } this.vertex_count = vertex_count; for (int f = 0; f < face_count; f++) face_vertex_count[f] = get_ubyte(data[offset++]); for (int f = 0; f < face_count; f++) { face_fill_back[f] = get_int16b(data, offset); offset += 2; if (face_fill_back[f] == 32767) face_fill_back[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_fill_front[f] = get_int16b(data, offset); offset += 2; if (face_fill_front[f] == 32767) face_fill_front[f] = num_seq; } for (int f = 0; f < face_count; f++) { int i = get_ubyte(data[offset++]); if (i == 0) face_gouraud[f] = 0; else face_gouraud[f] = num_seq; } for (int f = 0; f < face_count; f++) { face_vertices[f] = new int[face_vertex_count[f]]; for (int fv = 0; fv < face_vertex_count[f]; fv++) { if (vertex_count < 256) { face_vertices[f][fv] = get_ubyte(data[offset++]); } else { face_vertices[f][fv] = get_uint16(data, offset); offset += 2; } } } this.face_count = face_count; } private static int get_ubyte(byte b) { return (b & 0xff); } private static int get_uint16(byte b[], int start) { return (get_ubyte(b[start]) << 8) + get_ubyte(b[start + 1]); } private static int get_int16b(byte b[], int start) { int i = get_ubyte(b[start]) * 256 + get_ubyte(b[start + 1]); if (i > 32767) i -= 0x10000; return i; } } </pre> == '''Faces''' == A '''negative''' face_fill_back or face_fill_front value indicates a '''solid colour''', whereas a '''positive''' value indicates a '''texture'''. The texture is defined by its offset in the client's texture array. When converting to/from [http://en.wikipedia.org/wiki/Wavefront_.obj_file Wavefront OBJ] format, remember that the OB3 face vertices are one less than the OBJ face vertices. <pre>public static int decode_colour(int i) { i = -(i + 1); int r = i >> 10 & 0x1f; int g = i >> 5 & 0x1f; int b = i & 0x1f; return (r << 19) + (g << 11) + (b << 3); } </pre> <pre>public static int encode_colour(int r, int g, int b) { return -1 - (r / 8) * 1024 - (g / 8) * 32 - b / 8; } </pre> Category:RS2 14 17 o2vqldl3370k2223uevw9szugg1bk0q 52 2011-06-18T04:26:33Z Admin 1 Created page with "This page will display any information regarding RS2." This page will display any information regarding RS2. 116 2011-06-20T04:51:54Z Admin 1 This page will display any information regarding RS2. == RS2 #194 == * [[194 Protocol]] * [[194 Items]] * [[194 NPCs]] * [[194 Objects]] == RS2 #317 == * [[317 Protocol]] * [[317 Items]] * [[317 NPCs]] * [[317 Objects]] == RS2 #474 == * [[474 Protocol]] * [[474 Items]] * [[474 NPCs]] * [[474 Objects]] == RS2 #508 == * [[508 Protocol]] * [[508 Items]] * [[508 NPCs]] * [[508 Objects]] 119 2011-06-20T04:52:52Z Admin 1 This page will display any information regarding RS2. 226 2011-06-26T18:13:10Z Admin 1 == Introduction == The RuneScape Protocol is the language in which the RuneScape client and server communicate. The protocol changes for every version. The entire protocol is generally separated into two different categories: * Login Protocol * Game Protocol == Login Protocol == The Login Protocol is the protocol that is used to log a player into RuneScape. This protocol contains information that sets up the encryption for the entire session, using the ISAAC algorithm. The "login block" is encrypted using RSA to prevent third party programs from packet-sniffing the ISAAC ciphers and breaking the session encryption for the purpose of monitoring, injecting, and generally sniffing packets. == Game Protocol == The Game Protocol is the protocol in which game action information is transmitted. The game protocol is encrypted using ISAAC ciphers in order to prevent third party programs from tampering with the stream. The game protocol is made up of packets that are structured like so: <pre> For fixed-size packets: opcode, payload[size] For variable-sized packets: opcode, size, payload[size] </pre> The ''opcode'' of a game packet is basically an identifier for the type of game action that the packet represents. The ''size'' of the packet is the amount of bytes that the payload of the packet carries, and the ''payload'' is an array of bytes that holds the actual data (information) of the packet. A ''fixed-size'' packet is a packet whose payload size does never change, and the size for the specified opcode is already known between both client and server. A ''variable-sized'' packet is a packet whose payload size changes according to the situation of the game session. 706 2012-09-30T08:49:37Z Graham 97 /* Login Protocol */ == Introduction == The RuneScape Protocol is the language in which the RuneScape client and server communicate. The protocol changes for every version. The entire protocol is generally separated into two different categories: * Login Protocol * Game Protocol == Login Protocol == The Login Protocol is the protocol that is used to log a player into RuneScape. This protocol contains information that sets up the encryption for the entire session, using the ISAAC algorithm. The "login block" is encrypted using RSA to prevent third party programs from packet-sniffing the ISAAC cipher keys and breaking the session encryption for the purpose of monitoring, injecting, and generally sniffing packets. == Game Protocol == The Game Protocol is the protocol in which game action information is transmitted. The game protocol is encrypted using ISAAC ciphers in order to prevent third party programs from tampering with the stream. The game protocol is made up of packets that are structured like so: <pre> For fixed-size packets: opcode, payload[size] For variable-sized packets: opcode, size, payload[size] </pre> The ''opcode'' of a game packet is basically an identifier for the type of game action that the packet represents. The ''size'' of the packet is the amount of bytes that the payload of the packet carries, and the ''payload'' is an array of bytes that holds the actual data (information) of the packet. A ''fixed-size'' packet is a packet whose payload size does never change, and the size for the specified opcode is already known between both client and server. A ''variable-sized'' packet is a packet whose payload size changes according to the situation of the game session. 707 2012-09-30T08:50:09Z Graham 97 /* Game Protocol */ == Introduction == The RuneScape Protocol is the language in which the RuneScape client and server communicate. The protocol changes for every version. The entire protocol is generally separated into two different categories: * Login Protocol * Game Protocol == Login Protocol == The Login Protocol is the protocol that is used to log a player into RuneScape. This protocol contains information that sets up the encryption for the entire session, using the ISAAC algorithm. The "login block" is encrypted using RSA to prevent third party programs from packet-sniffing the ISAAC cipher keys and breaking the session encryption for the purpose of monitoring, injecting, and generally sniffing packets. == Game Protocol == The Game Protocol is the protocol in which game action information is transmitted. The opcodes are encrypted using ISAAC in order to prevent third party programs from tampering with the stream. The game protocol is made up of packets that are structured like so: <pre> For fixed-size packets: opcode, payload[size] For variable-sized packets: opcode, size, payload[size] </pre> The ''opcode'' of a game packet is basically an identifier for the type of game action that the packet represents. The ''size'' of the packet is the amount of bytes that the payload of the packet carries, and the ''payload'' is an array of bytes that holds the actual data (information) of the packet. A ''fixed-size'' packet is a packet whose payload size does never change, and the size for the specified opcode is already known between both client and server. A ''variable-sized'' packet is a packet whose payload size changes according to the situation of the game session. 194 Protocol 0 14 qdnwi0hdod7hed13ks21t8t264damib 49 2011-06-18T04:23:58Z Admin 1 Created page with "{{Crappy}} Just for fun if anyone gives two shits." {{Crappy}} Just for fun if anyone gives two shits. 58 2011-06-18T04:53:41Z Admin 1 {{Crappy}} Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 76 2011-06-18T05:52:19Z Admin 1 /* Incoming Data */ {{Crappy}} Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 77 2011-06-18T05:52:25Z Admin 1 /* Outgoing Data */ {{Crappy}} Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 125 2011-06-20T04:55:03Z Admin 1 [[Category:RS2]] Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 219 2011-06-26T18:08:54Z Admin 1 [[Category:RS2]] Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 137 | FIXED | 2 | [[194:Show interface|Show interface]] | Displays a normal interface. |- | 164 | VARIABLE_BYTE | N/A | [[194:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 192 | FIXED | 0 | [[194:Logout|Logout]] | Disconnects the client from the server. |- | 206 | VARIABLE_BYTE | N/A | [[194:Set MIDI|Set MIDI]] | Sets the current song playing on the client. |- | 210 | FIXED | 3 | [[194:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 240 | FIXED | 0 | [[194:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 54 | VARIABLE_BYTE | N/A | Send Chat Message | Sends a chat message to the server. |- | 237 | VARIABLE_BYTE | N/A | Send Command | Sends a command (any message prefixed with ::) to the server. |- |} 223 2011-06-26T18:10:35Z Admin 1 [[Category:RS2]] Just for fun if anyone gives two shits. == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 137 | FIXED | 2 | [[194:Show interface|Show interface]] | Displays a normal interface. |- | 164 | VARIABLE_BYTE | N/A | [[194:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 192 | FIXED | 0 | [[194:Logout|Logout]] | Disconnects the client from the server. |- | 206 | VARIABLE_BYTE | N/A | [[194:Set MIDI|Set MIDI]] | Sets the current song playing on the client. |- | 210 | FIXED | 3 | [[194:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 240 | FIXED | 0 | [[194:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 54 | VARIABLE_BYTE | N/A | Send Chat Message | Sends a chat message to the server. |- | 237 | VARIABLE_BYTE | N/A | Send Command | Sends a command (any message prefixed with ::) to the server. |- |} 956 2014-03-07T02:41:58Z Pure 316 [[Category:RS2]] Just in case somebody cares about this. == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 137 | FIXED | 2 | [[194:Show interface|Show interface]] | Displays a normal interface. |- | 164 | VARIABLE_BYTE | N/A | [[194:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 192 | FIXED | 0 | [[194:Logout|Logout]] | Disconnects the client from the server. |- | 206 | VARIABLE_BYTE | N/A | [[194:Set MIDI|Set MIDI]] | Sets the current song playing on the client. |- | 210 | FIXED | 3 | [[194:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 240 | FIXED | 0 | [[194:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 54 | VARIABLE_BYTE | N/A | Send Chat Message | Sends a chat message to the server. |- | 237 | VARIABLE_BYTE | N/A | Send Command | Sends a command (any message prefixed with ::) to the server. |- |} 194:Show interface 0 106 q5psut2ziocj4jsllar2wpkxh1bhot0 220 2011-06-26T18:09:24Z Admin 1 Created page with "{{packet|name=Show interface|description=Displays a normal interface.|opcode=137|type=Fixed|length=2|revision=194}} == Show interface == === Description === Displays a normal i..." {{packet|name=Show interface|description=Displays a normal interface.|opcode=137|type=Fixed|length=2|revision=194}} == Show interface == === Description === Displays a normal interface with the given id. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The interface id. |- |} Data Types 0 35 n1fyuslzrml87b7njxqs7u1zl3cr3jd 147 2011-06-26T17:45:43Z Admin 1 Created page with "== Introduction == RuneScape uses a number of standard and non-standard data types. == Byte Order == Data types that are two bytes or larger can be stored and ordered in a var..." == Introduction == RuneScape uses a number of standard and non-standard data types. == Byte Order == Data types that are two bytes or larger can be stored and ordered in a variety of different ways. Generally people either use big endian or little endian. === Big Endian === In big endian order, the most significant byte (MSB) is stored first and the least significant byte (LSB) is stored last. === Little Endian === In little endian order, the least significant byte (LSB) is stored first and the most significant byte (MSB) is stored last. === Byte order in RuneScape === RuneScape uses both little and big-endian byte orders throughout the protocol (however, the 194 client only uses big-endian order), presumably to make reverse-engineering of the protocol harder. Some confusion has arisen over the byte order as the data types are named incorrectly in [[Server:Winterlove|Winterlove]]'s server where little endian data types are incorrectly named as big endian types. == Standard data types == These datatypes can also be read/written by a DataWriter/DataReader implementation (DataStreams and Buffers) Naming conventions: {| border=2 ! Official name ! Datatype name ! Jagex name ! Encoding |- | Byte | byte | 1,1b |- | [[Word|WORD]] | short | 2,2b |- | [[DWord|DWORD]] | int,int32 | 4,4b |- | [[QWord|QWORD]] | long,int64 | 8,8b |- | C style string | string,String,char *,char[] | str,strbyte | text bytes then '\n' or 10 |- | Java style string | string,String,char *,char[] | strraw | WORD length then text bytes |} Note that [[Jagex]] used to use a new line character as string terminator, in more recent versions they use the null character \0 or 0 to support multi-line strings. == Non Standard Data Types == {| border=2 ! Winterlove's name ! Jagex name ! Read transformation ! Write transformation |- | Special A | Unknown | value - 128 | value + 128 |- | Special C | Unknown | 0 - value | 0 - value |- | Special S | Unknown | 128 - value | 128 - value |- | SpaceSaverA | smarts | (value[0] < 128) ? (((value[0] - 128)<<8)+value[1]) : value[0] | if(value < 128) putword(value+32768) else putbyte(value); |- | SpaceSaverB | smart | (value[0] < 128) ? value[0] - 64 | ((value[0]<<8)+value[1]) - 49152 | if(i < 64 && i >= -64) putbyte(i + 64) else if(i < 16384 && i >= -16384) putword(i + 49152); |- | tribyte / RGBColour / 3Byte / int3 / medium | 3 | (value[0] << 24) + (value[1] << 16) + value[2] | putbyte(value >> 24);putbyte(value >> 16);putbyte(value); |- | [[RS String|RS_String]] | jstr | Old engine: read until newline delimiter ("\n") <br />New engine: read until null byte (value 0). | Old engine: write and finish with newline delimiter ("\n") <br />New engine: write and finish with null byte (value 0). |} Additionally, RuneScape also uses two integers that are different from a big- or low endian order. Both byte orders are called middle endian. Their orders could be described as following: Middle endian big int: C3 D4 A1 B2 Middle endian small int: B2 A1 D4 C3 (A1 smallest D4 biggest byte) 469 2012-08-24T15:40:27Z Dirk 98 == Introduction == RuneScape uses a number of standard and non-standard data types. == Byte Order == Data types that are two bytes or larger can be stored and ordered in a variety of different ways. Generally people either use big endian or little endian. === Big Endian === In big endian order, the most significant byte (MSB) is stored first and the least significant byte (LSB) is stored last. === Little Endian === In little endian order, the least significant byte (LSB) is stored first and the most significant byte (MSB) is stored last. === Byte order in RuneScape === RuneScape uses both little and big-endian byte orders throughout the protocol (however, the 194 client only uses big-endian order), presumably to make reverse-engineering of the protocol harder. Some confusion has arisen over the byte order as the data types are named incorrectly in [[Server:Winterlove|Winterlove]]'s server where little endian data types are incorrectly named as big endian types. == Standard data types == These datatypes can also be read/written by a DataWriter/DataReader implementation (DataStreams and Buffers) Naming conventions: {| border=2 ! Official name ! Datatype name ! Jagex name ! Encoding |- | Byte | byte | 1,1b |- | [[Word|WORD]] | short | 2,2b |- | [[DWord|DWORD]] | int,int32 | 4,4b |- | [[QWord|QWORD]] | long,int64 | 8,8b |- | C style string | string,String,char *,char[] | str,strbyte | text bytes then '\n' or 10 |- | Java style string | string,String,char *,char[] | strraw | WORD length then text bytes |} Note that [[Jagex]] used to use a new line character as string terminator, in more recent versions they use the null character \0 or 0 to support multi-line strings. == Non Standard Data Types == {| border=2 ! Winterlove's name ! Jagex name ! Read transformation ! Write transformation |- | Special A | Unknown | value - 128 | value + 128 |- | Special C | Unknown | 0 - value | 0 - value |- | Special S | Unknown | 128 - value | 128 - value |- | SpaceSaverA | smarts | (value[0] < 128) ? (((value[0] - 128)<<8)+value[1]) : value[0] | if(value < 128) putword(value+32768) else putbyte(value); |- | SpaceSaverB | smart | (value[0] < 128) ? value[0] - 64 | ((value[0]<<8)+value[1]) - 49152 | if(i < 64 && i >= -64) putbyte(i + 64) else if(i < 16384 && i >= -16384) putword(i + 49152); |- | tribyte / RGBColour / 3Byte / int3 / medium | 3 | (value[0] << 24) + (value[1] << 16) + value[2] | putbyte(value >> 24);putbyte(value >> 16);putbyte(value); |- | [[RS String|RS_String]] | jstr | Old engine: read until newline delimiter ("\n") <br />New engine: read until null byte (value 0). | Old engine: write and finish with newline delimiter ("\n") <br />New engine: write and finish with null byte (value 0). |} Additionally, RuneScape also uses two integers that are different from a big- or low endian order. Both byte orders are called middle endian. Their orders could be described as following: Middle endian big int: C3 D4 A1 B2 Middle endian small int: B2 A1 D4 C3 (A1 smallest D4 biggest byte) == Bit Access == === Initiating Bit Access === Whenever data is to be sent to the server or to the client using bits; the stream needs to be prepared by setting the bit position. The bit position can be calculated by grabbing the current buffer position and multiplying it by 8. This can be seen below. int bitPos = bufferPos * 8; Word 0 28 kpqav15anynqce0bk54lano3b9kuq6z 140 2011-06-26T17:41:17Z Admin 1 Created page with "A "word" is a data-type that consists of 2 bytes. <br /> It is also commonly known as the "short" data-type in programming. [[Category:Data Type]]" A "word" is a data-type that consists of 2 bytes. <br /> It is also commonly known as the "short" data-type in programming. [[Category:Data Type]] DWord 0 29 iv3dea47078v12jp85hej7qorjri113 141 2011-06-26T17:41:51Z Admin 1 Created page with "A "DWord" (double-word) is a data-type that consists of 4 bytes.<br /> It is also commonly known as the "int" data-type in programming. [[Category:Data Type]]" A "DWord" (double-word) is a data-type that consists of 4 bytes.<br /> It is also commonly known as the "int" data-type in programming. [[Category:Data Type]] QWord 0 30 n286qj5bfljh5mgv54ly03iroy56kp6 142 2011-06-26T17:42:17Z Admin 1 Created page with "A "QWord" (quad-word) is a data-type that consists of 8 bytes.<br /> It is also commonly known as the "long" data-type in programming. [[Category:Data Type]]" A "QWord" (quad-word) is a data-type that consists of 8 bytes.<br /> It is also commonly known as the "long" data-type in programming. [[Category:Data Type]] RS String 0 31 o695ejrttyox5i05sm9dxfpnmcabhgl 143 2011-06-26T17:43:08Z Admin 1 Created page with "== Introduction == RS String is a codename for a custom string data-type used in the RuneScape protocol. <br /> The string data-type is used to hold a series of characters in or..." == Introduction == RS String is a codename for a custom string data-type used in the RuneScape protocol. <br /> The string data-type is used to hold a series of characters in order to form a message. ===Old Engine Protocol=== In the old engine client, the RS String datatype is delimited by a newline character (value "\n"). ===New Engine Protocol=== In the new-engine client, the RS String datatype is delimited by a null byte (value 0). 194:Logout 0 107 2401xsj7a958cjcuov32x1h15nibmse 221 2011-06-26T18:09:47Z Admin 1 Created page with "{{packet|name=Logout|description=Forces the client to logout.|opcode=192|type=Fixed|length=0|revision=194}} == Send Message == === Description === Forces the client to logout c..." {{packet|name=Logout|description=Forces the client to logout.|opcode=192|type=Fixed|length=0|revision=194}} == Send Message == === Description === Forces the client to logout cleanly and return to the login screen, without attempting a reconnection. 194:Clear screen 0 108 sa7lyj41kmllmgn8ezwavhu80ya1lrw 222 2011-06-26T18:10:00Z Admin 1 Created page with "{{packet|name=Clear screen|description=Clears the screen of all open interfaces.|opcode=240|type=Fixed|length=0|revision=194}} == Clear Screen == === Description === Removes al..." {{packet|name=Clear screen|description=Clears the screen of all open interfaces.|opcode=240|type=Fixed|length=0|revision=194}} == Clear Screen == === Description === Removes all open interfaces from the players screen. 289 Protocol 0 136 1xinfndju6wvnyjll1ucg8831uk3h5u 362 2012-01-25T22:05:50Z God 31 Created page with "[[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet ..." [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 1526 2014-11-23T02:56:32Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |-| 184 | FIXED | 5 | [[289:Player Dialogue Head|Player Dialogue Head]] | Sends the player's head on the dialogue. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 1527 2014-11-23T02:57:07Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |-| | 185 | FIXED | 5 | [[289:Player Dialogue Head|Player Dialogue Head]] | Sends the player's head on the dialogue. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 1529 2014-11-23T03:01:26Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |-| | 185 | FIXED | 5 | [[289:Send Player Head|Send Player Head]] | Sends the player's head on an interface. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 1531 2014-11-23T03:07:41Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |-| | 185 | FIXED | 5 | [[289:Send Player Head|Send Player Head]] | Sends the player's head on an interface. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 241 | VARIABLE_SHORT | N/A | [[289:Construct Map Region|Construct Map Region]] | Constructs the map region. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 1535 2014-11-23T03:24:07Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] NOTE: This page will have many further updates, once I rename and document the #289 client more. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 289 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 or "RSA header" |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == Yes, the player updating procedure IS different than 317. The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. Directly after it reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. Finally, it reads the 'update required' bit, and checks to see if further update is required. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The client then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. At this point the client then sets the player's position. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x200''' The 0x200 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x2''' Animations are handled by the 0x2 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x8''' The beloved 0x8 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x40''' Unlike the previous, the 0x40 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x4''' Updating the player's current interacting-entity is done via mask 0x4. The entity id is written as a little-endian unsigned short. * '''0x1''' The 0x1 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x20''' Facing coordinate updating is signified by the 0x20 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x10''' Notifying client's of a player's health is done via the 0x10 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x400''' The 0x400 mask acts in the same way as the 0x10 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 13 | FIXED | 3 | [[289:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 18 | FIXED | 6 | [[289:Interface item|Interface item]] | Displays an item model inside an interface. |- | 21 | VARIABLE_BYTE | N/A | [[289:Send player option|Send player option]] | Sends a player option (when a player is right clicked, i.e. "Follow"). |- | 23 | FIXED | 0 | [[289:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 30 | FIXED | 5 | [[289:Send player head|Send player head]] | Sends the players dialogue head on an interface. |- | 46 | FIXED | 2 | [[289:Weight|Weight]] | Sends the players weight. |- | 47 | VARIABLE_SHORT | N/A | [[289:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 55 | FIXED | 4 | [[289:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 59 | VARIABLE_SHORT | N/A | [[289:Set interface text|Set interface text]] | Attaches text to an interface. |- | 63 | FIXED | 3 | [[289:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 76 | FIXED | 32 | [[289:Send update item|Send update item]] | Updates an item on an interface. |- | 79 | FIXED | 6 | [[289:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 81 | FIXED | 2 | [[289:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 107 | FIXED | 2048 | [[289:Send update items|Send update items]] | Updates more than one item on an interface. |- | 119 | FIXED | 2 | [[289:Show interface|Show interface]] | Displays a normal interface. |- | 120 | FIXED | 3 | [[289:Initialize player|Initialize player]] | Sends their current index on the server's player list and the player's membership status. |- | 121 | FIXED | 0 | [[289:Logout|Logout]] | Disconnects the client from the server. |- | 133 | FIXED | 0 | [[289:Reset camera|Reset camera]] | Resets the camera position. |- | 154 | FIXED | N/A | [[317:Send Skill|Send Skill]] | Sends a specific skill. |- | 155 | FIXED | 3 | [[317:Send position|Send position]] | Sends the coordinates of the player. |- | 160 | FIXED | 4 | [[289:Interface color|Interface color]] | Changes the color of an interface. |- | 168 | FIXED | 9 | [[289:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 172 | FIXED | 0 | [[289:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 177 | FIXED | 6 | [[289:Send sound|Send sound]] | Instructs the client to play a sound. |- | 181 | FIXED | 1 | [[289:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 184 | FIXED | 4 | [[289:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |-| | 185 | FIXED | 5 | [[289:Send Player Head|Send Player Head]] | Sends the player's head on an interface. |- | 187 | FIXED | 3 | [[289:Play song|Play song]] | Instructs the client to play a song. |- | 188 | N/A | N/A | [[289_Protocol#Player_Updating|Player updating]] | See player updating (above) for more information. |- | 195 | FIXED | 1 | [[289:Run energy|Run energy]] | Sends the players run energy level. |- | 196 | VARIABLE_BYTE | N/A | [[289:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 200 | FIXED | 4 | [[289:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 201 | FIXED | 0 | [[289:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 204 | FIXED | 2 | [[289:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 208 | FIXED | 4 | [[289:Camera shake|Camera shake]] | Causes the camera to shake. |- | 219 | FIXED | 4 | [[289:Load map region|Load map region]] | Loads a new map region. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 243 | VARIABLE_BYTE | N/A | [[289:Send private message|Send private message]] | Sends a private message to another player. |- | 241 | VARIABLE_SHORT | N/A | [[289:Construct Map Region|Construct Map Region]] | Constructs the map region. |- | 244 | FIXED | 5 | [[289:Send Npc Head|Send Npc Head]] | Sends the dialogue head of an npc on an interface. |- | 247 | FIXED | 1 | [[289:Minimap State|Minimap State]] | Sets the mini map's state. |- | 253 | FIXED | 10 | [[289:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 235 | FIXED | 8 | [[289:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- |} 289:Send sidebar interface 0 599 0wj63pj1ce22jpbxfc5e409z35vjc5e 1537 2014-11-23T03:28:46Z Bl3nd 326 Created page with "{{packet|name=Send Sidebar Interface|description=Sends the sidebar interfaces|opcode=63|type=Fixed|length=2|revision=317}} == Send Sidebar Interface == === Description === T..." {{packet|name=Send Sidebar Interface|description=Sends the sidebar interfaces|opcode=63|type=Fixed|length=2|revision=317}} == Send Sidebar Interface == === Description === This packet sends the sidebar interfaces === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The interface Id. |- | [[Data_Types#Standard_data_types|Byte]] | The icon. |- |} 1538 2014-11-23T03:29:14Z Bl3nd 326 {{packet|name=Send Sidebar Interface|description=Sends the sidebar interfaces|opcode=63|type=Fixed|length=3|revision=317}} == Send Sidebar Interface == === Description === This packet sends the sidebar interfaces === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The interface Id. |- | [[Data_Types#Standard_data_types|Byte]] | The icon. |- |} 317:Send Skill 0 598 g0e5m6a61qc2tsanem6cqj5fngu2w6x 1536 2014-11-23T03:26:20Z Bl3nd 326 Created page with "{{packet|name=Send Skill|description=Sends a specific skill|opcode=154|type=Fixed|length=N/A|revision=317}} == Send Skill == === Description === This packet sends a specific..." {{packet|name=Send Skill|description=Sends a specific skill|opcode=154|type=Fixed|length=N/A|revision=317}} == Send Skill == === Description === This packet sends a specific skill. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The skill you want to send. |- | [[Data_Types#Standard_data_types|Int]] | The experience of that skill. |- | [[Data_Types#Standard_data_types|Byte]] | The level of that skill. |- |} 289:Send Player Head 0 596 csv1gxgwzuescnw3un9qmkghbte0yzc 1530 2014-11-23T03:04:39Z Bl3nd 326 Created page with "{{packet|name=Send player head|description=Sends the player head on an interface|opcode=185|type=Fixed|length=5|revision=317}} == Friends List Status == === Description === ..." {{packet|name=Send player head|description=Sends the player head on an interface|opcode=185|type=Fixed|length=5|revision=317}} == Friends List Status == === Description === This packet sends the first list load status. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Little Endian Short-A]] | The interface Id. |- |} 317:Friends list status 0 54 no8gbinbsfvreb2qysh3clxb41vn676 166 2011-06-26T17:52:53Z Admin 1 Created page with "{{packet|name=Friends list status|description=Sends the friends list load status|opcode=221|type=Fixed|length=1|revision=317}} == Friends List Status == === Description === Thi..." {{packet|name=Friends list status|description=Sends the friends list load status|opcode=221|type=Fixed|length=1|revision=317}} == Friends List Status == === Description === This packet sends the first list load status. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The status of the friends list. |- |} ==== Values ==== The below are the different values for this packet. {| border=2 ! Value ! Response |- | 0 | Loading |- | 1 | Connecting |- | 2 | Loaded |- |} 217 2011-06-26T18:07:34Z Admin 1 moved [[Friends list status]] to [[317:Friends list status]] {{packet|name=Friends list status|description=Sends the friends list load status|opcode=221|type=Fixed|length=1|revision=317}} == Friends List Status == === Description === This packet sends the first list load status. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The status of the friends list. |- |} ==== Values ==== The below are the different values for this packet. {| border=2 ! Value ! Response |- | 0 | Loading |- | 1 | Connecting |- | 2 | Loaded |- |} 289:Construct Map Region 0 597 aaj3a1uq1k94xc3hse0pq86wt6k8qrw 1532 2014-11-23T03:21:40Z Bl3nd 326 Created page with "{{packet|name=Construct Map Region|description=Constructs the map region|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map Region == === Description =..." {{packet|name=Construct Map Region|description=Constructs the map region|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map Region == === Description === This packet constructs the map region. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Additional Short]] | The players region y plus 6. |- | [[Data_Types#Standard_data_types|Short]] | The players region x plus 6. |- |} === Other Information === After the region y is sent, you need to initialize the bit access. Then, loop through the z (which can only go up to 3). Still in the for-loop, you need to go through the x's (up to 12). Then, loop through the y's (up to 12). All of this is in the all three for-loops! Step 1: Then you'll get the tile of x, y, and z. Step 2: Then you need to send the bits 1 and (if tile is null) 1 otherwise, 0. Step 3: Check if the tile is not null. Within this if-statement, you put these bits... {|border=2 ! Method |- | putBits(26, tile.getX() << 14 | tile.getY() << 3 | tile.getZ() << 24 | tile.getRotation() << 1) |- |} Out of the for-loops! Step 1: Finish the bit access and send the region x. Done. 1533 2014-11-23T03:22:21Z Bl3nd 326 /* Other Information */ {{packet|name=Construct Map Region|description=Constructs the map region|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map Region == === Description === This packet constructs the map region. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Additional Short]] | The players region y plus 6. |- | [[Data_Types#Standard_data_types|Short]] | The players region x plus 6. |- |} === Other Information === After the region y is sent, you need to initialize the bit access. Then, loop through the z (which can only go up to 3). Still in the for-loop, you need to go through the x's (up to 12). Then, loop through the y's (up to 12). All of this is in the all three for-loops! Step 1: Then you'll get the tile of x, y, and z. Step 2: Then you need to send the bits 1 and (if tile is null) 1 otherwise, 0. Step 3: Check if the tile is not null. Within this if-statement, you put these bits... {|border=2 ! Method |- | putBits(26, tile.getX() << 14 | tile.getY() << 3 | tile.getZ() << 24 | tile.getRotation() << 1) |- |} Out of the for-loops! Step 1: Finish the bit access and send the region x. Done. 1534 2014-11-23T03:22:37Z Bl3nd 326 /* Other Information */ {{packet|name=Construct Map Region|description=Constructs the map region|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map Region == === Description === This packet constructs the map region. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Additional Short]] | The players region y plus 6. |- | [[Data_Types#Standard_data_types|Short]] | The players region x plus 6. |- |} === Other Information === After the region y is sent, you need to initialize the bit access. Then, loop through the z (which can only go up to 3). Still in the for-loop, you need to go through the x's (up to 12). Then, loop through the y's (up to 12). All of this is in the all three for-loops! Step 1: Then you'll get the tile of x, y, and z. Step 2: Then you need to send the bits 1 and (if tile is null) 1 otherwise, 0. Step 3: Check if the tile is not null. Within this if-statement, you put these bits... {|border=2 ! Method |- | putBits(26, tile.getX() << 14 | tile.getY() << 3 | tile.getZ() << 24 | tile.getRotation() << 1) |- |} Out of the for-loops! Step 1: Finish the bit access and send the region x. Done. 317 Protocol 0 11 g7u7oy073sed6hf6m2f4rqpvnfl12pl 28 2011-06-16T16:34:06Z Abraham2119 4 Created page with " == '''Incoming Data''' == == '''Outgoing Data''' ==" == '''Incoming Data''' == == '''Outgoing Data''' == 29 2011-06-16T16:35:44Z Abraham2119 4 /* Incoming Data */ == '''Login''' == == '''Incoming Data''' == == '''Outgoing Data''' == 30 2011-06-16T16:43:29Z Abraham2119 4 /* Login */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. The server then associates this packet opcode to its respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word for its proper size. == '''Login''' == == '''Incoming Data''' == == '''Outgoing Data''' == 31 2011-06-16T16:44:24Z Abraham2119 4 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. The server then associates this packet opcode to its respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word, depending on the specific packet, for its proper size. == '''Login''' == == '''Incoming Data''' == == '''Outgoing Data''' == 32 2011-06-16T16:45:22Z Abraham2119 4 /* Login */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. The server then associates this packet opcode to its respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word, depending on the specific packet, for its proper size. == '''Login''' == Opcode: 14 After the client sends the login opcode, == '''Incoming Data''' == == '''Outgoing Data''' == 33 2011-06-16T16:48:02Z Abraham2119 4 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - it varies per packet - for its proper size. == '''Login''' == Opcode: 14 After the client sends the login opcode, == '''Incoming Data''' == == '''Outgoing Data''' == 34 2011-06-16T16:48:52Z Abraham2119 4 /* Login */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - it varies per packet - for its proper size. == '''Login''' == '''Opcode:''' 14 After the client sends the login opcode, == '''Incoming Data''' == == '''Outgoing Data''' == 35 2011-06-16T16:49:20Z Abraham2119 4 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. == '''Login''' == '''Opcode:''' 14 After the client sends the login opcode, == '''Incoming Data''' == == '''Outgoing Data''' == 36 2011-06-16T16:50:29Z Abraham2119 4 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == '''Opcode:''' 14 After the client sends the login opcode, == '''Incoming Data''' == == '''Outgoing Data''' == 37 2011-06-16T16:51:46Z Abraham2119 4 /* Login */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == == '''Outgoing Data''' == 38 2011-06-16T16:52:42Z Abraham2119 4 /* Incoming Data */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == //TODO: document packet structures == '''Outgoing Data''' == 39 2011-06-16T16:53:08Z Abraham2119 4 /* Outgoing Data */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == //TODO: document packet structures == '''Outgoing Data''' == ''''TODO:'''' document packet structures 40 2011-06-16T16:53:18Z Abraham2119 4 /* Outgoing Data */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == //TODO: document packet structures == '''Outgoing Data''' == '''TODO:''' document packet structures 41 2011-06-16T16:53:31Z Abraham2119 4 /* Incoming Data */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures == '''Outgoing Data''' == '''TODO:''' document packet structures 42 2011-06-16T16:53:39Z Abraham2119 4 /* Outgoing Data */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG initialized with dynamically generated seeds during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures == '''Outgoing Data''' == '''TODO:''' Document packet structures 43 2011-06-16T16:56:19Z Abraham2119 4 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures == '''Outgoing Data''' == '''TODO:''' Document packet structures 47 2011-06-18T04:04:07Z Rix 3 {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures == '''Outgoing Data''' == '''TODO:''' Document packet structures 56 2011-06-18T04:52:02Z Admin 1 /* Incoming Data */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures 57 2011-06-18T04:52:09Z Admin 1 /* Outgoing Data */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == super_ wrote shit on this somewhere == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 68 2011-06-18T05:09:20Z Admin 1 /* Login */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the RuneScape main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 69 2011-06-18T05:11:30Z Admin 1 /* Login */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the RuneScape main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 70 2011-06-18T05:12:36Z Admin 1 /* Login */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 71 2011-06-18T05:19:24Z Admin 1 {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == TODO == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 72 2011-06-18T05:28:15Z Admin 1 /* Player Updating */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 73 2011-06-18T05:29:20Z Admin 1 /* Player Updating */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 74 2011-06-18T05:51:56Z Admin 1 /* Incoming Data */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 75 2011-06-18T05:52:03Z Admin 1 /* Outgoing Data */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 82 2011-06-18T16:51:42Z Admin 1 {{Crappy}} <P ALIGN="RIGHT"><img src="http://img542.imageshack.us/img542/6853/ak1.jpg" alt="317" /></P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 83 2011-06-18T16:52:55Z Admin 1 {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 85 2011-06-18T16:56:43Z Admin 1 {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * 0 * 1 * 2 * 3 Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 86 2011-06-18T17:08:41Z Admin 1 /* Player Updating */ {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0 * 1 * 2 * 3 If the type is 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. If the type is 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. If the type is 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. And lastly, if the type is 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * 0x400 * 0x100 * 0x8 * 0x4 * 0x80 * 0x1 * 0x10 * 0x2 * 0x20 * 0x200 '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 87 2011-06-18T17:11:30Z Admin 1 /* Player Updating */ {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 88 2011-06-19T05:41:35Z Ramen 6 Added a chunk of code from the client that corresponds to the text {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <code> long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read(); </code> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 89 2011-06-19T05:42:51Z Ramen 6 Fixed formatting {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. <math>Insert formula here</math>== '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 90 2011-06-19T17:46:04Z Admin 1 formatting fix {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|Client logged in]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 91 2011-06-19T17:47:16Z Admin 1 {{Crappy}} <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 126 2011-06-20T04:55:22Z Admin 1 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 137 2011-06-26T17:36:37Z Admin 1 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 138 2011-06-26T17:38:31Z Admin 1 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 139 2011-06-26T17:38:45Z Admin 1 /* Login */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 245 2011-07-11T12:29:09Z Andrew 9 /* Client -> Server Packets */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 252 2011-07-11T13:01:10Z Andrew 9 /* Client -> Server Packets */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 257 2011-07-12T05:06:18Z Mutex 7 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 258 2011-07-12T05:07:15Z Mutex 7 /* Packet structure */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' Not much is known about this mask, other than that the last value read is a sprite direction id. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 259 2011-07-13T13:48:14Z Canownueasy 11 /* Player Updating */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 260 2011-07-13T14:03:17Z Canownueasy 11 /* Player Updating */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the Agility skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 261 2011-07-13T14:05:17Z Canownueasy 11 /* Player Updating */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | VARIABLE_BYTE | N/A | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 269 2011-07-14T15:44:07Z Andrew 9 /* Client -> Server Packets */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Child frame|Child frame]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 297 2011-08-09T13:33:08Z Supah Fly 15 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Attaches an interface within an interface. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 298 2011-08-11T23:05:56Z Supah Fly 15 new packet (70) [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 12 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 299 2011-08-11T23:07:37Z Supah Fly 15 new packet (200) [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 12 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 8 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 300 2011-08-11T23:09:07Z Supah Fly 15 i'm an idiot. sizes were wrong. fixed. [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[Friends list status|Friends list status]] | Friends list load status. |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 304 2011-08-11T23:31:56Z Supah Fly 15 adding some other things [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 305 2011-09-04T10:41:20Z Mayhem' 20 /* Game Protocol */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. Server -> Client Packets use Output Streams. The Server writes information using the Output Streams, and then the Client Receives packet information with input stream's... In order for a Packet to be sent to the client, from the server, a frame is needed to be created first. After the frame frame has been created, the information from the Output Streams, are written, so this makes the information sent to the client for the certain packet. A method in java, for sending the packets information would be like: <pre> public void sendMessage(String message) { if(getOutStream() != null) { outStream().createFrameVarSize(253); outStream().writeString(s); outStream().endFrameVarSize(); } } </pre> The Client might will read it like: <pre> if(packetType == 253) { String message = inputStream.readString(); pushMessage("", 4, null); return true; // false to make the packet not work... true to make it work... } </pre> <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 306 2011-09-22T20:19:42Z Supah Fly 15 Undo revision 305 by [[Special:Contributions/Mayhem'|Mayhem']] ([[User talk:Mayhem'|talk]]). Thanks for the contribution, but no. Bad/faulty information. [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Send text|Send text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 315 2011-10-26T02:02:19Z Zymus 19 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 364 2012-01-27T01:45:22Z Gara494 32 /* Packet structure */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 394 2012-05-01T21:26:33Z Geel9 56 /* Server -> Client Packets */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 135 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 396 2012-05-06T17:22:12Z Dane 30 /* Server -> Client Packets */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session id." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 398 2012-05-21T00:03:13Z Tivo444 59 /* Response Codes */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 412 2012-06-20T00:10:55Z Buroa 55 [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== The ID of the user. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 413 2012-07-13T06:26:51Z Radar 62 /* User ID */ [[Category:RS2]] <P ALIGN="RIGHT">[[File:317_1.jpg|thumb|The 317 client]]</P> == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 455 2012-08-16T01:19:39Z Eyeownyew 91 Removed invalid link [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 474 2012-08-24T20:46:19Z Jmood 88 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, it only adds the player to the needing-update list, or so believed. Type 3 is not well known. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 478 2012-08-25T03:12:22Z Sini 33 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 546 2012-08-26T04:50:56Z Jmood 88 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol''' == == '''Player Updating''' == ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 687 2012-09-15T01:27:46Z Jmood 88 Undo revision 546 by [[Special:Contributions/Jmood|Jmood]] ([[User talk:Jmood|talk]]) [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 693 2012-09-23T18:39:23Z AtomicInt 112 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | 10 | [[317:Send player head to interface|Send player head to interface]] | Sends a players head to an interface |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 694 2012-09-23T18:40:20Z AtomicInt 112 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Send player head to interface|Sends the players head to an interface]] | Sends a players head to an interface |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 695 2012-09-23T18:40:51Z AtomicInt 112 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Sends the players head to an interface]] | Sends a players head to an interface |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 696 2012-09-23T18:41:59Z AtomicInt 112 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 788 2012-12-12T04:26:20Z Scrooge 129 /* Server -> Client Packets */ Added opcode 36 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 825 2013-03-24T15:28:50Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input Amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter Name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 826 2013-03-24T15:29:12Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 828 2013-03-24T15:31:08Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |-| 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 829 2013-03-24T15:32:43Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 831 2013-03-24T15:37:27Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 834 2013-03-24T15:48:58Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 836 2013-03-24T16:12:36Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 863 2013-07-11T12:04:17Z Sk8rdude461 228 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 864 2013-07-11T12:05:45Z Sk8rdude461 228 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 865 2013-07-11T12:34:29Z Sk8rdude461 228 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long l = TextUtils.encodeAsBase37Integer(username); int i = (int) (l >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(i); // "small bit of data derived from... player's username" in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1034 2014-05-27T02:40:15Z AtomicInt 112 /* Login Protocol Overview */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1139 2014-06-23T23:15:14Z Sk8rdude461 228 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1158 2014-06-24T16:31:15Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | N/A |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1167 2014-06-29T04:16:24Z Bl3nd 326 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1286 2014-08-09T00:19:49Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1294 2014-08-09T02:10:48Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | FIXED | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1296 2014-08-09T02:24:19Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | N/A | N/A | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | N/A | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1298 2014-08-09T19:54:24Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | N/A | N/A | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1300 2014-08-09T20:01:30Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | N/A | N/A | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1301 2014-08-09T20:03:06Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1303 2014-08-09T20:08:22Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Resets the camera position. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1304 2014-08-09T20:08:40Z Ambokile 138 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1314 2014-08-11T03:46:15Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1596 2015-01-06T03:33:44Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Music|Music]] | Sets the track to play, whether to loop, and delay of the track. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1598 2015-01-06T03:43:33Z Bl3nd 326 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 1618 2015-01-15T15:54:24Z Randqm 736 /* Server -> Client Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 3761 2015-06-06T05:43:43Z OS RSPS 6020 Added documentation for the player option packet. [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 104 | VARIABLE | N/A | [[317:Player Option|Player Option]] | Adds a player option to the right click menu of player(s). |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 3783 2015-06-08T11:13:15Z Pure 316 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte (Special C) which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 104 | VARIABLE | N/A | [[317:Player Option|Player Option]] | Adds a player option to the right click menu of player(s). |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 3785 2015-06-08T13:18:49Z Pure 316 Reverted edits by [[Special:Contributions/Pure|Pure]] ([[User talk:Pure|talk]]) to last revision by [[User:OS RSPS|OS RSPS]] [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 104 | VARIABLE | N/A | [[317:Player Option|Player Option]] | Adds a player option to the right click menu of player(s). |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 3786 2015-06-08T13:19:08Z Pure 316 Undo revision 3785 by [[Special:Contributions/Pure|Pure]] ([[User talk:Pure|talk]]) [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte (Special C) which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 104 | VARIABLE | N/A | [[317:Player Option|Player Option]] | Adds a player option to the right click menu of player(s). |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 0 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} 3790 2015-06-08T15:24:45Z Pure 316 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its [http://en.wikipedia.org/wiki/Opcode opcode]. This specific opcode is encrypted with a value generated by the [http://en.wikipedia.org/wiki/ISAAC_(cipher) ISAAC] [http://en.wikipedia.org/wiki/Pseudorandom_number_generator PRNG] seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the [http://en.wikipedia.org/wiki/Payload_(software) payload]. A list of the 317 Packets may be found [http://rswiki.moparisthebest.com/index.php?title=Category:Packet:317 here]. == '''Login Protocol Overview''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login request - connection type 14 * Update - connection type 15 * New connection login - connection type 16 * Reconnecting login - connection type 18 The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes hash derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes. <pre>long encodedUsername = TextUtils.encodeAsBase37Integer(username); int usernameHash = (int) (encodedUsername >> 16 & 31L); out.offset = 0; out.writeByte(14); // Initiate connection type out.writeByte(usernameHash); in.queueBytes(2, out.payload); for (int j = 0; j < 8; j++) in.read();</pre> At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Login Protocol Breakdown''' == The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing. <br/> ===Variables:=== The login process has a lot of variable data, compiled here is a list of the variables and their different values. ====Name Hash==== A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers. ====Server Session Key==== The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ===="Data File Version"==== <!-- Colby --> The CRC checks for the cache files. <br/> ====User ID==== A client-side randomly generated integer. This could be used in reassigning sessions to players that have lost connection. It is stored as a packed integer in a file named 'uid.dat' in the cache directory. <br/> ====Username==== The username of the player, used to identify their account. <br/> ====Password==== The password of the player account, used so only they can log into their account. <br/> ====Client Session Key==== The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms. <br/> ====Connect Status==== The status of the connection. {|border=2 ! Value ! Status |- | 16 | Signifies that the connection is new. |- | 18 | Signifies that the session is reconnecting a previously lost connection. |- |} ====Size==== The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server. <br/> ====Client Version==== The memory-version of the game client. {|border=2 ! Value ! Status |- | 0 | Signifies the client is a low-memory client. |- | 1 | Signifies that the client is a high-memory client. |- |} ====CRC Values==== 9 4-byte values, Each containing the CRC of their respective cache files. Used by the server to verify client is up to date. <br/> ====Player Status==== The in-game player status - player, player moderator, or administrator. <br/> {|border=2 ! Value ! Status |- | 0 | Signifies that this player is a normal player. |- | 1 | Signifies that this player is a player moderator. |- | 2 | Signifies that this player is an administrator. |- |} ====Flagged==== If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged. <br/> ====Response Codes==== At the beginning and end of the login procedure, we send different values to the client to allow or deny a login. The various values show different messages on the login box on the client or do something internally. <br/> {| border=2 ! Value ! Response |- | -1 | Waits for 2000ms and tries again while counting failures. |- | 0 | Exchanges session keys, player name, password, etc. |- | 1 | Waits for 2000ms and tries again. |- | 2 | Client made a successful login. |- | 3 | "Invalid username or password." |- | 4 | "Your account has been disabled. Please check your message-center for details." |- | 5 | "Your account is already logged in. Please try again in 60 secs..." |- | 6 | "RuneScape has been updated! Please reload this page." |- | 7 | "This world is full. Please use a different world." |- | 8 | "Unable to connect. Login server offline." |- | 9 | "Login limit exceeded. Too many connections from your address." |- | 10 | "Unable to connect. Bad session ID." |- | 11 | "Login server rejected session. Please try again." |- | 12 | "You need a members account to login to this world. Please subscribe, or use a different world." |- | 13 | "Could not complete login. Please try using a different world." |- | 14 | "The server is being updated. Please wait 1 minute and try again." |- | 15 | See the [[#Regarding response code 15|notes below]]. |- | 16 | "Login attempts exceeded. Please wait 1 minute and try again." |- | 17 | "You are standing in a members-only area. To play on this world move to a free area first." |- | 20 | "Invalid loginserver requested. Please try using a different world." |- | 21 | "You have only just left another world. Your profile will be transferred in: (number) seconds." |- | None of the above | "Unexpected server response. Please try using a different world." |- |} ==== Regarding response code 15 ==== On the server, players are not unregistered for quite some time. This can be best witnessed when the client forcefully closes the connection while in combat. If you're quick enough before the player dies or kills the NPC, login attempts during that time return that the account is already logged in. This probably explains why the message says "try again in 60 seconds", and they just reused the response when the player is truly logged in. Going along with this "players aren't offline yet" idea, when the client experiences some lag and performs a reconnect, it sends byte 18 as it's [[#Connect_Status|connection type]] to the server. The server most likely saves this as a boolean (reconnect = var == 18;). When the login is entirely validated, meaning the password's are okay and the server isn't full, it can either send back the normal response, 2, or 15. But why 15? If you look at the client code, you'll see that the chat messages aren't cleared. If you've ever had a poor connection you've noticed that your chat stays there upon a reconnect, and this is exactly why. <!-- thanks to Colby for this contribution--> When you implement response code 15 though, you do NOT need to send the "player status" or the "flagged" bytes. ===Login Process:=== ====Stage 1: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | ubyte | 14 |- | ubyte | "name hash" |- |} <br/> ====Stage 2: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | 0 |- | byte | "response code" |- | [[QWord|long]] | "server session key" |- |} <br/> ====Stage 3: Client -> Server==== {| border=2 |- ! Data Type ! Value |- | byte | "connect status" |- | byte | "size" |- | byte | 255 |- | [[Word|short]] | 317 |- | byte | "client version" |- | [[DWord|int]] | "crc values"[0] |- | [[DWord|int]] | "crc values"[1] |- | [[DWord|int]] | "crc values"[2] |- | [[DWord|int]] | "crc values"[3] |- | [[DWord|int]] | "crc values"[4] |- | [[DWord|int]] | "crc values"[5] |- | [[DWord|int]] | "crc values"[6] |- | [[DWord|int]] | "crc values"[7] |- | [[DWord|int]] | "crc values"[8] |- | byte | 10 |- | [[QWord|long]] | "client session key" |- | [[QWord|long]] | "server session key" |- | [[DWord|int]] | "user id" |- | [[RS String|RS String]] | "username" |- | [[RS String|RS String]] | "password" |- |} <br/> ====Stage 4: Server -> Client==== {| border=2 |- ! Data Type ! Value |- | byte | "response code" |- | byte | "player status" |- | byte | "flagged" |- |} <br/> == '''Player Updating''' == The player updating process consists of 4 parts: * a) Our player movement updates * b) Other player movement updates * c) Player list updating * c.a) Apperance updating * c.b) Location updating * d) Player update block flag-based updates '''Our player movement updates''' The client begins by reading 1 bit. This bit tells the client whether or not it is currently updating 'our player', or the player the client is controlling. If it's not updating our player, it exits and goes onto step b. If it is, it then reads 2 bits. The value is called the movement update type. There are 4 recognized movement update types: * Type 0 basically tells the client there is nothing to update for our player, just add its index to the local updating list. * Type 1 tells the client you moved in one direction. The client reads 3 bits, which represents the direction you moved in, and then 1 bit, which states whether further update is required. If so, it adds it to the updating list. This is used in walking. * Type 2 functions in much of the same way as its previous, only this time it reads two 3 bit values. The first represents the player's last direction, and the second it's current direction. Trailing behind it is also the 1 bit 'update required' flag as type 1. This is used in running. * Type 3 on the other hand is different. It reads in 2 bits which represents our player's plane, or its level of height, in the game world. Only 0-3 inclusive are appropriate planes supported by the client. It then reads 1 bit, which describes whether or not to clear the awaiting-waypoint queue, basically to stop client from further queued stepping, such as used in teleporting. After this, it reads the 'update required' bit, and checks to see if further update is required. Directly after, it reads two 7 bit quantities, representing the new relative X and relative Y coordinates of our player to our current map region's origin. It then sets our players position to the plane, x, and y positions as told to. '''Other player movement updates''' The client begins by reading an 8 bit value telling the client how many players there are to update. It then enters a loop for each player there is to update. Inside this loop, the client reads 1 bit. This is the movement update required flag. If the flag is 0, it sets the current updating player's last update cycle time to the current game logic loop cycle time, and adds the player to the local player list. If the flag is not 0, it then reads the movement update type, which is a 2 bit quantity. The following known types are: * 0, the client updates the current player's last update cycle time, adds the current player to the local player list, and adds it to the updating list. * 1, the client updates the current player's last update cycle time and adds the current player to the local player list as well, but also reads in 3 bit quantity. This represents the current player's direction it walked to. It then reads the a 1 bit value that specifies whether or not to add the player to the updating list. * 2, the client does the exact same thing as the type 2 update, except it reads in two of the 3 bit quantities. The first represents the current player's last direction, and the second its current direction running. * 3, the client queues to remove the player from the list of players to be updated but it is possible such as in the instances for when players teleport to add them back to the list of players to be updated during the populate update. '''Player list updating''' The next step in the player updating procedure is the player list updating, or where the client recieves data on every player in its local list, such as appearance and location relative to ours. The client loops through a process for each player in the updating. The client reads an 11 bit quantity from the buffer, which is the next player in the updated list to be informed about. The clietn then checks if it has a cached buffer for that player's updating, and if it does, it updates the player appearance. '''Appearance updating''' Appearance updating starts off by first reading an unsigned byte that represents the current player's gender. Then it reads another unsigned byte that represents the player's over-head icon id. This is used with prayer icons above heads. Next, a loop occurs 12 times to read equipment data. In the loop, the client reads an unsigned byte that is the equipment slot's item id high byte. If it is 0, the player's equpment slot has no item. If it is not 0, another unsigned byte is read the merged with the previous to create the equipment's item id. If the id is 65535 (written as a -1 signed short), then the player's appearance is that of an NPC. The client reads in an unsigned short representing the NPC's id and sets the player's definition to that NPC's. After the equipment loop, it loops 5 times, once for each type of coloured body part. In each loop, the client reads an unsigned short and assigns it as the color of the current loop idx (which represents the body part). Finally, after the color loop, the client reads 7 unsigned shorts representing animation indices; the animations belong to: * Standing still * Turning while standing * Walking * Turning around (backwards) * Turning a quarter-way clockwise * Turning a quarter-way counter clockwise * Running After these animation indices are read, a long representing the player's name is read, an unsigned byte representing the combat level, and an unsigned short representing the players skill level (for things where players arent ranked by levels, such as where it states '<player name> (skill <skill>)' as an action menu text). '''Location updating''' After the appearance updating, the client starts to update that player's location relative to our player. The player is added to the local player list and it's last update cycle time. It then reads a 1 bit quantity that defines whether or not the client has a chunk in the player update block list. If it does, it adds it to the updating list. The next bit states whether or not to discard the awaiting-waypoint queue, such as when teleporting. It then reads to 5 bit values that determine the players relative X and Y coordinates to our player. The local player area is 16x16, so if the delta of the two coordinates is > 15, 32 is subtracted from it to signify the player is on the other side of ours. The client then sets the player's position, ending the player list updating process. '''Update block flag-based updating''' The following is what most people think of when they say 'update mask' and 'update flag'. This process of the updating procedure is very important. It begins with looping through ALL players in the local player update list, reading an unsigned byte which from now on will be called the update flag. All further updates are seen to be 'included' by comparing a bitwise mask to this flag. If the flag has the bits for 0x40 all on, this signifies that the flag was too large for a simple unsigned byte and reads in another unsigned byte, which it uses as the upper unsigned byte, therefore the update flag is an unsigned little-endian short. The client then passes off the data to a helper method which processes all updates this flag signifies. Inside this method, many different bitwise masks are compared to the player's flag, and if the mask is set, logic is performed. These masks are frequently called update masks. A list of player update masks are below: * '''0x400''' The 0x400 mask is used to update the player so they appear to be asynchronously animating and walking. This mask is often used for the [http://runescape.wikia.com/wiki/Agility Agility] skill. The data associated goes in order of: byte (type C) which is the first location's X coordinate value, byte (type S) which is the first location's Y coordinate value, byte (type S) which is the second location's X coordinate value, byte (type C) the second location's Y coordinate value. After the locations are written, there is a required movement speed which is written as a short which marks how fast to move from position 1 to position 2. Another short (type A) is written as the movement speed going from position 2 to position 1. Finally one byte is written to end the mask block, which marks the direction. * '''0x100''' The 0x100 mask is responsible for player graphics updating. The data associated is a little-endian unsigned short which represents the graphics id, and an int which is the graphics delay. * '''0x8''' Animations are handled by the 0x8 mask. The payload for this update is a little-endian unsigned short that is the animation id, and an unsigned inversed byte (Special C) which states the animation's delay. * '''0x4''' The beloved 0x4 mask takes care of forced player text that is only displayed above the player's model. The only data associated with this is a jagex ASCII string with a terminator of 10. * '''0x80''' Unlike the previous, the 0x80 mask handles normal player chat text. The client will read a little-endian unsigned short which holds chat text attributes. It holds the text color and chat effects. Next, the client reads an unsigned byte which states the player's priveleges (normal player, player moderator, moderator, staff) to give the chatter's name a crown. Right behind it trails an unsigned inversed byte that gives chat text length in bytes. Trailing afterwards is dictionary-compressed chat text. All chat text characters become indexes into a valid character table and are written as nibbles (4 bit quantities). * '''0x1''' Updating the player's current interacting-entity is done via mask 0x1. The entity id is written as a little-endian unsigned short. * '''0x10''' The 0x10 mask updates appearance of the player in exact same way as in updating player list. Only difference is that appearance is updated from a set-sized buffer filled from the current buffer. An unsigned inversed byte is read first which describes appearance buffer size, and the buffer is filled. * '''0x2''' Facing coordinate updating is signified by the 0x2 mask. The player's facing-towards X and Y are set to read values; specifically, an unsigned lower-inverted short and little-endian unsigned short, respectively. * '''0x20''' Notifying client's of a player's health is done via the 0x20 mask. The hitpoint damage done to the player is sent as an unsigned byte, followed by the hit type as a positive inverted byte. The player's current and max health are read as an unsigned inverted byte and unsigned byte, respectively. * '''0x200''' The 0x200 mask acts in the same way as the 0x20 mask and is most likely associated with special attacks from weapons that have the ability to hit twice at the same time. Hitpoint damage is an unsigned byte, the hit type an unsigned inverted byte, and the current and maximum health being an unsigned byte and unsigned inverted byte, respectively. After the client processes every single player in the update player list, it ends player updating. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 0 | [[317:Animation reset|Animation reset]] | Resets all animations in the immediate area. |- | 24 | FIXED | 1 | [[317:Flash sidebar|Flash sidebar]] | Causes a sidebar icon to start flashing. |- | 27 | FIXED | 0 | [[317:Input amount|Input amount]] | Displays the "Input amount" interface. |- | 35 | FIXED | 4 | [[317:Camera shake|Camera shake]] | Causes the camera to shake. |- | 36 | FIXED | 3 | [[317:Force client setting|Force client setting]] | Forcefully changes a client's setting's value. Also changes the default value for that setting. |- | 50 | FIXED | 9 | [[317:Send add friend|Send add friend]] | Sends a friend to the friend list. |- | 61 | FIXED | 1 | [[317:Show multi-combat|Show multi-combat]] | Shows the player that they are in a multi-combat zone. |- | 68 | FIXED | 0 | [[317:Reset button state|Reset button state]] | Resets the button state for all buttons. |- | 70 | FIXED | 6 | [[317:Interface offset|Interface offset]] | Sets the offset for drawing of an interface. |- | 71 | FIXED | 3 | [[317:Send sidebar interface|Send sidebar interface]] | Assigns an interface to one of the tabs in the game sidebar. |- | 72 | FIXED | 2 | [[317:Clear inventory|Clear inventory]] | Clears an interface's inventory. |- | 73 | FIXED | 4 | [[317:Load map region|Load map region]] | Loads a new map region. |- | 74 | FIXED | 4 | [[317:Play song|Play song]] | Starts playing a song. |- | 75 | FIXED | 4 | [[317:NPC head on interface|NPC head on interface]] | Place the head of an NPC on an interface |- | 78 | FIXED | 0 | [[317:Reset destination|Reset destination]] | Resets the players' destination. |- | 79 | FIXED | 4 | [[317:Scroll position|Scroll position]] | Sets the scrollbar position of an interface. |- | 81 | VARIABLE | N/A | [[317:Begin player updating|Begin player updating]] | Begins the player update procedure |- | 97 | FIXED | 2 | [[317:Show interface|Show interface]] | Displays a normal interface. |- |- | 99 | FIXED | 1 | [[317:Minimap State|Minimap State]] | Sets the mini map's state. |- | 101 | FIXED | 3 | [[317:Object removal|Object removal]] | Sends an object removal request to the client. |- | 104 | VARIABLE | N/A | [[317:Player Option|Player Option]] | Adds a player option to the right click menu of player(s). |- | 106 | FIXED | 1 | [[317:Interface over tab|Interface over tab]] | Draws an interface over the tab area. |- | 107 | FIXED | 0 | [[317:Reset camera|Reset camera]] | Resets the camera position. |- | 109 | FIXED | 0 | [[317:Logout|Logout]] | Disconnects the client from the server. |- | 110 | FIXED | 1 | [[317:Run energy|Run energy]] | Sends the players run energy level. |- | 114 | FIXED | 2 | [[317:System update|System update]] | Sends how many seconds until a 'System Update.' |- | 117 | N/A | N/A | [[317:Create Projectile|Create Projectile]] | Creates a projectile. |- | 121 | FIXED | 4 | [[317:Song Queue|Song Queue]] | Queues a song to be played next. |- | 122 | FIXED | 4 | [[317:Interface color|Interface color]] | Changes the color of an interface. |- | 126 | VARIABLE_SHORT | N/A | [[317:Set interface text|Set interface text]] | Attaches text to an interface. |- | 134 | FIXED | 6 | [[317:Skill level|Skill level]] | Sends a skill level to the client. |- | 151 | FIXED | 5 | [[317:Object spawn|Object spawn]] | Sends an object spawn request to the client. |- | 164 | FIXED | 2 | [[317:Chat interface|Chat interface]] | Shows an interface in the chat box. |- | 171 | FIXED | 3 | [[317:Hidden Interface|Hidden Interface]] | Sets an interface to be hidden until hovered over. |- | 174 | FIXED | N/A | [[317:Audio|Audio]] | Sets what audio/sound is to play at a certain time. |- | 176 | FIXED | 10 | [[317:Open welcome screen|Open welcome screen]] | Displays the welcome screen. |- | 185 | FIXED | N/A | [[317:Player head to interface|Player head to interface]] | Sends the players head model to an interface |- | 187 | FIXED | 0 | [[317:Enter name|Enter name]] | Displays the "Enter name" interface. |- | 196 | VARIABLE_BYTE | N/A | [[317:Send private message|Send private message]] | Sends a private message to another player. |- | 200 | FIXED | 4 | [[317:Interface animation|Interface animation]] | Sets an interface's model animation. |- | 206 | FIXED | 3 | [[317:Chat settings|Chat settings]] | Sends the chat privacy settings. |- | 208 | FIXED | 2 | [[317:Walkable interface|Walkable interface]] | Displays an interface in walkable mode. |- | 214 | VARIABLE_SHORT | N/A | [[317:Send add ignore|Send add ignore]] | Sends a ignored player to the ignore list. |- | 218 | FIXED | 2 | [[317:Open chatbox interface|Open chatbox interface]] | Opens an interface over the chatbox. |- | 219 | FIXED | 0 | [[317:Clear screen|Clear screen]] | Clears the screen of all open interfaces. |- | 221 | FIXED | 1 | [[317:Friends list status|Friends list status]] | Friends list load status. |- | 230 | FIXED | 8 | [[317:Interface model rotation|Interface model rotation]] | Sets an interface's model rotation and zoom |- | 240 | FIXED | 2 | [[317:Weight|Weight]] | Sends the players weight amount. |- | 241 | VARIABLE_SHORT | N/A | [[317:Construct map region|Construct map region]] | Constructs a dynamic map region using a palette of 8*8 tiles. |- | 246 | FIXED | 6 | [[317:Interface item|Interface item]] | Displays an item model inside an interface. |- | 248 | FIXED | 4 | [[317:Inventory overlay|Inventory overlay]] | Displays an interface over the sidebar area. |- | 249 | FIXED | 3 | [[317:Initialize player|Initialize player]] | Sends the player's membership status and their current index on the server's player list. |- | 253 | VARIABLE_BYTE | N/A | [[317:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 254 | VARIABLE_BYTE | N/A | [[317:Display hint icon|Display hint icon]] | Displays a hint icon. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 0 | FIXED | 0 | [[317:Idle|Idle]] | Sent when there are no actions being performed by the player for this cycle. |- | 3 | FIXED | 1 | [[317:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 4 | VARIABLE BYTE | N/A | [[317:Chat|Chat]] | Sent when the player enters a chat message. |- | 14 | FIXED | 8 | [[317:Item on player|Item on player]] | Sent when a player uses an item on another player. |- | 16 | FIXED | 1 | [[317:Alternate item option 2|Alternate item option 2]] | Sent when a player uses an item. This is an alternate item option. |- | 17 | FIXED | 2 | [[317:NPC action 2|NPC action 2]] | Sent when a player clicks the second option of an NPC. |- | 18 | FIXED | 2 | [[317:NPC action 4|NPC action 4]] | Sent when a player clicks the fourth option of an NPC. |- | 21 | FIXED | 2 | [[317:NPC action 3|NPC action 3]] | Sent when a player clicks the third option of an NPC. |- | 25 | FIXED | 10 | [[317:Item on floor|Item on floor]] | Sent when a player uses an item on another item thats on the floor. |- | 39 | FIXED | 2 | [[317:Trade answer|Trade answer]] | Sent when a player answers a trade request from another player. |- | 40 | FIXED | N/A | [[317:NPC Dialogue|NpcDialogue]] | Sent when a player clicks the "Click here to continue" on any dialogue. |- | 41 | FIXED | 6 | [[317:Equip item|Equip item]] | Sent when a player equips an item. |- | 43 | FIXED | 6 | [[317:Bank 10 items|Bank 10 items]] | Sent when a player banks 10 of a certain item. |- | 53 | FIXED | 4 | [[317:Item on item|Item on item]] | Sent when a player uses an item with another item. |- | 70 | FIXED | 6 | [[317:Object action 3|Object action 3]] | Sent when the player clicks the third action available for an object. |- | 72 | FIXED | 2 | [[317:Attack (NPC)|Attack (NPC)]] | Sent when a player attacks an NPC. |- | 73 | FIXED | 2 | [[317:Trade request|Trade request]] | Sent when a player requests a trade with another player. |- | 74 | FIXED | 8 | [[317:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 79 | FIXED | 6 | [[317:Light item|Light item]] | Sent when a player attempts to light logs on fire. |- | 86 | FIXED | 4 | [[317:Camera movement|Camera movement]] | Sent when the player moves the camera. |- | 87 | FIXED | 6 | [[317:Drop item|Drop item]] | Sent when a player wants to drop an item onto the ground. |- | 95 | FIXED | 3 | [[317:Privacy options|Privacy options]] | Sent when a player changes their privacy options (i.e. public chat). |- | 98 | VARIABLE_BYTE | N/A | [[317:Walk on command|Walk on command]] | Sent when the player should walk somewhere according to a certain action performed, such as clicking an object. |- | 101 | FIXED | 13 | [[317:Design screen|Design screen]] | Sent when a player is choosing their character design options. |- | 103 | VARIABLE_BYTE | N/A | [[317:Player command|Player command]] | Sent when the player enters a command in the chat box (e.g. "::command") |- | 117 | FIXED | 6 | [[317:Bank 5 items|Bank 5 items]] | Sent when a player banks 5 of a certain item. |- | 121 | FIXED | 0 | [[317:Loading finished|Loading finished]] | Sent when the client finishes loading a map region. |- | 122 | FIXED | 6 | [[317:Item action 1|Item action 1]] | Sent when the player clicks the first option of an item, such as "Bury" for bones. |- | 126 | VARIABLE BYTE | N/A | [[317:Private message|Private message]] | Sent when a player sends a private message to another player. |- | 129 | FIXED | 6 | [[317:Bank all items|Bank all items]] | Sent when a player banks all of a certain item that they have in their inventory. |- | 130 | FIXED | 0 | [[317:Close window|Close window]] | Sent when a player presses the close, exit or cancel button on an interface. |- | 131 | FIXED | 4 | [[317:Mage NPC|Mage NPC]] | Sent when a player uses magic attacks on an NPC. |- | 132 | FIXED | 6 | [[317:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 133 | FIXED | 8 | [[317:Add ignore|Add ignore]] | Sent when a player adds a player to their ignore list. |- | 135 | FIXED | 6 | [[317:Bank X items part-1|Bank X items part-1]] | Sent when a player requests to bank an X amount of items. |- | 139 | FIXED | 2 | [[317:Follow|Follow]] | Sent when a player clicks the follow option on another player. |- | 145 | FIXED | 6 | [[317:Unequip item|Unequip item]] | Sent when a player unequips an item. |- | 155 | FIXED | 2 | [[317:NPC action 1|NPC action 1]] | Sent when a player clicks first option of an NPC, such as "Talk." |- | 164 | VARIABLE_BYTE | N/A | [[317:Regular walk|Regular walk]] | Sent when the player walks regularly. |- | 185 | FIXED | 2 | [[317:Button click|Button click]] | Sent when a player clicks an in-game button. |- | 188 | FIXED | 8 | [[317:Add friend|Add friend]] | Sent when a player adds a friend to their friend list. |- | 192 | FIXED | 12 | [[317:Item on object|Item on object]] | Sent when a a player uses an item on an object. |- | 202 | FIXED | 0 | [[317:Idle logout|Idle logout]] | Sent when the player has become idle and should be logged out. |- | 208 | FIXED | 4 | [[317:Bank X items part-2|Bank X items part-2]] | Sent when a player enters an X amount of items they want to bank. |- | 210 | FIXED | 0 | [[317:Region change|Region change]] | Sent when a player enters a new map region. |- | 214 | FIXED | 7 | [[317:Move item|Move item]] | Sent when a player moves an item from one slot to another. |- | 215 | FIXED | 8 | [[317:Remove friend|Remove friend]] | Sent when a player removes a friend from their friend list. |- | 218 | FIXED | 8 | [[317:Report player|Report player]] | Sent when a player reports another player. |- | 236 | FIXED | 6 | [[317:Pickup ground item|Pickup ground item]] | Sent when the player picks up an item from the ground. |- | 237 | FIXED | 8 | [[317:Magic on items|Magic on items]] | Sent when a player casts magic on the items in their inventory. |- | 241 | FIXED | 4 | [[317:Mouse click|Mouse click]] | Sent when the player clicks somewhere on the game screen. |- | 248 | VARIABLE_BYTE | N/A | [[317:Map walk|Map walk]] | Sent when the player walks using the map. Has 14 additional (assumed to be anticheat) bytes added to the end of it that are ignored. |- | 249 | FIXED | 4 | [[317:Magic on player|Magic on player]] | Sent when a player attempts to cast magic on another player. |- | 252 | FIXED | 6 | [[317:Object action 2|Object action 2]] | Sent when the player clicks the second option available for an object. |- | 253 | FIXED | 6 | [[317:Ground Item Action|Ground Item Action]] | Sent when the player clicks the first option for a ground item (I.E. 'Light Logs') |- |} Category:Packet:317 14 112 rantauiusihx1pa5j2oq3c19re05y3c 239 2011-06-26T18:44:08Z Admin 1 Created page with "317 Packets" 317 Packets 240 2011-06-26T18:45:02Z Admin 1 317 Packets e 241 2011-06-26T18:45:09Z Admin 1 317 Packets 289:Player Dialogue Head 0 595 rz02kr48mhewexoz0uquiuyjtt4c6te 1528 2014-11-23T03:00:11Z Bl3nd 326 Created page with "{{packet|name=Send Player Head|description=Sends player's head on an interface|opcode=185|type=Fixed|length=5|revision=317}} == Player Dialogue Head == === Description === T..." {{packet|name=Send Player Head|description=Sends player's head on an interface|opcode=185|type=Fixed|length=5|revision=317}} == Player Dialogue Head == === Description === This packet sends the player head to an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The status of the friends list. |- |} ==== Values ==== The below are the different values for this packet. {| border=2 ! Value ! Response |- | 0 | Loading |- | 1 | Connecting |- | 2 | Loaded |- |} 317:Add friend 0 93 4yqqofebpvbelja9qs2x8pzz3dngfki 205 2011-06-26T18:03:52Z Admin 1 Created page with "{{packet|name=Add friend|description=Sent when a player adds a friend to their friends list.|opcode=188|type=Fixed|length=8|revision=317}} == Add Friend == === Description === ..." {{packet|name=Add friend|description=Sent when a player adds a friend to their friends list.|opcode=188|type=Fixed|length=8|revision=317}} == Add Friend == === Description === This packet is sent when a player adds a friend to their friends list. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The other players ID. |- |} 317:Add ignore 0 87 cauow0hx6rcabnj294z6k227e6b8l3k 199 2011-06-26T18:02:14Z Admin 1 Created page with "{{packet|name=Add ignore|description=Sent when a player adds another player to their ignore list.|opcode=133|type=Fixed|length=8|revision=317}} == Add Ignore == === Description ..." {{packet|name=Add ignore|description=Sent when a player adds another player to their ignore list.|opcode=133|type=Fixed|length=8|revision=317}} == Add Ignore == === Description === This packet is sent when a player adds another player to their ignore list. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The other players ID. |- |} 317:Alternate item option 2 0 125 mzwy3ixyg0djmjyszeafgbu75qqyt80 307 2011-10-03T04:19:41Z The Wanderer 13 Created page with "== Alternate Item Option 2 == === Description === This packet is sent when a player clicks the alternate second option of an item. === Packet Structure === {|border=2 ! Data T..." == Alternate Item Option 2 == === Description === This packet is sent when a player clicks the alternate second option of an item. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The ID of the item. |- |- | [[Data_Types#Little_Endian|Little Endian]] [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot the item is in. |- |- | [[Data_Types#Little_Endian|Little Endian]] [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- |} 308 2011-10-03T04:21:51Z The Wanderer 13 {{packet|name=Alternate Item Option 2|description=Sent when the player clicks the alternate second option of an item.|opcode=16|type=Fixed|length=6|revision=317}} == Alternate Item Option 2 == === Description === This packet is sent when a player clicks the alternate second option of an item. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The ID of the item. |- |- | [[Data_Types#Little_Endian|Little Endian]] [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot the item is in. |- |- | [[Data_Types#Little_Endian|Little Endian]] [[Data Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- |} 317:Animation reset 0 32 39icpdl3rgi7vqzda0nwjy792kqtv4x 144 2011-06-26T17:44:08Z Admin 1 Created page with "{{packet|name=Animation reset|description=Resets all animations in the immediate area. |opcode=1|type=Fixed|length=0|revision=317}} == Animation Reset == === Description === Re..." {{packet|name=Animation reset|description=Resets all animations in the immediate area. |opcode=1|type=Fixed|length=0|revision=317}} == Animation Reset == === Description === Resets all animations for players and npcs in the surrounding area. 317:Attack (NPC) 0 72 rlyl64ulcr5x1w30nbjf4onrbh2jyc6 184 2011-06-26T17:58:10Z Admin 1 Created page with "{{packet|name=Attack (NPC)|description=Sent when a player attacks an NPC|opcode=72|type=Fixed|length=2|revision=317}} == Attack (NPC) == === Description === This packet is sent..." {{packet|name=Attack (NPC)|description=Sent when a player attacks an NPC|opcode=72|type=Fixed|length=2|revision=317}} == Attack (NPC) == === Description === This packet is sent when a player attacks an NPC. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The NPC ID. |- |} 317:Audio 0 642 2qlbd337z8kgaf7ea54oxz8mkygfl50 1599 2015-01-06T03:45:34Z Bl3nd 326 Created page with "{{packet|name=Audio|description=Sets what audio/sound is to play at a certain moment.|opcode=147|type=Fixed|length=N/A|revision=317}} == Audio == === Description === Sets wh..." {{packet|name=Audio|description=Sets what audio/sound is to play at a certain moment.|opcode=147|type=Fixed|length=N/A|revision=317}} == Audio == === Description === Sets what audio/sound is to play at a certain moment. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Word|Word]] | The sound id. |- | [[Data Types#Byte|Byte]] | The volume. |- | [[Data Types#Word|Word]] | The delay. |- |} 317:Bank 10 items 0 69 lwran1o9wkozsacg51w8zvgm11fy91y 181 2011-06-26T17:57:25Z Admin 1 Created page with "{{packet|name=Bank 10 items|description=Sent when a player banks 10 of a certain item.|opcode=43|type=Fixed|length=6|revision=317}} == Bank 10 Items == === Description === This..." {{packet|name=Bank 10 items|description=Sent when a player banks 10 of a certain item.|opcode=43|type=Fixed|length=6|revision=317}} == Bank 10 Items == === Description === This packet is sent when the player attempts to bank 10 of a certain item.<br> '''Note:''' This packet is also used for selling/buying 5 of an item from a shop. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot ID. |} 339 2011-12-05T07:22:43Z Zuppers 28 /* Packet Structure */ {{packet|name=Bank 10 items|description=Sent when a player banks 10 of a certain item.|opcode=43|type=Fixed|length=6|revision=317}} == Bank 10 Items == === Description === This packet is sent when the player attempts to bank 10 of a certain item.<br> '''Note:''' This packet is also used for selling/buying 5 of an item from a shop. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot ID. |} 317:Bank 5 items 0 81 9bcxje9k8ftnqvqi68f1hd3dumo4ezw 193 2011-06-26T18:00:45Z Admin 1 Created page with "{{packet|name=Bank 5 items|description=Sent when a player attempts to bank 5 of a certain item.|opcode=117|type=Fixed|length=6|revision=317}} == Bank 5 Items == === Description ..." {{packet|name=Bank 5 items|description=Sent when a player attempts to bank 5 of a certain item.|opcode=117|type=Fixed|length=6|revision=317}} == Bank 5 Items == === Description === This packet is sent when a player attempts to bank 5 of a certain item.<br> '''Note:''' This packet is also used for buying/selling 1 of an item from a shop. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The slot ID. |- |} 317:Bank all items 0 84 et5xjub9ov3oo1k54mec7pjqg86ubxk 196 2011-06-26T18:01:28Z Admin 1 Created page with "{{packet|name=Bank all items|description=Sent when a player banks all of a certain item they have in their inventory.|opcode=129|type=Fixed|length=6|revision=317}} == Bank 10 Ite..." {{packet|name=Bank all items|description=Sent when a player banks all of a certain item they have in their inventory.|opcode=129|type=Fixed|length=6|revision=317}} == Bank 10 Items == === Description === This packet is sent when a player banks all of a certain item they have in their inventory. <br> '''Note:''' This packet is also used for selling/buying 10 items at a shop. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The items slot ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] | The interface ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- |} 317:Bank X items part-1 0 88 0uzmp5jsrz6dcrs5ezoqi5f77ii48l3 200 2011-06-26T18:02:29Z Admin 1 Created page with "{{packet|name=Bank x items part-1|description=Sent when a player requests to bank an X amount of items.|opcode=135|type=Fixed|length=6|revision=317}} == Bank X Items Part-1 == =..." {{packet|name=Bank x items part-1|description=Sent when a player requests to bank an X amount of items.|opcode=135|type=Fixed|length=6|revision=317}} == Bank X Items Part-1 == === Description === This packet is sent when a player requests to bank an X amount of items. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The items slot. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The item ID. |- |} 317:Bank X items part-2 0 96 ccpspg3lqb5ril1ifh4m4y8cil8z8tk 208 2011-06-26T18:04:32Z Admin 1 Created page with "{{packet|name=bank x items part-2|description=Sent when a player enters an X amount of items they want to bank.|opcode=208|type=Fixed|length=4|revision=317}} == Bank X Items Part..." {{packet|name=bank x items part-2|description=Sent when a player enters an X amount of items they want to bank.|opcode=208|type=Fixed|length=4|revision=317}} == Bank X Items Part-2 == === Description === This packet is sent when a player enters an X amount of items they want to bank. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Integer]] | The amount of the item you want to bank. |- |} 317:Button click 0 92 eexjzm8gn0fwdwxqedhzmy7onual43d 204 2011-06-26T18:03:39Z Admin 1 Created page with "{{packet|name=Button click|description=Sent when a player clicks an in-game button.|opcode=185|type=Fixed|length=2|revision=317}} == Button click == === Description === This is..." {{packet|name=Button click|description=Sent when a player clicks an in-game button.|opcode=185|type=Fixed|length=2|revision=317}} == Button click == === Description === This is sent when a player clicks a button in-game, with the id of the button being clicked. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The button id. |- |} 317:Camera movement 0 76 n52ak056idm0dzg8kdwkrkdsr9hkd2d 188 2011-06-26T17:59:12Z Admin 1 Created page with "{{packet|name=Camera movement|description=Sent when the player moves the camera.|opcode=86|type=Fixed|length=4|revision=317}} == Camera Movement == === Description === This pac..." {{packet|name=Camera movement|description=Sent when the player moves the camera.|opcode=86|type=Fixed|length=4|revision=317}} == Camera Movement == === Description === This packet is sent when a player moves their game camera. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The Y coordinate of the camera. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The X coordinate of the camera. |- |} 317:Camera shake 0 36 c7wjtxhlha7o1cay5zso6ktd96vxqvn 148 2011-06-26T17:46:16Z Admin 1 Created page with "== Camera Shake == === Description === Causes the camera to shake." == Camera Shake == === Description === Causes the camera to shake. 347 2012-01-05T17:42:58Z Dane 30 {{packet|name=Camera Shake|description=Makes the camera shake.|opcode=35|type=Fixed|length=4|revision=317}} == Load Map Region == === Description === description=Makes the camera shake. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Shake Type |- | [[Data_Types#Standard_data_types|Byte]] | Magnitude 1 |- | [[Data_Types#Standard_data_types|Byte]] | Magnitude 2 |- | [[Data_Types#Standard_data_types|Byte]] | Magnitude 3 |- |} === Other Information === There are various loops/arrays within the map region loading functionality of the client which have been misunderstood by many. {| border=2 ! Shake Type ! Description |- | 0 | Shakes only on the X axis. (Camera Position) |- | 1 | Shakes only on the Z axis. (Camera Position) |- | 2 | Shakes only on the Y axis. (Camera Position) |- | 3 | Shakes only on the X curve. (Camera Curve?) |- | 4 | Shakes only on the Y curve. (Camera Curve?) |- |} === What it's doing === Below will show you the calculations it's doing to modify the screen's position to emulate an earthquake or just a shiver or shake. {| border=2 ! Calculation ! Formula |- | Magnitude | ((Math.random() * (double)(Magnitude1[ShakeType] * 2 + 1) - (double)Magnitude1[ShakeType]) + Math.sin((double) anIntArray1030[ShakeType] * 3 ((double) Magnitude3[ShakeType] / 100D)) * Magnitude2[ShakeType]) |- |} === Shake Types === {| border=2 ! Shake Type ! Action |- | 0 | xCameraPos += [[Magnitude|Magnitude]] |- | 1 | zCameraPos += [[Magnitude|Magnitude]] |- | 2 | yCameraPos += [[Magnitude|Magnitude]] |- | 3 | xCameraCurve = xCameraCurve + [[Magnitude|Magnitude]] & 0x7ff; |- | 4 | yCameraCurve += [[Magnitude|Magnitude]] |- |} === Note === For shake type four it checks the yCameraCurve to make sure it's not out of bounds: {| border=2 |- |if (yCameraCurve < 128) then yCameraCurve = 128 |- |if (yCameraCurve > 383) then yCameraCurve = 383 |- |} 423 2012-07-28T13:44:56Z Veeer 74 {{packet|name=Camera Oscillate|description=Makes the camera shake.|opcode=35|type=Fixed|length=4|revision=317}} == Load Map Region == === Description === description=Begins camera oscillation, which is implemented using a configurable sinusoidal oscillator that advances once per render. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Parameter (camera X, Z, Y, yaw, pitch) |- | [[Data_Types#Standard_data_types|Byte]] | Jitter - for randomization |- | [[Data_Types#Standard_data_types|Byte]] | Amplitude |- | [[Data_Types#Standard_data_types|Byte]] | Frequency (scaled by 100) |- |} === Other Information === The oscillate event enables the client to oscillate one of 5 of it's position parameters, i.e. corresponding to the camera's degrees of freedom; parameters 0, 1, and 2 refer to the location of the camera, while 3 and 4 deal with the camera's orientation. Together, these enable complex effects involving manipulation of the camera position to give rise to simulated earth-quakes and camera shock. {| border=2 ! Parameter ! Description |- | 0 | Camera location along world X axis (a horizontal axis, aligned with map grid X) |- | 1 | Camera location along world Z axis (vertical axis) |- | 2 | Camera location along world Y axis (a horizontal axis, aligned with map grid Y) |- | 3 | Camera orientation in world X plane w.r.t. world Z axis, i.e. yaw |- | 4 | Camera orientation in world Z plane w.r.t. world X axis, i.e. pitch |- |} Note there is no built-in way to manipulate camera roll, as this is not one of the camera's degrees of freedom. === What it's doing === Every time the world is rendered, each camera parameter that is enabled for oscillation is offset by a value computed as follows: {| border=2 ! Calculation ! Formula |- | Delta | (int) ((Math.random() * (double) (jitter * 2 + 1) - (double) jitter) + Math.sin((double) phase * ((double) frequency / 100D)) * (double) amplitude); |- |} Each parameter's phase accumulator (phase) is incremented by 1 each logic update. === Parameter === The offset itself is detailed as follows for each parameter: {| border=2 ! Parameter ! Action |- | 0 | camera_x += delta |- | 1 | camera_z += delta |- | 2 | camera_y += delta |- | 3 | camera_yaw = camera_yaw + delta & 0x7ff; |- | 4 | camera_pitch += delta |- |} Note that the camera's yaw is corrected modulo 0x7ff, or 2048, which is equivalent to 2{{{pi}}} radians in Jagex's binary angle system. This is not done to the camera pitch, which is instead clamped (see below). === Note === For oscillating the camera pitch, clamping is done to ensure the angle not out of bounds: {| border=2 |- |if (camera_pitch < 128) then camera_pitch = 128 |- |if (camera_pitch > 383) then camera_pitch = 383 |- |} This is do to Jagex restricting the possible range of orientations the camera may take. 424 2012-07-28T13:46:28Z Veeer 74 {{packet|name=Camera oscillate|description=Begin camera oscillation|opcode=35|type=Fixed|length=4|revision=317}} == Camera oscillate == === Description === description=Begins camera oscillation, which is implemented using a configurable sinusoidal oscillator to offset a specific degree of freedom. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Parameter (camera X, Z, Y, yaw, pitch) |- | [[Data_Types#Standard_data_types|Byte]] | Jitter - for randomization |- | [[Data_Types#Standard_data_types|Byte]] | Amplitude |- | [[Data_Types#Standard_data_types|Byte]] | Frequency (scaled by 100) |- |} === Other Information === The oscillate event enables the client to oscillate one of 5 of it's position parameters, i.e. corresponding to the camera's degrees of freedom; parameters 0, 1, and 2 refer to the location of the camera, while 3 and 4 deal with the camera's orientation. Together, these enable complex effects involving manipulation of the camera position to give rise to simulated earth-quakes and camera shock. {| border=2 ! Parameter ! Description |- | 0 | Camera location along world X axis (a horizontal axis, aligned with map grid X) |- | 1 | Camera location along world Z axis (vertical axis) |- | 2 | Camera location along world Y axis (a horizontal axis, aligned with map grid Y) |- | 3 | Camera orientation in world X plane w.r.t. world Z axis, i.e. yaw |- | 4 | Camera orientation in world Z plane w.r.t. world X axis, i.e. pitch |- |} Note there is no built-in way to manipulate camera roll, as this is not one of the camera's degrees of freedom. === What it's doing === Every time the world is rendered, each camera parameter that is enabled for oscillation is offset by a value computed as follows: {| border=2 ! Calculation ! Formula |- | Delta | (int) ((Math.random() * (double) (jitter * 2 + 1) - (double) jitter) + Math.sin((double) phase * ((double) frequency / 100D)) * (double) amplitude); |- |} Each parameter's phase accumulator (phase) is incremented by 1 each logic update. === Parameter === The offset itself is detailed as follows for each parameter: {| border=2 ! Parameter ! Action |- | 0 | camera_x += delta |- | 1 | camera_z += delta |- | 2 | camera_y += delta |- | 3 | camera_yaw = camera_yaw + delta & 0x7ff; |- | 4 | camera_pitch += delta |- |} Note that the camera's yaw is corrected modulo 0x7ff, or 2048, which is equivalent to 2{{{pi}}} radians in Jagex's binary angle system. This is not done to the camera pitch, which is instead clamped (see below). === Note === For oscillating the camera pitch, clamping is done to ensure the angle not out of bounds: {| border=2 |- |if (camera_pitch < 128) then camera_pitch = 128 |- |if (camera_pitch > 383) then camera_pitch = 383 |- |} This is do to Jagex restricting the possible range of orientations the camera may take. 425 2012-07-28T13:48:01Z Veeer 74 {{packet|name=Camera oscillate|description=Begin camera oscillation|opcode=35|type=Fixed|length=4|revision=317}} == Camera oscillate == === Description === Begins camera oscillation, which is implemented using a configurable sinusoidal oscillator to offset a specific degree of freedom. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Parameter (camera X, Z, Y, yaw, pitch) |- | [[Data_Types#Standard_data_types|Byte]] | Jitter - for randomization |- | [[Data_Types#Standard_data_types|Byte]] | Amplitude |- | [[Data_Types#Standard_data_types|Byte]] | Frequency (scaled by 100) |- |} === Other Information === The oscillate event enables the client to oscillate one of 5 of it's position parameters, i.e. corresponding to the camera's degrees of freedom; parameters 0, 1, and 2 refer to the location of the camera, while 3 and 4 deal with the camera's orientation. Together, these enable complex effects involving manipulation of the camera position to give rise to simulated earth-quakes and camera shock. {| border=2 ! Parameter ! Description |- | 0 | Camera location along world X axis (a horizontal axis, aligned with map grid X) |- | 1 | Camera location along world Z axis (vertical axis) |- | 2 | Camera location along world Y axis (a horizontal axis, aligned with map grid Y) |- | 3 | Camera orientation in world X plane w.r.t. world Z axis, i.e. yaw |- | 4 | Camera orientation in world Z plane w.r.t. world X axis, i.e. pitch |- |} Note there is no built-in way to manipulate camera roll, as this is not one of the camera's degrees of freedom. === What it's doing === Every time the world is rendered, each camera parameter that is enabled for oscillation is offset by a value computed as follows: {| border=2 ! Calculation ! Formula |- | Delta | (int) ((Math.random() * (double) (jitter * 2 + 1) - (double) jitter) + Math.sin((double) phase * ((double) frequency / 100D)) * (double) amplitude); |- |} Each parameter's phase accumulator (phase) is incremented by 1 each logic update. === Parameter === The offset itself is detailed as follows for each parameter: {| border=2 ! Parameter ! Action |- | 0 | camera_x += delta |- | 1 | camera_z += delta |- | 2 | camera_y += delta |- | 3 | camera_yaw = camera_yaw + delta & 0x7ff; |- | 4 | camera_pitch += delta |- |} Note that the camera's yaw is corrected modulo 0x7ff, or 2048, which is equivalent to 2{{{pi}}} radians in Jagex's binary angle system. This is not done to the camera pitch, which is instead clamped (see below). === Note === For oscillating the camera pitch, clamping is done to ensure the angle not out of bounds: {| border=2 |- |if (camera_pitch < 128) then camera_pitch = 128 |- |if (camera_pitch > 383) then camera_pitch = 383 |- |} This is do to Jagex restricting the possible range of orientations the camera may take. 317:Chat interface 0 49 t0s9k9sfbh8exp674kun839bmq80w9n 161 2011-06-26T17:51:08Z Admin 1 Created page with "{{packet|name=Chat interface|description=Shows an interface in the chat box.|opcode=164|type=Fixed|length=2|revision=317}} == Chat Interface == === Description === This packet ..." {{packet|name=Chat interface|description=Shows an interface in the chat box.|opcode=164|type=Fixed|length=2|revision=317}} == Chat Interface == === Description === This packet attaches an interface to the chat box. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The interface ID. |- |} 317:Chat interface click 0 245 8lvolfglq6ivphtaat1op4b7fl332xq 936 2014-02-15T17:36:51Z Pure 316 Created page with "{{packet|name=Chat interface click|description=Received when a button is pressed, in a chat interface.|opcode=40|type=Fixed|length=2|revision=317}} === Description === Recei..." {{packet|name=Chat interface click|description=Received when a button is pressed, in a chat interface.|opcode=40|type=Fixed|length=2|revision=317}} === Description === Received by the server when a button is pressed in a chat interface [http://rswiki.moparisthebest.com/index.php?title=317:Chat_interface]. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | Frame ID. |- |} 937 2014-02-15T17:37:07Z Pure 316 {{packet|name=Chat interface click|description=Received when a button is pressed, in a chat interface.|opcode=40|type=Fixed|length=2|revision=317}} === Chat interface click === === Description === Received by the server when a button is pressed in a chat interface [http://rswiki.moparisthebest.com/index.php?title=317:Chat_interface]. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | Frame ID. |- |} 938 2014-02-15T17:37:29Z Pure 316 {{packet|name=Chat interface click|description=Received when a button is pressed, in a chat interface.|opcode=40|type=Fixed|length=2|revision=317}} == Chat interface click == === Description === Received by the server when a button is pressed in a chat interface [http://rswiki.moparisthebest.com/index.php?title=317:Chat_interface]. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | Frame ID. |- |} 317:Chat settings 0 51 16m89yjwseckk54xyqu4r4sdgrsslze 163 2011-06-26T17:52:06Z Admin 1 Created page with "{{packet|name=Chat settings|description=Sends the chat privacy settings|opcode=206|type=Fixed|length=3|revision=317}} == Chat Settings == === Description === This packet sends ..." {{packet|name=Chat settings|description=Sends the chat privacy settings|opcode=206|type=Fixed|length=3|revision=317}} == Chat Settings == === Description === This packet sends the chat privacy settings. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Public chat setting. |- | [[Data Types#Standard data types|Byte]] | Private chat setting. |- | [[Data Types#Standard data types|Byte]] | Trade setting. |- |} 317:Clear inventory 0 132 rrignlix3tf0yfe3632yuoclwrvocfl 343 2012-01-05T16:42:20Z Dane 30 Created page with "{{packet|name=Clear Inventory|description=Used to set all of the items and item stacks in an inventory to nothing.|opcode=72|type=Fixed|length=2|revision=317}} == Interface Color..." {{packet|name=Clear Inventory|description=Used to set all of the items and item stacks in an inventory to nothing.|opcode=72|type=Fixed|length=2|revision=317}} == Interface Color == === Description === This packet creates a loop through a given inventory interface id and sets the item ids to negative one and the item stacks to zero. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]]]] | The interface ID. |- |} 344 2012-01-05T16:42:44Z Dane 30 {{packet|name=Clear Inventory|description=Used to set all of the items and item stacks in an inventory to nothing.|opcode=72|type=Fixed|length=2|revision=317}} == Interface Color == === Description === This packet creates a loop through a given inventory interface id and sets the item ids to negative one and the item stacks to zero. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]] | The interface ID. |- |} 832 2013-03-24T15:38:14Z Ambokile 138 {{packet|name=Clear Inventory|description=Used to set all of the items and item stacks in an inventory to nothing.|opcode=72|type=Fixed|length=2|revision=317}} == Clear inventory == === Description === This packet creates a loop through a given inventory interface id and sets the item ids to negative one and the item stacks to zero. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]] | The interface ID. |- |} 1129 2014-06-17T16:17:40Z Pure 316 {{packet|name=Clear Inventory|description=Used to set all of the items and item stacks in an inventory to nothing.|opcode=72|type=Fixed|length=2|revision=317}} == Clear inventory == === Description === This packet creates a loop through a given inventory interface id and sets the item ids to negative one and the item stacks to zero. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The interface ID. |- |} 317:Clear screen 0 53 qhbzsq6qooyhv6vtol6fhfh7y32k2nh 165 2011-06-26T17:52:39Z Admin 1 Created page with "{{packet|name=Clear screen|description=Clears the screen of all open interfaces.|opcode=219|type=Fixed|length=0|revision=317}} == Clear Screen == === Description === Removes al..." {{packet|name=Clear screen|description=Clears the screen of all open interfaces.|opcode=219|type=Fixed|length=0|revision=317}} == Clear Screen == === Description === Removes all open interfaces from the players screen. 317:Close window 0 85 gqwmx18xvr9in813ldx13oji6o0k7m4 197 2011-06-26T18:01:44Z Admin 1 Created page with "{{packet|name=Close window|description=Sent when a player presses the close, exit or cancel button on an interface.|opcode=130|type=Fixed|length=0|revision=317}} == Close Window ..." {{packet|name=Close window|description=Sent when a player presses the close, exit or cancel button on an interface.|opcode=130|type=Fixed|length=0|revision=317}} == Close Window == === Description === This packet is sent when a player presses the close, exit or cancel button on an interface. 317:Construct map region 0 56 9dlju9flsnqmkqvb858b5jcjg5vgdev 168 2011-06-26T17:53:22Z Admin 1 Created page with "{{packet|name=Construct map region|description=Constructs a new map region from a palette of 8x8 tiles.|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map ..." {{packet|name=Construct map region|description=Constructs a new map region from a palette of 8x8 tiles.|opcode=241|type=Variable Short|length=N/A|revision=317}} == Construct Map Region == === Description === The construct map region packet sends a dynamic map region that is constructed by using groups of 8*8 tiles. It is generally used for instanced areas, such as fight caves, and in later revisions, player owned houses. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The region Y coordinate (absolute Y coordinate / 8), plus 6. |- | [[#Bit block|Bit block]] | See below. |- | [[Data_Types#Standard_data_types|Short]] | The region X coordinate (absolute X coordinate / 8), plus 6. |} ==== Bit block ==== The bit block actually contains the 'palette' of map regions to make up the new region. There is a loop, like this, used to construct it: for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { // data for this region } } } The individual format in each iteration of the loop is: * '''1 bit''' - set to 0 to indicate to display nothing, 1 to display a region * '''26 bits''' - if the flag above is set to 1 - region x << 14 | region y << 3 317:Design screen 0 79 9a5akrzf0h7tccnxsdtuyezs6bkrwgf 191 2011-06-26T18:00:14Z Admin 1 Created page with "{{packet|name=Design screen|description=Sent when a player is choosing their character design options.|opcode=101|type=Fixed|length=13|revision=317}} == Design Screen == === Des..." {{packet|name=Design screen|description=Sent when a player is choosing their character design options.|opcode=101|type=Fixed|length=13|revision=317}} == Design Screen == === Description === This packet is sent when a player is choosing their character design options. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The players gender. |- | [[Data_Types#Standard_data_types|Byte]] | The players head model. |- | [[Data_Types#Standard_data_types|Byte]] | The players beard model. |- | [[Data_Types#Standard_data_types|Byte]] | The players torso model. |- | [[Data_Types#Standard_data_types|Byte]] | The players arm model. |- | [[Data_Types#Standard_data_types|Byte]] | The players hand model. |- | [[Data_Types#Standard_data_types|Byte]] | The players leg model |- | [[Data_Types#Standard_data_types|Byte]] | The players foot model. |- | [[Data_Types#Standard_data_types|Byte]] | The players hair color. |- | [[Data_Types#Standard_data_types|Byte]] | The players torso color. |- | [[Data_Types#Standard_data_types|Byte]] | The players leg color. |- | [[Data_Types#Standard_data_types|Byte]] | The players foot color. |- | [[Data_Types#Standard_data_types|Byte]] | The players skin color. |- |} 317:Display hint icon 0 420 e5knd70lzdzq1mgbspmgmuy62zfdqvw 1295 2014-08-09T02:21:19Z Bl3nd 326 Created page with "== Display Hint Icon == === Description === Displays a hint icon. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte..." == Display Hint Icon == === Description === Displays a hint icon. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The Icon type. |- |} === if type == 1 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon NPC target. |- |} === if type >= 2 && type <= 6 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon X. |- | [[Data_Types#Standard_data_type|Short]] | Icon Y. |- | [[Data_Types#Standard_data_types|Byte]] | Icon draw height. |- |} === if type == 10 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon player target. |- |} 1299 2014-08-09T20:01:19Z Ambokile 138 {{packet|name=Display hint icon|description=Display a hint icon to the player.|opcode=254|type=Variable Byte|length=N/A|revision=317}} == Display Hint Icon == === Description === Displays a hint icon. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The Icon type. |- |} === if type == 1 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon NPC target. |- |} === if type >= 2 && type <= 6 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon X. |- | [[Data_Types#Standard_data_type|Short]] | Icon Y. |- | [[Data_Types#Standard_data_types|Byte]] | Icon draw height. |- |} === if type == 10 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon player target. |- |} 1316 2014-08-11T03:54:06Z Bl3nd 326 /* Display Hint Icon */ {{packet|name=Display hint icon|description=Display a hint icon to the player.|opcode=254|type=Variable Byte|length=N/A|revision=317}} == Display Hint Icon == === Description === Displays a hint icon. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The Icon type |- |} === if type == 1 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon NPC target |- |} === if type >= 2 && type <= 6 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon X |- | [[Data_Types#Standard_data_type|Short]] | Icon Y |- | [[Data_Types#Standard_data_types|Byte]] | Icon draw height |- |} === if type == 10 === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_type|Short]] | Icon player target |- |} 317:Drop item 0 77 4lqi57xwcthlebqh8dovilkuhyv5q7b 189 2011-06-26T17:59:28Z Admin 1 Created page with "{{packet|name=Drop item|description=Sent when a player wants to drop an item onto the ground.|opcode=87|type=Fixed|length=6|revision=317}} == Drop Item == === Description === T..." {{packet|name=Drop item|description=Sent when a player wants to drop an item onto the ground.|opcode=87|type=Fixed|length=6|revision=317}} == Drop Item == === Description === This packet is sent when a player wants to drop an item onto the ground. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- | [[Data_Types#Standard_data_types|Short]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot ID. |- |} 317:Enter name 0 227 5yt9h8318aq919eow1pd8qzrmjt74qy 827 2013-03-24T15:29:57Z Ambokile 138 Created page with "{{packet|name=Enter name|description=Opens up the name entry interface. |opcode=187|type=Fixed|length=0|revision=317}} == Enter name == === Description === Sending the packe..." {{packet|name=Enter name|description=Opens up the name entry interface. |opcode=187|type=Fixed|length=0|revision=317}} == Enter name == === Description === Sending the packet to the client will make the client open up the "Enter name" interface for things such as friend-adding. 317:Equip item 0 68 kjtry1dpk43xhcuctdmoo7jjr89vciz 180 2011-06-26T17:57:12Z Admin 1 Created page with "{{packet|name=Equip item|description=Sent when a player equips an item.|opcode=41|type=Fixed|length=6|revision=317}} == Equip Item == === Description === This is sent when a pl..." {{packet|name=Equip item|description=Sent when a player equips an item.|opcode=41|type=Fixed|length=6|revision=317}} == Equip Item == === Description === This is sent when a player equips an item in-game. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The ID of the item. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot of the item. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The ID of the interface. |- |} 387 2012-03-24T23:45:23Z Sini 33 {{packet|name=Equip item|description=Sent when a player equips an item.|opcode=41|type=Fixed|length=6|revision=317}} == Equip Item == === Description === This is sent when a player equips an item in-game. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] | The ID of the item. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot of the item. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The ID of the interface. |- |} 317:Flash sidebar 0 34 kmgb6huuxwagbltxujcbkvfgwrhi5x0 146 2011-06-26T17:45:01Z Admin 1 Created page with "{{packet|name=Flash sidebar|description=Causes a sidebar icon to start flashing.|opcode=24|type=Fixed|length=1|revision=317}} == Flash sidebar == === Description === This packe..." {{packet|name=Flash sidebar|description=Causes a sidebar icon to start flashing.|opcode=24|type=Fixed|length=1|revision=317}} == Flash sidebar == === Description === This packet causes a sidebar icon to start flashing. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Byte]] [[Data Types#Non Standard data types|Special A]] | The sidebar ID. |- |} ==== Values ==== The below are the different values for this packet. {| border=2 ! Value ! Icon |- | 0 || Attack type |- | -1 || Stats |- | -2 || Quests |- | -3 || Inventory |- | -4 || Wearing |- | -5 || Prayer |- | -6 || Magic |- | -7 || '''EMPTY''' |- | -8 || Friends list |- | -9 || Ignore list |- | -10 || Log out |- | -11 || Settings |- | -12 || Emotes |- | -13 || Music |- |} 1134 2014-06-17T16:48:39Z Pure 316 {{packet|name=Flash sidebar|description=Causes a sidebar icon to start flashing.|opcode=24|type=Fixed|length=1|revision=317}} == Flash sidebar == === Description === This packet causes a sidebar icon to start flashing. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Byte]] [[Data Types#Non Standard data types|Special S]] | The sidebar ID. |- |} ==== Values ==== The below are the different values for this packet. {| border=2 ! Value ! Icon |- | 0 || Attack type |- | -1 || Stats |- | -2 || Quests |- | -3 || Inventory |- | -4 || Wearing |- | -5 || Prayer |- | -6 || Magic |- | -7 || '''EMPTY''' |- | -8 || Friends list |- | -9 || Ignore list |- | -10 || Log out |- | -11 || Settings |- | -12 || Emotes |- | -13 || Music |- |} 317:Focus change 0 62 ix5di5n9a2n9ktdtos2a9ufgjfdwinu 174 2011-06-26T17:55:35Z Admin 1 Created page with "{{packet|name=Focus change|description=Sent when the game client window goes in and out of focus.|opcode=3|type=Fixed|length=1|revision=317}} == Focus Change == === Description ..." {{packet|name=Focus change|description=Sent when the game client window goes in and out of focus.|opcode=3|type=Fixed|length=1|revision=317}} == Focus Change == === Description === This packet is sent when the game client window goes in and out of focus. The payload consists of one Byte that is either 1 or 0; 1 if the client is in focus and 0 if not. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Whether or not the client is in focus. |- |} 359 2012-01-22T02:46:19Z Major 26 {{packet|name=Focus change|description=Sent when the game client window goes in and out of focus.|opcode=3|type=Fixed|length=1|revision=317}} == Focus Change == === Description === This packet is sent when the game client window goes in and out of focus. The payload consists of one byte that is either 1 or 0; 1 if the client is in focus and 0 if not. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Whether or not the client is in focus. |- |} 317:Follow 0 67 m4f4f3bx7u2jcwv76n8jfb9twl31yb7 179 2011-06-26T17:56:55Z Admin 1 Created page with "{{packet|name=Follow|description=Sent when a player clicks the follow option on another player|opcode=39|type=Fixed|length=2|revision=317}} == Follow == === Description === Thi..." {{packet|name=Follow|description=Sent when a player clicks the follow option on another player|opcode=39|type=Fixed|length=2|revision=317}} == Follow == === Description === This packet is sent when a player clicks the follow option on another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The other players ID. |- |} 317:Force client setting 0 224 nuf830ihe7ojhmc93m4lkig3p06tyi7 789 2012-12-12T04:33:32Z Scrooge 129 Created page for opcode 36 {{packet|name=Force client setting|description=Forcefully alters a client setting value and default value to some supplied value.|opcode=36|type=Fixed|length=4|revision=317}} == Force Client Setting == === Description === The client stores various user settings in an array of integers of size 2000. The client also stores alternate (default?) values for these settings in a duplicate, equally-sized array. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Byte_Order|Little Endian]] | Setting ID number. |- | [[Data_Types#Standard_data_types|Byte]] | New value (and default value) for the setting. |- |} === Other Information === Opcode 87 is extremely similar in structure, but minute differences suggest that it is instead intended for use with "slider-bars." 790 2012-12-12T04:34:52Z Scrooge 129 Oops. Length is 3, not 4. {{packet|name=Force client setting|description=Forcefully alters a client setting value and default value to some supplied value.|opcode=36|type=Fixed|length=3|revision=317}} == Force Client Setting == === Description === The client stores various user settings in an array of integers of size 2000. The client also stores alternate (default?) values for these settings in a duplicate, equally-sized array. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Byte_Order|Little Endian]] | Setting ID number. |- | [[Data_Types#Standard_data_types|Byte]] | New value (and default value) for the setting. |- |} === Other Information === Opcode 87 is extremely similar in structure, but minute differences suggest that it is instead intended for use with "slider-bars." 1144 2014-06-24T11:49:09Z Pure 316 {{packet|name=Force client setting|description=Forcefully alters a client setting value and default value to some supplied value.|opcode=36|type=Fixed|length=3|revision=317}} == Force Client Setting == === Description === The client stores various user settings in an array, the default values are also stored in another array. This packet changes the default value for a setting and its current value to the one given. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Byte_Order|Little Endian]] | Setting ID number. |- | [[Data_Types#Standard_data_types|Byte]] | New value (and default value) for the setting. |- |} === Other Information === Opcode 87 (length 6) is extremely similar in structure, but the new value is received as an Middle Endian Small Int. This suggests its for use with bigger setting values. 317:Hidden Interface 0 421 6or921j5s71q4mis09d72idksj6sruk 1297 2014-08-09T02:25:59Z Bl3nd 326 Created page with "== Hidden Interface == === Description === Sets an interface to be hidden until hovered over. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Type..." == Hidden Interface == === Description === Sets an interface to be hidden until hovered over. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Hidden until hovered. |- | [[Data_Types#Standard_data_types|Short]] | Interface Id. |- |} 1302 2014-08-09T20:03:42Z Ambokile 138 {{packet|name=Hidden interface|description=Sets an interface to be hidden until hovered over.|opcode=171|type=Fixed|length=3|revision=317}} == Hidden Interface == === Description === Sets an interface to be hidden until hovered over. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Hidden until hovered. |- | [[Data_Types#Standard_data_types|Short]] | Interface Id. |- |} 1317 2014-08-11T03:54:30Z Bl3nd 326 /* Hidden Interface */ {{packet|name=Hidden interface|description=Sets an interface to be hidden until hovered over.|opcode=171|type=Fixed|length=3|revision=317}} == Hidden Interface == === Description === Sets an interface to be hidden until hovered over. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Hidden until hovered |- | [[Data_Types#Standard_data_types|Short]] | Interface Id |- |} 317:Idle 0 61 ah2iflrau7yophqzti7ckv35q78jxdf 173 2011-06-26T17:55:19Z Admin 1 Created page with "{{packet|name=Idle|description=Idle packet..|opcode=0|type=Fixed|length=0|revision=317}} == Idle == === Description === Sent when the player is idle for the current cycle, and ..." {{packet|name=Idle|description=Idle packet..|opcode=0|type=Fixed|length=0|revision=317}} == Idle == === Description === Sent when the player is idle for the current cycle, and acts as a "ping" packet. 317:Idle logout 0 95 gajnqrz8y7vl62kdjrrymt5wn2x7fsy 207 2011-06-26T18:04:19Z Admin 1 Created page with "{{packet|name=Idle logout|description=Sent when the player has become idle and should be logged out. |opcode=202|type=Fixed|length=0|revision=317}} == Idle logout == === Descrip..." {{packet|name=Idle logout|description=Sent when the player has become idle and should be logged out. |opcode=202|type=Fixed|length=0|revision=317}} == Idle logout == === Description === This is sent when the player becomes idle and should be logged out. This is sent after the player is idle for 60 seconds, after that it is sent every 10 seconds as long as the player is idle. 317:Initialize player 0 59 n9f9dr98x3b6qjbcrdrt5nzwl9t6guz 171 2011-06-26T17:54:13Z Admin 1 Created page with "{{packet|name=Initialize player|description=Sends the player's membership status and their current index on the server's player list.|opcode=249|type=Fixed|length=3|revision=317}..." {{packet|name=Initialize player|description=Sends the player's membership status and their current index on the server's player list.|opcode=249|type=Fixed|length=3|revision=317}} == Initialize Player == === Description === Sends the player membership flag and player list index. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Membership flag (1 = member, 0 = free). |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Player list index. |- |} 317:Input amount 0 226 dmkwbecvurw625dl2tm5hxa5yo3lqjh 822 2013-03-24T15:25:31Z Ambokile 138 Created page with "== Animation Reset == === Description === Resets all animations for players and npcs in the surrounding area." == Animation Reset == === Description === Resets all animations for players and npcs in the surrounding area. 823 2013-03-24T15:26:05Z Ambokile 138 /* Animation Reset */ == Input amount == === Description === Opens the "Input amount" interface in the chatbox. 824 2013-03-24T15:27:44Z Ambokile 138 {{packet|name=Input amount|description=Opens up the amount input interface. |opcode=27|type=Fixed|length=0|revision=317}} == Input amount == === Description === Sending the packet to the client will make the client open up the "Input amount" interface over the chatbox for things such as Buy X and Bank X. 317:Interface animation 0 123 6489aweyk0o4p6fb5q62784wfbk45pu 301 2011-08-11T23:11:42Z Supah Fly 15 adding undocumented packet, yo. {{packet|name=Interface animation|description=Sets an interface's model animation|opcode=200|type=Fixed|length=4|revision=317}} == Interface animation == === Description === Sets an interface's model animation. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The interface ID |- | [[Data Types#Standard data types|Short]] | The animation ID |- |} 317:Interface color 0 48 jt5b4k5lp1b8ae757qqrpmeio4d6c62 160 2011-06-26T17:50:39Z Admin 1 Created page with "{{packet|name=Interface color|description=Changes the color of an interface.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet..." {{packet|name=Interface color|description=Changes the color of an interface.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet changes the color of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. |- |} 350 2012-01-05T17:52:17Z Dane 30 {{packet|name=Interface color|description=This packet changes the color of an interface that is text.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet changes the color of an interface that is text. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. (0xffffff) |- |} === Information === You use this packet to change the color of text in an interface. 358 2012-01-09T02:23:11Z Dane 30 {{packet|name=Interface color|description=This packet changes the color of an interface that is text.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet changes the color of an interface that is text. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. |- |} === Information === You use this packet to change the color of text in an interface. 366 2012-02-27T22:18:19Z Dane 30 {{packet|name=Interface color|description=This packet changes the color of an interface that is text.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet changes the color of an interface that is text. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. |- |} === Information === You use this packet to change the color of text in an interface. {|border=2 ! Color ! Code |- | Green | 0x3366 |- | Yellow | 0x33FF66 |- | Red | 0x6000 |- |} 754 2012-11-14T18:03:32Z Russian 123 {{packet|name=Interface color|description=This packet changes the color of an interface that is text.|opcode=122|type=Fixed|length=6|revision=317}} == Interface Color == === Description === This packet changes the color of an interface that is text. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. |- |} === Information === You use this packet to change the color of text in an interface. {|border=2 ! Color ! Code |- | Green | 0x3366 |- | Yellow | 0x33FF66 |- | Red | 0x6000 |- |} 1142 2014-06-24T11:45:58Z Pure 316 {{packet|name=Interface color|description=This packet changes the color of an interface that is text.|opcode=122|type=Fixed|length=4|revision=317}} == Interface Color == === Description === This packet changes the color of an interface that is text. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The color. |- |} === Information === You use this packet to change the color of text in an interface. {|border=2 ! Color ! Code |- | Green | 0x3366 |- | Yellow | 0x33FF66 |- | Red | 0x6000 |- |} 317:Interface item 0 57 pno47htm0se94d5ff2yrk5g6qzbjteq 169 2011-06-26T17:53:41Z Admin 1 Created page with "{{packet|name=Interface item|description=Displays an item model inside an interface.|opcode=246|type=Fixed|length=6|revision=317}} == Interface Item == === Description === Disp..." {{packet|name=Interface item|description=Displays an item model inside an interface.|opcode=246|type=Fixed|length=6|revision=317}} == Interface Item == === Description === Displays an item model inside an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] || Interface ID. |- | [[Data_Types#Standard_data_types|Short]] || The items rotation. |- | [[Data_Types#Standard_data_types|Short]] || The item ID. |} 291 2011-08-05T20:54:19Z Supah Fly 15 {{packet|name=Interface item|description=Displays an item model inside an interface.|opcode=246|type=Fixed|length=6|revision=317}} == Interface Item == === Description === Displays an item model inside an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] || Interface ID. |- | [[Data_Types#Standard_data_types|Short]] || The item's model zoom. |- | [[Data_Types#Standard_data_types|Short]] || The item ID. |} 317:Interface model rotation 0 133 s0a3j3jr6ptikkrccqahyqmg74b6vib 345 2012-01-05T16:48:14Z Dane 30 Created page with "{{packet|name=Interface model rotation|description=Changes the zoom and rotation of the interface id's media given.|opcode=230|type=Fixed|length=8|revision=317}} == Interface Col..." {{packet|name=Interface model rotation|description=Changes the zoom and rotation of the interface id's media given.|opcode=230|type=Fixed|length=8|revision=317}} == Interface Color == === Description === Changes the zoom and rotation of the interface id's media given. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Word]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The zoom. |- | [[Data_Types#Standard_data_types|Word]] | The interface id. |- | [[Data_Types#Standard_data_types|Word]] | The rotation1. |- | [[Data_Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]] [[Data_Types#Standard_data_types|Special A]] | The rotation2. |- |} 346 2012-01-05T16:49:00Z Dane 30 {{packet|name=Interface model rotation|description=Changes the zoom and rotation of the interface id's media given.|opcode=230|type=Fixed|length=8|revision=317}} == Interface Color == === Description === Changes the zoom and rotation of the interface id's media given. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Word]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The zoom. |- | [[Data_Types#Standard_data_types|Word]] | The interface id. |- | [[Data_Types#Standard_data_types|Word]] | The rotation1. |- | [[Data_Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]] [[Data_Types#Non_Standard_data_types|Special A]] | The rotation2. |- |} 1145 2014-06-24T12:12:43Z Pure 316 {{packet|name=Interface model rotation|description=Changes the zoom and rotation of the interface id's media given.|opcode=230|type=Fixed|length=8|revision=317}} == Interface Color == === Description === Changes the zoom and rotation of the interface id's media given. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Word]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The zoom. |- | [[Data_Types#Standard_data_types|Word]] | The interface id. |- | [[Data_Types#Standard_data_types|Word]] | The rotation1. |- | [[Data_Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Word]] [[Data_Types#Non_Standard_data_types|Special A]] | The rotation2. |- |} 317:Interface offset 0 124 r3zm3vj1pebnl2ohynejkny2b1mv5yz 302 2011-08-11T23:13:18Z Supah Fly 15 adding undocumented packet, yo. {{packet|name=Interface offset|description=Sets the offset for drawing of an interface|opcode=70|type=Fixed|length=6|revision=317}} == Interface animation == === Description === Sets the offset for drawing of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The X offset |- | [[Data Types#Standard data types|Short]] | The Y offset |- | [[Data Types#Standard data types|Short]] | The interface ID |- |} 303 2011-08-11T23:14:50Z Supah Fly 15 missed something {{packet|name=Interface offset|description=Sets the offset for drawing of an interface|opcode=70|type=Fixed|length=6|revision=317}} == Interface offset == === Description === Sets the offset for drawing of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The X offset |- | [[Data Types#Standard data types|Short]] | The Y offset |- | [[Data Types#Standard data types|Short]] | The interface ID |- |} 1132 2014-06-17T16:29:16Z Pure 316 {{packet|name=Interface offset|description=Sets the offset for drawing of an interface|opcode=70|type=Fixed|length=6|revision=317}} == Interface offset == === Description === Sets the offset for drawing of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The X offset |- | [[Data_Types#Byte_Order|Little Endian]] [[Data Types#Standard data types|Short]] | The Y offset |- | [[Data_Types#Byte_Order|Little Endian]] [[Data Types#Standard data types|Short]] | The interface ID |- |} 317:Interface over tab 0 422 say7tprb28t9xrq9ca86qqku0uu329u 1305 2014-08-09T20:09:26Z Ambokile 138 Created page with "{{packet|name=Interface over tab|description=Draws an interface over the tab area.|opcode=106|type=Fixed|length=1|revision=317}} == Open Welcome Screen == === Description ===..." {{packet|name=Interface over tab|description=Draws an interface over the tab area.|opcode=106|type=Fixed|length=1|revision=317}} == Open Welcome Screen == === Description === This packet draws an interface over the tab area. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data type|Byte]] [[Data Types#Non Standard data types|Special C]] | Interface ID |- |} 317:Inventory overlay 0 58 9hkgnqlyztaxorjnhdfly6mnqwkzxn9 170 2011-06-26T17:53:56Z Admin 1 Created page with "{{packet|name=Child frame|description=Attaches an interface within an interface|opcode=248|type=Fixed|length=4|revision=317}} == Child Frame == === Description === This packet ..." {{packet|name=Child frame|description=Attaches an interface within an interface|opcode=248|type=Fixed|length=4|revision=317}} == Child Frame == === Description === This packet attaches an interface to the chat box. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The interface being attached to. |- | [[Data_Types#Standard_data_types|Short]] | The interface being attached. |- |} 292 2011-08-09T13:28:32Z Supah Fly 15 {{packet|name=Inventory Overlay|description=Overlays an interface on the inventory|opcode=248|type=Fixed|length=4|revision=317}} == Child Frame == === Description === This packet overlays an interface in the inventory area. This is used in trading and staking. === Example === <pre>sendFrame248(3323, 3321);</pre> That will set the open interface to interface 3323, which is the trade interface, with the inventory overlay interface as 3321, which is an inventory type interface with offer actions. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The interface to open. |- | [[Data_Types#Standard_data_types|Short]] | The interface to overlay the inventory area. |- |} 293 2011-08-09T13:31:33Z Supah Fly 15 moved [[317:Child frame]] to [[317:Inventory Overlay]]: Probably not a good name for it, but it's better than the original. {{packet|name=Inventory Overlay|description=Overlays an interface on the inventory|opcode=248|type=Fixed|length=4|revision=317}} == Child Frame == === Description === This packet overlays an interface in the inventory area. This is used in trading and staking. === Example === <pre>sendFrame248(3323, 3321);</pre> That will set the open interface to interface 3323, which is the trade interface, with the inventory overlay interface as 3321, which is an inventory type interface with offer actions. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The interface to open. |- | [[Data_Types#Standard_data_types|Short]] | The interface to overlay the inventory area. |- |} 295 2011-08-09T13:32:19Z Supah Fly 15 moved [[317:Inventory Overlay]] to [[317:Inventory overlay]]: For consistency with other pages, lower-cased the "o" in overlay. {{packet|name=Inventory Overlay|description=Overlays an interface on the inventory|opcode=248|type=Fixed|length=4|revision=317}} == Child Frame == === Description === This packet overlays an interface in the inventory area. This is used in trading and staking. === Example === <pre>sendFrame248(3323, 3321);</pre> That will set the open interface to interface 3323, which is the trade interface, with the inventory overlay interface as 3321, which is an inventory type interface with offer actions. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The interface to open. |- | [[Data_Types#Standard_data_types|Short]] | The interface to overlay the inventory area. |- |} 317:Item action 1 0 83 ko5wj8461c5ht51p9bltemdkd1hir56 195 2011-06-26T18:01:11Z Admin 1 Created page with "{{packet|name=Item action 1|description=Sent when the player clicks the first option of an item.|opcode=122|type=Fixed|length=6|revision=317}} == Item Action 1 == === Descriptio..." {{packet|name=Item action 1|description=Sent when the player clicks the first option of an item.|opcode=122|type=Fixed|length=6|revision=317}} == Item Action 1 == === Description === This packet is sent when a player clicks the first option of an item, such as "Bury" for bones or "Eat" for food. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot the item is in. |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] | The ID of the item. |- |} 925 2014-01-11T12:43:54Z Pure 316 {{packet|name=Item action 1|description=Sent when the player clicks the first option of an item.|opcode=122|type=Fixed|length=6|revision=317}} == Item Action 1 == === Description === This packet is sent when a player clicks the first option of an item, such as "Bury" for bones or "Eat" for food. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The slot the item is in. |- | [[Data_Types#LITTLE_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The ID of the item. |- |} 317:Item on floor 0 66 9ls3n3hsn1zgc38dqt9avxqk1loqo09 178 2011-06-26T17:56:38Z Admin 1 Created page with "{{packet|name=Item on floor|description=Sent when a player uses an item on another item thats on the floor.|opcode=25|type=Fixed|length=10|revision=317}} == Item on Floor== === ..." {{packet|name=Item on floor|description=Sent when a player uses an item on another item thats on the floor.|opcode=25|type=Fixed|length=10|revision=317}} == Item on Floor== === Description === This packet is sent when a player uses an item on another item thats on the floor. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The interface ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item being used ID. |- | [[Data_Types#Standard_data_types|Short]] | The floor items ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The Y coordinate of the item. |- | Unsigned [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The items slot ID. |- | [[Data_Types#Standard_data_types|Short]] | The X coordinate of the item. |- |} 317:Item on item 0 70 413q3dj1yxbv1elr2zoumng8tdnki9a 182 2011-06-26T17:57:40Z Admin 1 Created page with "{{packet|name=Item on item|description=Sent when a player uses an item on another item.|opcode=53|type=Fixed|length=4|revision=317}} == Item on Item == === Description === This..." {{packet|name=Item on item|description=Sent when a player uses an item on another item.|opcode=53|type=Fixed|length=4|revision=317}} == Item on Item == === Description === This packet is sent when a player uses an item on another item. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The item being used on's slot. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item being used's slot. |- |} 317:Item on object 0 94 3qsj5w3mh77gv99dibe2yvrsrpp6oib 206 2011-06-26T18:04:05Z Admin 1 Created page with "{{packet|name=Item on object|description=Sent when a player uses an item on an objet.|opcode=192|type=Fixed|length=12|revision=317}} == Item on Object == === Description === Th..." {{packet|name=Item on object|description=Sent when a player uses an item on an objet.|opcode=192|type=Fixed|length=12|revision=317}} == Item on Object == === Description === This packet is sent when a player uses an item on object. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The object ID. |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects Y coordinate. |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] | The items slot ID. |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |- | [[Data_Types#Standard_data_types|Short]] | The item ID. |- |} 317:Item on player 0 63 6mgx0u3v9dwohybt3azs8n83t3fdzxt 175 2011-06-26T17:55:58Z Admin 1 Created page with "{{packet|name=Item on player|description=Sent when a player uses an item on another player.|opcode=14|type=Fixed|length=8|revision=317}} == Item on Player == === Description ===..." {{packet|name=Item on player|description=Sent when a player uses an item on another player.|opcode=14|type=Fixed|length=8|revision=317}} == Item on Player == === Description === This packet is sent when a player uses an item on another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] | The other players ID. |- | [[Data_Types#Standard_data_types|Short]] | The item ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The items slot ID. |- |} 317:Light item 0 75 5p8gth80yxov42muzv4t84rsl67uk7i 187 2011-06-26T17:58:54Z Admin 1 Created page with "{{packet|name=Light item|description=Sent when a player attempts to light logs on fire.|opcode=79|type=Fixed|length=6|revision=317}} == Light Item == === Description === This p..." {{packet|name=Light item|description=Sent when a player attempts to light logs on fire.|opcode=79|type=Fixed|length=6|revision=317}} == Light Item == === Description === This packet is sent when a player attempts to light logs on fire. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The items Y coordinate. |- | Unsigned [[Data_Types#Standard_data_types|Short]] | The item ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The items X coordinate. |- |} 317:Load map region 0 40 gccy2m364etoom0or6n9jbktrbyjzev 152 2011-06-26T17:48:25Z Admin 1 Created page with "{{packet|name=Load map region|description=Makes the client load the specified map region.|opcode=73|type=Fixed|length=4|revision=317}} == Load Map Region == === Description === ..." {{packet|name=Load map region|description=Makes the client load the specified map region.|opcode=73|type=Fixed|length=4|revision=317}} == Load Map Region == === Description === Makes the client load the specified map region. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Region X coordinate (absolute X / 8) plus 6. |- | [[Data_Types#Standard_data_types|Short]] | Region Y coordinate (absolute Y / 8) plus 6. |- |} === Other Information === There are various loops/arrays within the map region loading functionality of the client which have been misunderstood by many. {| border=2 ! Loop type ! Description |- | 104 x 104 | Maximum size of the client's load area |- | 8 x 8 | Load blocks to speed up loading NPCs, Items and Objects |- | 13 x 13 | Number of load blocks to load |- |} 317:Loading finished 0 82 of0etgtnma9rj8kdztijuyv92rfrw3g 194 2011-06-26T18:00:57Z Admin 1 Created page with "{{packet|name=Loading finished|description=Sent when the player is finished loading a map region|opcode=121|type=Fixed|length=0|revision=317}} == Loading Finished == === Descrip..." {{packet|name=Loading finished|description=Sent when the player is finished loading a map region|opcode=121|type=Fixed|length=0|revision=317}} == Loading Finished == === Description === This packet is sent when a player is finished loading a new map region. 317:Logout 0 45 6gtkh3rfvd8w1kyfu1k7nlp2hfu4w7m 157 2011-06-26T17:49:49Z Admin 1 Created page with "{{packet|name=Logout|description=Forces the client to logout.|opcode=109|type=Fixed|length=0|revision=317}} == Logout == === Description === Forces the client to logout cleanly..." {{packet|name=Logout|description=Forces the client to logout.|opcode=109|type=Fixed|length=0|revision=317}} == Logout == === Description === Forces the client to logout cleanly and return to the login screen, without attempting a reconnection. 317:Magic on items 0 102 lf95hyr2uzzvqoufb2ed90o5b59z4cp 214 2011-06-26T18:05:59Z Admin 1 Created page with "{{packet|name=Magic on items|description=Sent when a player casts magic on the items in their inventory.|opcode=237|type=Fixed|length=8|revision=317}} == Magic on Items == === D..." {{packet|name=Magic on items|description=Sent when a player casts magic on the items in their inventory.|opcode=237|type=Fixed|length=8|revision=317}} == Magic on Items == === Description === This packet is sent when a player casts magic (i.e. High Level Alchemy) on the items in their inventory. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The items slot ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- | [[Data_Types#Standard_data_types|Short]] | The frame ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The spell ID. |- |} 317:Magic on player 0 114 r2shomcvahiktfw8obu5yjpij05aoiw 246 2011-07-11T12:35:27Z Andrew 9 Created page with " == Magic on Player == '''Description''' This packet is sent when the player attempts to cast magic onto another. == Packet Structure == {|border=2 ! Data Type ! Description |-..." == Magic on Player == '''Description''' This packet is sent when the player attempts to cast magic onto another. == Packet Structure == {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Little]] | The spell ID. |- |} 247 2011-07-11T12:36:04Z Andrew 9 /* Magic on Player */ == Description == This packet is sent when the player attempts to cast magic onto another. == Packet Structure == {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Little]] | The spell ID. |- |} 248 2011-07-11T12:36:51Z Andrew 9 /* Description */ == Magic on Player == === Description === This packet is sent when the player attempts to cast magic onto another. == Packet Structure == {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Little]] | The spell ID. |- |} 249 2011-07-11T12:37:12Z Andrew 9 /* Packet Structure */ == Magic on Player == === Description === This packet is sent when the player attempts to cast magic onto another. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Little]] | The spell ID. |- |} 251 2011-07-11T12:54:16Z Andrew 9 /* Packet Structure */ == Magic on Player == === Description === This packet is sent when the player attempts to cast magic onto another. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Byte_Order|Little]] | The spell ID. |- |} 270 2011-07-14T15:47:21Z Andrew 9 /* Magic on Player */ {{packet|name=Magic on player|description=This packet is send when a player attempts to cast magic on another|opcode=249|type=Fixed|length=4|revision=317}} == Magic on Player == === Description === This packet is sent when the player attempts to cast magic onto another. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The player index. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Byte_Order|Little]] | The spell ID. |- |} 317:Minimap State 0 43 rloiclk7fdietgwun2yxtcumvg6hr7p 155 2011-06-26T17:49:15Z Admin 1 Created page with "{{packet|name=Minimap State|description=Sets the state of the clients minimap.|opcode=99|type=Fixed|length=1|revision=317}} == Minimap State == === Description === This packet ..." {{packet|name=Minimap State|description=Sets the state of the clients minimap.|opcode=99|type=Fixed|length=1|revision=317}} == Minimap State == === Description === This packet sets the Minimaps state '''States:''' * 0 - '''Active''': Clickable and viewable * 1 - '''Locked''': viewable but not clickable * 2 - '''Blacked-out''': Minimap is replaced with black background === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#byte|byte]] | The state. |- |} 317:Move item 0 98 a024d5pa6uzipa3bz5i5abultrauyl1 210 2011-06-26T18:05:04Z Admin 1 Created page with "{{packet|name=Move item|description=Sent when the player moves an item from one slot to another.|opcode=214|type=Fixed|length=7|revision=317}} == Move Item == === Description ==..." {{packet|name=Move item|description=Sent when the player moves an item from one slot to another.|opcode=214|type=Fixed|length=7|revision=317}} == Move Item == === Description === This packet is sent when a player moves an item from one slot to another. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The frame ID. |- | [[Data_Types#Standard_data_types|Byte]] | Insert mode. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Starting slot. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | New slot. |- |} 317:Music 0 641 pphtry7ljjp2mif449ko0orjfrc68up 1597 2015-01-06T03:42:33Z Bl3nd 326 Created page with "{{packet|name=Audio|description=Sets the audio to play.|opcode=174|type=Fixed|length=N/A|revision=317}} == Audio == === Description === Sets what audio to play at a certain ..." {{packet|name=Audio|description=Sets the audio to play.|opcode=174|type=Fixed|length=N/A|revision=317}} == Audio == === Description === Sets what audio to play at a certain moment. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Word|Word]] | The sound id. |- | [[Data Types#Byte|Byte]] | The volume. |- | [[Data Types#Word|Word]] | The delay. |- |} 317:NPC action 1 0 91 0f6uourk7v619vitynpip9gamcdgjbp 203 2011-06-26T18:03:12Z Admin 1 Created page with "{{packet|name=NPC action 1|description=Sent when a player clicks the first option of an NPC.|opcode=155|type=Fixed|length=2|revision=317}} == NPC Action 1 == === Description ===..." {{packet|name=NPC action 1|description=Sent when a player clicks the first option of an NPC.|opcode=155|type=Fixed|length=2|revision=317}} == NPC Action 1 == === Description === This packet is sent when a player clicks the first option of an NPC. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The NPC index. |} 317:NPC action 2 0 64 7vlc32ngbjynsswsllnytl1uvdhiod8 176 2011-06-26T17:56:11Z Admin 1 Created page with "{{packet|name=NPC action 2|description=Sent when a player clicks the second action of an NPC.|opcode=17|type=Fixed|length=2|revision=317}} == NPC Action 2 == === Description ===..." {{packet|name=NPC action 2|description=Sent when a player clicks the second action of an NPC.|opcode=17|type=Fixed|length=2|revision=317}} == NPC Action 2 == === Description === This packet is sent when a player clicks the second action of an NPC. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The NPC index. |- |} 317:NPC action 3 0 65 16wvxnabs6ekjkvlp7hd37uq00osjd1 177 2011-06-26T17:56:24Z Admin 1 Created page with "{{packet|name=NPC action 3|description=Sent when a player clicks the third option of an NPC.|opcode=21|type=Fixed|length=2|revision=317}} == NPC Action 3 == === Description === ..." {{packet|name=NPC action 3|description=Sent when a player clicks the third option of an NPC.|opcode=21|type=Fixed|length=2|revision=317}} == NPC Action 3 == === Description === This packet is sent when a player clicks the third option of an NPC. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The NPC index. |- |} 317:NPC head on interface 0 365 ht42mrz4kyyqr0ztibyom7qiothh6eb 1154 2014-06-24T16:29:34Z Ambokile 138 Created page with "{{packet|name=Actor head on interface|description=Places the head of an actor on an interface|opcode=75|type=Fixed|length=4|revision=317}} == Actor head on interface == === D..." {{packet|name=Actor head on interface|description=Places the head of an actor on an interface|opcode=75|type=Fixed|length=4|revision=317}} == Actor head on interface == === Description === Places the head of an actor on an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The actor ID |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The 'slot' ID for where you wish to place the head |- |} 1155 2014-06-24T16:30:50Z Ambokile 138 Ambokile moved page [[317:Actor head on interface]] to [[317:NPC head on interface]] {{packet|name=Actor head on interface|description=Places the head of an actor on an interface|opcode=75|type=Fixed|length=4|revision=317}} == Actor head on interface == === Description === Places the head of an actor on an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The actor ID |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The 'slot' ID for where you wish to place the head |- |} 1157 2014-06-24T16:31:06Z Ambokile 138 {{packet|name=NPC head on interface|description=Places the head of an NPC on an interface|opcode=75|type=Fixed|length=4|revision=317}} == NPC head on interface == === Description === Places the head of an NPC on an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The NPC ID |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The 'slot' ID for where you wish to place the head |- |} 317:Object action 1 0 86 f6phcpj4vfr3byv39rnolwowg6g8ss5 198 2011-06-26T18:02:00Z Admin 1 Created page with "{{packet|name=Object action 1|description=Sent when the player clicks the first option of an object.|opcode=132|type=Fixed|length=6|revision=317}} == Object Action 1 == === Desc..." {{packet|name=Object action 1|description=Sent when the player clicks the first option of an object.|opcode=132|type=Fixed|length=6|revision=317}} == Object Action 1 == === Description === This packet is sent when a player clicks the first option of an object, such as "Cut" for trees or "Mine" for rocks. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |- | [[Data_Types#Standard_data_types|Short]] | The objects ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects Y coordinate. |- |} 317:Object action 2 0 103 t8kdnljvxi6mcflvtkw8u85dicrj335 215 2011-06-26T18:06:12Z Admin 1 Created page with "{{packet|name=Object action 2|description=Sent when the player clicks the second option available for an an object.|opcode=252|type=Fixed|length=6|revision=317}} == Object action..." {{packet|name=Object action 2|description=Sent when the player clicks the second option available for an an object.|opcode=252|type=Fixed|length=6|revision=317}} == Object action 2 == === Description === This packet is sent when a player clicks the second option available of an object, such as "Prospect" for rocks. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects ID. |- | [[Data_Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |} 926 2014-01-18T16:11:06Z Pure 316 {{packet|name=Object action 2|description=Sent when the player clicks the second option available for an an object.|opcode=252|type=Fixed|length=6|revision=317}} == Object action 2 == === Description === This packet is sent when a player clicks the second option available of an object, such as "Prospect" for rocks. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects ID. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |} 927 2014-01-18T16:12:57Z Pure 316 {{packet|name=Object action 2|description=Sent when the player clicks the second option available for an an object.|opcode=252|type=Fixed|length=6|revision=317}} == Object action 2 == === Description === This packet is sent when a player clicks the second option available of an object, such as "Prospect" for rocks. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects ID. |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The objects Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |} 931 2014-02-10T00:08:55Z Pure 316 {{packet|name=Object action 2|description=Sent when the player clicks the second option available for an an object.|opcode=252|type=Fixed|length=6|revision=317}} == Object action 2 == === Description === This packet is sent when a player clicks the second option available of an object, such as "Prospect" for rocks. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects ID. |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The objects Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The objects X coordinate. |} 317:Object action 3 0 71 3k34ogprh64g0qs5y9lj0yqilx1qb85 183 2011-06-26T17:57:56Z Admin 1 Created page with "{{packet|name=Object action 3|description=Sent when a player clicks the third action available for an object.|opcode=70|type=Fixed|length=6|revision=317}} == Object Action 3 == ..." {{packet|name=Object action 3|description=Sent when a player clicks the third action available for an object.|opcode=70|type=Fixed|length=6|revision=317}} == Object Action 3 == === Description === This packet is sent when a player clicks the third action available for an object. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The X coordinate of the object. |- | [[Data_Types#Standard_data_types|Short]] | The Y coordinate of the object. |- | [[Data_Types#Big_Endian|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The object ID. |} 317:Open chatbox interface 0 230 rfmwy4534s31nlw4slrr2br5ly9f8if 835 2013-03-24T15:50:33Z Ambokile 138 Created page with "{{packet|name=Open chatbox interface|description=Displays an interface over the chatbox.|opcode=218|type=Fixed|length=2|revision=317}} == Open chatbox interface == === Descri..." {{packet|name=Open chatbox interface|description=Displays an interface over the chatbox.|opcode=218|type=Fixed|length=2|revision=317}} == Open chatbox interface == === Description === Sending this packet to the client will cause the client to open an interface over the chatbox. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] | Interface ID. |- |} 1136 2014-06-17T17:02:38Z Pure 316 {{packet|name=Open chatbox interface|description=Displays an interface over the chatbox.|opcode=218|type=Fixed|length=2|revision=317}} == Open chatbox interface == === Description === Sending this packet to the client will cause the client to open an interface over the chatbox. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | Interface ID. |- |} 317:Open welcome screen 0 50 qgnnbdjjj3mlp9lspxb2syrgcaosgan 162 2011-06-26T17:51:26Z Admin 1 Created page with "{{packet|name=Open welcome screen|description=Displays the welcome screen.|opcode=176|type=Fixed|length=10|revision=317}} == Open Welcome Screen == === Description === This pac..." {{packet|name=Open welcome screen|description=Displays the welcome screen.|opcode=176|type=Fixed|length=10|revision=317}} == Open Welcome Screen == === Description === This packet displays the welcome screen. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data type|Byte]] | Days since last recovery change (200 for not yet set, 201 for members server). |- | [[Data Types#Standard data type|Short]] [[Data Types#Non Standard data types|Special A]] | Number of unread messages. |- | [[Data Types#Standard data types|Byte]] | Member warning (1 for member, 0 for non-member). |- | [[Data Types#Non Standard data types|Integer 2]] | Last logged IP. |- | [[Data Types#Standard data types|Short]] | Last logged successful login. |- |} 1125 2014-06-17T16:03:14Z Pure 316 Fixed. {{packet|name=Open welcome screen|description=Displays the welcome screen.|opcode=176|type=Fixed|length=10|revision=317}} == Open Welcome Screen == === Description === This packet displays the welcome screen. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data Types#Standard data type|Byte]] [[Data Types#Non Standard data types|Special C]] | Days since last recovery change (200 for not yet set, 201 for members server). |- | Unsigned [[Data Types#Standard data type|Short]] [[Data Types#Non Standard data types|Special A]] | Number of unread messages. |- | Unsigned [[Data Types#Standard data types|Byte]] | Member warning (1 for member, 0 for non-member). |- | [[Data Types#Non Standard data types|Middle-Endian Big Integer]] | Last logged IP. |- | Unsigned [[Data Types#Standard data types|Short]] | Last logged successful log-n. |- |} 1126 2014-06-17T16:14:24Z Pure 316 {{packet|name=Open welcome screen|description=Displays the welcome screen.|opcode=176|type=Fixed|length=10|revision=317}} == Open Welcome Screen == === Description === This packet displays the welcome screen. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data type|Byte]] [[Data Types#Non Standard data types|Special C]] | Days since last recovery change (200 for not yet set, 201 for members server). |- | [[Data Types#Standard data type|Short]] [[Data Types#Non Standard data types|Special A]] | Number of unread messages. |- | [[Data Types#Standard data types|Byte]] | Member warning (1 for member, 0 for non-member). |- | [[Data Types#Non Standard data types|Middle-Endian Big Integer]] | Last logged IP. |- | [[Data Types#Standard data types|Short]] | Last logged successful log-n. |- |} 317:Pickup ground item 0 101 2mlmap76s2t2lu53ne34jx74b2tbquc 213 2011-06-26T18:05:45Z Admin 1 Created page with "{{packet|name=Pickup ground item|description=Sent when the player picks up an item from the ground.|opcode=236|type=Fixed|length=6|revision=317}} == Pickup Ground Item == === De..." {{packet|name=Pickup ground item|description=Sent when the player picks up an item from the ground.|opcode=236|type=Fixed|length=6|revision=317}} == Pickup Ground Item == === Description === This packet is sent when a player clicks the "Pick Up" option on an item when its on the ground. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The Y coordinate of the item. |- | [[Data_Types#Standard_data_types|Short]] | The item ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The X coordinate of the item. |- |} 317:Play song 0 229 fkiksgq2v9jv030kxj5ih9xy2n6ilsg 833 2013-03-24T15:38:35Z Ambokile 138 Created page with "{{packet|name=Play song|description=Starts playing a song.|opcode=74|type=Fixed|length=2|revision=317}} == Play song == === Description === Sending this packet to the client..." {{packet|name=Play song|description=Starts playing a song.|opcode=74|type=Fixed|length=2|revision=317}} == Play song == === Description === Sending this packet to the client will cause the client to start playing a song. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data_Types#Standard_data_types|Word]] | The song ID. |- |} 1131 2014-06-17T16:24:05Z Pure 316 {{packet|name=Play song|description=Starts playing a song.|opcode=74|type=Fixed|length=2|revision=317}} == Play song == === Description === Sending this packet to the client will cause the client to start playing a song. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The song ID. |- |} 317:Player command 0 80 jw3o3p27dn99u2p38qfmzb5e69bp0p7 192 2011-06-26T18:00:29Z Admin 1 Created page with "{{packet|name=Player command|description=Sent when a player types a command in the chat box.|opcode=103|type=Variable Byte|length=N/A|revision=317}} == Player Command == === Des..." {{packet|name=Player command|description=Sent when a player types a command in the chat box.|opcode=103|type=Variable Byte|length=N/A|revision=317}} == Player Command == === Description === This packet is sent when a player types a message with the prefix '::', the message is then sent to the server and an appropriate action is taken (e.g. spawning an item). === Packet Structure === {|border=2 ! Data Type ! Description |- | [[RS String|RS String]] | The command name and parameters. |} 317:Player head to interface 0 211 4j1oxfyi8dplbz4qfa0zcilkwejg3cv 697 2012-09-23T18:50:16Z AtomicInt 112 Created page with "== Send player head model to an interface == === Description === This packet attaches an interface to the chat box. === Packet Structure === {|border=2 ! Data Type ! Descri..." == Send player head model to an interface == === Description === This packet attaches an interface to the chat box. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian Short A]] | The interface ID. |- |} 698 2012-09-23T18:50:40Z AtomicInt 112 /* Description */ == Send player head model to an interface == === Description === This packet sends a players head to an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian Short A]] | The interface ID. |- |} 699 2012-09-23T18:51:08Z AtomicInt 112 /* Packet Structure */ == Send player head model to an interface == === Description === This packet sends a players head to an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Little Endian Short A]] | The interface ID. |- |} 1127 2014-06-17T16:15:08Z Pure 316 {{packet|name=Send player head model to an interface|description=Sends the player head model to an interface.|opcode=185|type=Fixed|length=2|revision=317}} == Send player head model to an interface == === Description === This packet sends a players head to an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Little Endian Short A]] | The interface ID. |- |} 1128 2014-06-17T16:15:27Z Pure 316 {{packet|name=Send head model to interface.|description=Sends the player head model to an interface.|opcode=185|type=Fixed|length=2|revision=317}} == Send player head model to an interface == === Description === This packet sends a players head to an interface === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Little Endian Short A]] | The interface ID. |- |} 317:Privacy options 0 78 icf2na1p1z0jf92ujnws82te3wsdnjj 190 2011-06-26T17:59:43Z Admin 1 Created page with "{{packet|name=Privacy options|description=Sent when a player changes their privacy options.|opcode=95|type=Fixed|length=3|revision=317}} == Privacy Options == === Description ==..." {{packet|name=Privacy options|description=Sent when a player changes their privacy options.|opcode=95|type=Fixed|length=3|revision=317}} == Privacy Options == === Description === This packet is sent when a player changes their privacy options (i.e. public chat). === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The private chat options. |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The public chat options. |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The trade/complete options. |- |} 875 2013-07-19T18:00:25Z AtomicInt 112 Order was wrong, should have been public, private, trade not private, public, trade and fixed a typo (complete -> compete) {{packet|name=Privacy options|description=Sent when a player changes their privacy options.|opcode=95|type=Fixed|length=3|revision=317}} == Privacy Options == === Description === This packet is sent when a player changes their privacy options (i.e. public chat). === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The public chat options. |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The private chat options. |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | The trade/compete options. |- |} 317:Region change 0 97 p7ggwljdq1kb334eic7ez1846tnms42 209 2011-06-26T18:04:47Z Admin 1 Created page with "{{packet|name=Region change|description=Sent when a player enters a new map region.|opcode=210|type=Fixed|length=0|revision=317}} == Region Change == === Description === This p..." {{packet|name=Region change|description=Sent when a player enters a new map region.|opcode=210|type=Fixed|length=0|revision=317}} == Region Change == === Description === This packet is sent when a player enters a new map region. 360 2012-01-22T03:32:47Z Major 26 {{packet|name=bank x items part-2|description=Sent when a player enters an X amount of items they want to bank.|opcode=208|type=Fixed|length=4|revision=317}} == Bank X Items Part-2 == === Description === This packet is sent when a player enters an X amount of items they want to bank. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Integer]] | The amount of the item you want to bank. |- |} 361 2012-01-22T03:35:44Z Major 26 {{packet|name=Region change|description=Sent when a player enters a new map region.|opcode=210|type=Fixed|length=0|revision=317}} == Region Change == === Description === This packet is sent when a player enters a new map region. 317:Remove friend 0 99 b68mru315ldg7fzm5pr6a32enpektvn 211 2011-06-26T18:05:17Z Admin 1 Created page with "{{packet|name=Remove friend|description=Sent when a player removes a friend from their friend list.|opcode=215|type=Fixed|length=8|revision=317}} == Remove Friend == === Descrip..." {{packet|name=Remove friend|description=Sent when a player removes a friend from their friend list.|opcode=215|type=Fixed|length=8|revision=317}} == Remove Friend == === Description === This packet is sent when a player removes a friend from their friends list. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The other players ID. |- |} 317:Remove ignore 0 74 c85tmbr3ayhjnr7pqqhpoisn1hxnh4i 186 2011-06-26T17:58:40Z Admin 1 Created page with "{{packet|name=Remove ignore|description=Sent when a player removes another player from their ignore list.|opcode=74|type=Fixed|length=8|revision=317}} == Remove Ignore == === De..." {{packet|name=Remove ignore|description=Sent when a player removes another player from their ignore list.|opcode=74|type=Fixed|length=8|revision=317}} == Remove Ignore == === Description === This packet is sent when a player removes another player from their ignore list. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The other players ID. |- |} 317:Report player 0 100 ibpmp6nc5m9ssgooqa1wfa9e1ea63g4 212 2011-06-26T18:05:32Z Admin 1 Created page with "{{packet|name=Report player|description=Sent when a player reports another player.|opcode=218|type=Fixed|length=8|revision=317}} == Report Player == === Description === This pa..." {{packet|name=Report player|description=Sent when a player reports another player.|opcode=218|type=Fixed|length=8|revision=317}} == Report Player == === Description === This packet is sent when a player reports another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The players name as a long. |} 784 2012-12-01T07:47:48Z Zymus 19 /* Packet Structure */ {{packet|name=Report player|description=Sent when a player reports another player.|opcode=218|type=Fixed|length=8|revision=317}} == Report Player == === Description === This packet is sent when a player reports another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The players name as a long. |- | [[Data_Types#Standard_data_types|Byte]] | The rule that's being reported |- | [[Data_Types#Standard_data_types|Byte]] | Unknown - Sent as either 1 or 0 for a boolean client-side |} 924 2013-12-30T02:59:38Z Kylestev 311 Update the boolean description for the last byte of the packet. {{packet|name=Report player|description=Sent when a player reports another player.|opcode=218|type=Fixed|length=8|revision=317}} == Report Player == === Description === This packet is sent when a player reports another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The players name as a long. |- | [[Data_Types#Standard_data_types|Byte]] | The rule that's being reported |- | [[Data_Types#Standard_data_types|Byte]] | Mute for 48 hours - Sent as either 1 or 0 for a boolean client-side |} 317:Reset button state 0 38 prxv57ccrdhjhauroszbps1hndzhdc0 150 2011-06-26T17:47:42Z Admin 1 Created page with "{{packet|name=Reset button state|description=Resets the button states for all buttons.|opcode=68|type=Fixed|length=0|revision=317}} == Reset Button State == === Description === ..." {{packet|name=Reset button state|description=Resets the button states for all buttons.|opcode=68|type=Fixed|length=0|revision=317}} == Reset Button State == === Description === This packet resets the button states for all buttons. 1153 2014-06-24T12:48:30Z Pure 316 {{packet|name=Reset setting states|description=Resets the states for all settings.|opcode=68|type=Fixed|length=0|revision=317}} == Reset setting states == === Description === This packet resets the states for all user settings (inc. buttons). 317:Reset camera 0 44 e2xsguutq6f0cjfgnoza0zlty9b2kkz 156 2011-06-26T17:49:31Z Admin 1 Created page with "{{packet|name=Reset camera|description=Resets the camera position.|opcode=107|type=Fixed|length=0|revision=317}} == Reset Camera == === Description === Resets the game's camera..." {{packet|name=Reset camera|description=Resets the camera position.|opcode=107|type=Fixed|length=0|revision=317}} == Reset Camera == === Description === Resets the game's camera position to the client default. 317:Reset destination 0 228 7epk1pog6fi1npwzt2o3ypx923mxkyu 830 2013-03-24T15:34:07Z Ambokile 138 Created page with "{{packet|name=Reset destination|description=Resets the player's destination.|opcode=78|type=Fixed|length=0|revision=317}} == Reset destination == === Description === Sending..." {{packet|name=Reset destination|description=Resets the player's destination.|opcode=78|type=Fixed|length=0|revision=317}} == Reset destination == === Description === Sending the packet to the client will make the client reset the player's destination and effectively stop them from walking. 317:Run energy 0 46 hcmyjux7ti2b584jlal6f49knbs9dsa 158 2011-06-26T17:50:06Z Admin 1 Created page with "{{packet|name=Run energy|description=Sends the players run energy level.|opcode=110|type=Fixed|length=1|revision=317}} == Run Energy == === Description === Sends how much run e..." {{packet|name=Run energy|description=Sends the players run energy level.|opcode=110|type=Fixed|length=1|revision=317}} == Run Energy == === Description === Sends how much run energy the player currently has. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data Types#Standard data types|Byte]] | The energy level. |- |} 317:Scroll position 0 41 ip3j8akp829qs1i0looz5vb0urn5xhk 153 2011-06-26T17:48:43Z Admin 1 Created page with "{{packet|name=Scroll position|description=Sets the scrollbar position of an interface.|opcode=79|type=Fixed|length=4|revision=317}} == Scroll Position == === Description === Th..." {{packet|name=Scroll position|description=Sets the scrollbar position of an interface.|opcode=79|type=Fixed|length=4|revision=317}} == Scroll Position == === Description === This packet sets the scrollbar position of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data Types#Non Standard data types|Special A]] | The interface ID. |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The position of the scrollbar. |- |} 1133 2014-06-17T16:43:05Z Pure 316 {{packet|name=Scroll position|description=Sets the scrollbar position of an interface.|opcode=79|type=Fixed|length=4|revision=317}} == Scroll Position == === Description === This packet sets the scrollbar position of an interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The interface ID. |- | [[Data Types#Standard data types|Short]] [[Data Types#Non Standard data types|Special A]] | The position of the scrollbar. |- |} 317:Send add ignore 0 128 bfpojem5n9p235q7w3oxbe9tos29n82 320 2011-10-26T02:46:09Z Zymus 19 Created page with "{{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Des..." {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. NOTE: Due to my lack of knowledge about Wiki syntax, I am not sure how to wrap the following text in [code] tags. int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); } By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 321 2011-10-26T02:46:35Z Zymus 19 /* Description */ {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. NOTE: Due to my lack of knowledge about Wiki syntax, I am not sure how to wrap the following text in [code] tags. { int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); }} By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 322 2011-10-26T02:46:50Z Zymus 19 /* Description */ {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. NOTE: Due to my lack of knowledge about Wiki syntax, I am not sure how to wrap the following text in [code] tags. int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); } By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 323 2011-10-26T02:47:08Z Zymus 19 /* Description */ {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. NOTE: Due to my lack of knowledge about Wiki syntax, I am not sure how to wrap the following text in [code] tags. int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); } By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 324 2011-10-26T02:47:21Z Zymus 19 /* Description */ {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); } By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 325 2011-10-26T02:47:33Z Zymus 19 /* Description */ {{packet|name=Send ignored users|description=Sends a list of all the ignored player IDs|opcode=214|type=VARIABLE_SHORT|length=N/A|revision=317}} == Send ignored users == === Description === Sends the IDs of all the users that this player has in their ignore. This packet has a slightly different structure than the other packets. int entries = packetSize / 8; for (int i = 0; i < entries; i++) { ignoreList[i] = stream.readLong(); } By looking at the rest of the 317 protocol, there doesn't seem to be a way to change the list dynamically. It seems as though that whenever the player decides to add or remove a player from their list, it must send all the values again. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard Data Types|Long]] | The Unique Identifier of the player(s) (possibly determined by their username). |- |} 317:Send message 0 60 640camo0c6jk3qbi3j9h7lopuwfp2br 172 2011-06-26T17:54:41Z Admin 1 Created page with "{{packet|name=Send message|description=Sends a server message, trade or duel request to the client's chat panel.|opcode=253|type=Variable Byte|length=N/A|revision=317}} == Send M..." {{packet|name=Send message|description=Sends a server message, trade or duel request to the client's chat panel.|opcode=253|type=Variable Byte|length=N/A|revision=317}} == Send Message == === Description === Sends a server side message (e.g. 'Welcome to RuneScape'), or trade/duel request (:tradereq:playername and :duelreq:playername) to the client. === Packet Structure === {| border=2 ! Data type ! Description |- | [[RS String|RS String]] | The message. |- |} 317:Send sidebar interface 0 39 oaoqufmrzlqduzvhjimbxpesit3qxf4 151 2011-06-26T17:47:59Z Admin 1 Created page with "{{packet|name=Send sidebar interface|description=Assigns an interface to on of the tabs in the game sidebar.|opcode=71|type=Fixed|length=3|revision=317}} == Send Sidebar Interfac..." {{packet|name=Send sidebar interface|description=Assigns an interface to on of the tabs in the game sidebar.|opcode=71|type=Fixed|length=3|revision=317}} == Send Sidebar Interface == === Description === This packet assigns an interface to one of the tabs in the game sidebar. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The sidebar ID. |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- |} === Values === The below are the different values for this packet. {| border=2 ! Value ! Icon ! Norm. ID |- | 0 || Attack type || 2433 |- | 1 || Stats || 3917 |- | 2 || Quests || 638 |- | 3 || Inventory || 3213 |- | 4 || Wearing || 1644 |- | 5 || Prayer || 5608 |- | 6 || Magic || 1151 |- | 7 || '''EMPTY''' |- | 8 || Friends list || 5065 |- | 9 || Ignore list || 5715 |- | 10 || Log out || 2449 |- | 11 || Settings || 4445 |- | 12 || Emotes || 147 |- | 13 || Music || 6299 |- |} 317:Set interface text 0 127 ka3kvtlwzkn92ahy02sruk6to21a7kp 317 2011-10-26T02:08:52Z Zymus 19 Created page with "{{packet|name=Set interface text|description=Sets the text for a specified interface|opcode=126|type=VARIABLE_SHORT|length=N/A|revision=317}} == Set Interface Text == === Descri..." {{packet|name=Set interface text|description=Sets the text for a specified interface|opcode=126|type=VARIABLE_SHORT|length=N/A|revision=317}} == Set Interface Text == === Description === Sets the text for the specific interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Non Standard Data Types|RS_String]] | The new text for the interface |- | [[Data Types#Non Standard Data Types|Short A]] | The interface id |- |} 348 2012-01-05T17:49:27Z Dane 30 {{packet|name=Set interface text|description=Sets the text for a specified interface|opcode=126|type=VARIABLE_SHORT|length=N/A|revision=317}} == Set Interface Text == === Description === Sets the text for the specific interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Non Standard Data Types|RS_String]] | The new text for the interface |- | [[Data Types#Non Standard Data Types|Short A]] | The interface id |- |} === Information === I do not recommend you use this to change the text color. I refer you to [[317:Interface_color|Interface Color]] for the proper way to do so. 349 2012-01-05T17:52:08Z Dane 30 /* Set Interface Text */ {{packet|name=Set interface text|description=Sets the text for a specified interface|opcode=126|type=VARIABLE_SHORT|length=N/A|revision=317}} == Set Interface Text == === Description === Sets the text for the specific interface. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Non Standard Data Types|RS_String]] | The new text for the interface |- | [[Data Types#Non Standard Data Types|Short A]] | The interface id |- |} === Information === I do not recommend you use this to change the text color. I refer you to [[317:Interface_color|Interface Color]] for the proper way to do so. 317:Show interface 0 42 by8iagjh3e9bzbt4xy08ls2w3gxbrob 154 2011-06-26T17:49:00Z Admin 1 Created page with "{{packet|name=Show interface|description=Displays a normal interface.|opcode=97|type=Fixed|length=2|revision=317}} == Show Interface == === Description === Displays a normal no..." {{packet|name=Show interface|description=Displays a normal interface.|opcode=97|type=Fixed|length=2|revision=317}} == Show Interface == === Description === Displays a normal non-walkable [[Interfaces|interface]] with the given id. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The interface id. |- |} 317:Show multi-combat 0 231 8zgtvskahtafugn3rbqjp5feqcr9fg2 837 2013-03-24T16:14:28Z Ambokile 138 Created page with "{{packet|name=Show multi-combat|description=Shows the player if they are in a multi-combat zone.|opcode=61|type=Fixed|length=1|revision=317}} == Show multi-combat == === Desc..." {{packet|name=Show multi-combat|description=Shows the player if they are in a multi-combat zone.|opcode=61|type=Fixed|length=1|revision=317}} == Show multi-combat == === Description === Sending this packet to the client will make the client show the player if they are in a multi-combat zone. '''States:''' * 0 - Not in a multi-combat zone, no crossbones in bottom-right. * 1 - In a multi-combat zone, crossbones in bottom-right. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#byte|byte]] | The state. |- |} 317:Show tab 0 363 l35ak0njmwfd1b9q5odbie1t6l1n36e 1146 2014-06-24T12:33:17Z Pure 316 Created page with "{{packet|name=Show Tab|description=Shows the given tab.|opcode=106|type=Fixed|length=1|revision=317}} == Clear inventory == === Description === Shows the given tab id. === ..." {{packet|name=Show Tab|description=Shows the given tab.|opcode=106|type=Fixed|length=1|revision=317}} == Clear inventory == === Description === Shows the given tab id. === Packet Structure === {|border=2 ! Data Type ! Description |- | U [[Data_Types#Standard_data_types|Byte]] [[Data Types#Non_Standard_Data_Types|Special C]] | Tab ID. |- |} 3787 2015-06-08T13:19:35Z Pure 316 {{packet|name=Show Tab|description=Shows the given tab.|opcode=106|type=Fixed|length=1|revision=317}} == Show Tab == === Description === Shows the given tab id. === Packet Structure === {|border=2 ! Data Type ! Description |- | U [[Data_Types#Standard_data_types|Byte]] [[Data Types#Non_Standard_Data_Types|Special C]] | Tab ID. |- |} 317:Skill level 0 131 gbjzqoox9orm6vohlyca1edplidrp4k 341 2012-01-05T16:31:25Z Dane 30 /* Skill Level */ == Skill Level == === Description === This packet changes the experience and level of a given skill id. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Byte|Byte]] | The skill ID. |- | [[Data Types#DWord|DWord]] | The skill experience. |- | [[Data Types#Byte|Byte]] | The skill level. |- |} 342 2012-01-05T16:33:05Z Dane 30 {{packet|name=Skill level|description=Changes the experience and level of a given skill id.|opcode=135|type=Fixed|length=6|revision=317}} == Skill Level == === Description === This packet changes the experience and level of a given skill id. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Byte|Byte]] | The skill ID. |- | [[Data Types#DWord|DWord]] | The skill experience. |- | [[Data Types#Byte|Byte]] | The skill level. |- |} 395 2012-05-06T17:21:29Z Dane 30 {{packet|name=Skill level|description=Changes the experience and level of a given skill id.|opcode=134|type=Fixed|length=6|revision=317}} == Skill Level == === Description === This packet changes the experience and level of a given skill id. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Byte|Byte]] | The skill ID. |- | [[Data Types#DWord|DWord]] | The skill experience. |- | [[Data Types#Byte|Byte]] | The skill level. |- |} 1130 2014-06-17T16:21:27Z Pure 316 {{packet|name=Skill level|description=Changes the experience and level of a given skill id.|opcode=134|type=Fixed|length=6|revision=317}} == Skill Level == === Description === This packet changes the experience and level of a given skill id. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Byte|Byte]] | The skill ID. |- | [[Data Types#Non Standard data types|Middle-Endian Small Integer]] | The skill experience. |- | [[Data Types#Byte|Byte]] | The skill level. |- |} 317:Song Queue 0 362 fpt9muxpx63topirab2m140m9leyzri 1138 2014-06-23T23:14:59Z Sk8rdude461 228 Created page with "== Song Queue == === Description === This packet queue's a song to be played next. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little En..." == Song Queue == === Description === This packet queue's a song to be played next. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the next song. |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the previous song. |- |} [[Category:Packet]] [[Category:Packet:317]] 1140 2014-06-23T23:34:29Z Bl3nd 326 /* Packet Structure */ == Song Queue == === Description === This packet queue's a song to be played next. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the next song. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the previous song. |- |} [[Category:Packet]] [[Category:Packet:317]] 1141 2014-06-23T23:39:18Z Sk8rdude461 228 /* Song Queue */ {| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- | colspan="2" style="background-color:#3c5;" | '''Song Queue'''<br/>Queue's a song to be played next. |- ! '''Opcode''' | 121 |- ! '''Type''' | FIXED |- ! '''Length''' | 4 |- |} == Song Queue == === Description === This packet queue's a song to be played next. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the next song. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The id of the previous song. |- |} [[Category:Packet]] [[Category:Packet:317]] 317:System update 0 47 rgd7fu8jrv1jzguekaknwwnsxay59u0 159 2011-06-26T17:50:23Z Admin 1 Created page with "{{packet|name=System update|description=Sends how many seconds until a 'System Update.'|opcode=114|type=Fixed|length=2|revision=317}} == System Update == === Description === A ..." {{packet|name=System update|description=Sends how many seconds until a 'System Update.'|opcode=114|type=Fixed|length=2|revision=317}} == System Update == === Description === A timer showing how many seconds until a 'System Update' will appear in the lower left hand corner of the game screen. After the timer reaches 0 all players are disconnected and are unable to log in again until server is restarted. Players connecting will receive a message stating, "The server is being updated. Please wait 1 minute and try again." (unless stated otherwise). === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Time until an update. |- |} 317:Trade answer 0 89 6i94ju92n6g41frjbcgfvj7vv7qhb4j 201 2011-06-26T18:02:44Z Admin 1 Created page with "{{packet|name=Trade answer|description=Sent when a player answers a trade request from another player.|opcode=139|type=Fixed|length=2|revision=317}} == Trade Answer == === Descr..." {{packet|name=Trade answer|description=Sent when a player answers a trade request from another player.|opcode=139|type=Fixed|length=2|revision=317}} == Trade Answer == === Description === This packet is sent when a player answers a trade request from another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The player requesting the trade's ID. |- |} 317:Trade request 0 73 p3sjeiifrptkz1o1cwdczel2f5q045b 185 2011-06-26T17:58:24Z Admin 1 Created page with "{{packet|name=Trade request|description=Sent when a player requests a trade with another player.|opcode=73|type=Fixed|length=2|revision=317}} == Trade Request == === Description..." {{packet|name=Trade request|description=Sent when a player requests a trade with another player.|opcode=73|type=Fixed|length=2|revision=317}} == Trade Request == === Description === This packet is sent when a player requests a trade with another player. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The other players ID. |} 317:Unequip item 0 90 fz9ja2516e1e8vmpne44ikqzpymuu1e 202 2011-06-26T18:02:58Z Admin 1 Created page with "{{packet|name=Unequip item|description=Sent when a player unequips an item.|opcode=145|type=Fixed|length=6|revision=317}} == Unequip Item == === Description === This packet is ..." {{packet|name=Unequip item|description=Sent when a player unequips an item.|opcode=145|type=Fixed|length=6|revision=317}} == Unequip Item == === Description === This packet is sent when a player unequips an item. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The items slot ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- |} 386 2012-03-24T23:41:44Z Sini 33 {{packet|name=Unequip item|description=Sent when a player unequips an item.|opcode=145|type=Fixed|length=6|revision=317}} == Unequip Item == === Description === This packet is sent when a player unequips an item. === Packet Structure === {|border=2 ! Data Type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The interface ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The items slot ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | The item ID. |- |} 317:Update item container 0 364 pdiqs4e5sig82cbe2bgx7hby7jrdpku 1147 2014-06-24T12:40:02Z Pure 316 Created page with "{{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Descrip..." {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } 1148 2014-06-24T12:40:11Z Pure 316 {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } 1149 2014-06-24T12:40:19Z Pure 316 {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (int i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } 1150 2014-06-24T12:40:44Z Pure 316 {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (int i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) { item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) } item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } 1151 2014-06-24T12:41:18Z Pure 316 {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (int i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } * Someone please fix the code block's syntax, thank you :-) 1152 2014-06-24T12:41:33Z Pure 316 {{packet|name=Camera oscillate|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } * Someone please fix the code block's syntax, thank you :-) 1214 2014-07-09T20:02:20Z Pure 316 {{packet|name=Update item container|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Camera oscillate == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | U [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | U [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } * Someone please fix the code block's syntax, thank you :-) 3784 2015-06-08T13:18:18Z Pure 316 {{packet|name=Update item container|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} == Update item container == === Description === Updates the items in a given interface component. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Short]] | Interface ID. |- | Unsigned [[Data_Types#Standard_data_types|Short]] | Amount of items. |- |} The rest in pseudo-code: for (i = 0; i < amt_of_items; i++) { item_amount = read_u_byte(); // Item Amount: U Byte if (item_amount == 255) item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A } 317:Walkable interface 0 52 32vxo6lbl7fkbjsoogiful4g8dyz89l 164 2011-06-26T17:52:21Z Admin 1 Created page with "{{packet|name=Walkable interface|description=Displays an interface in walkable mode.|opcode=208|type=Fixed|length=2|revision=317}} == Walkable Interface == === Description === ..." {{packet|name=Walkable interface|description=Displays an interface in walkable mode.|opcode=208|type=Fixed|length=2|revision=317}} == Walkable Interface == === Description === This packet displays an interface in walkable mode. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] | Interface ID. |- |} 317:Weight 0 55 pckdj9eujuqr5lwtie8yolt04n7tj36 167 2011-06-26T17:53:07Z Admin 1 Created page with "{{packet|name=Weight|description=Sends the players weight amount.|opcode=240|type=Fixed|length=2|revision=317}} == Weight == === Description === Sends how much weight of equipm..." {{packet|name=Weight|description=Sends the players weight amount.|opcode=240|type=Fixed|length=2|revision=317}} == Weight == === Description === Sends how much weight of equipment the player is wearing (e.g. Rune plate-body is 9.04kg). === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] | The amount of weight. |- |} 317:Send add friend 0 37 mb2mg1k9dwem1uqf9lztxf3tunlj3p6 149 2011-06-26T17:47:18Z Admin 1 Created page with "<h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <..." <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Long </td><td> The player name </td></tr> <td> Byte </td> <td> The world (10 = "online" for most clients) </td> </table> 1135 2014-06-17T17:02:00Z Pure 316 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client Attempts to update player node, if player isn't in the friends list and there is space, the player is added to the friend list. </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Long </td><td> The player name </td></tr> <td> Byte </td> <td> The world (10 = "online" for most clients) </td> </table> * TODO format. 317:Begin player updating 0 432 ghqjf1n4jhdofka18efqhtynhiskm0u 1318 2014-08-11T04:52:33Z Bl3nd 326 Created page with "== Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation)..." == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. === Setup === Step 1: The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the Map Region packet (241). Step 2: Then we set up an update block, like so: { (1)...PacketBuilder updateBlock = new PacketBuilder(); } Step 3: Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: { PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); } Then once we've done that we need to make that new field initiate the bit access like so: { packet.initiateBitAccess(); } Step 4: We then need to update both the players movement and the player itself. For this go to Player Movement and Update Player. Step 5: We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). Step 6: Loop through every player and check if there is room left in the local list. If the size is >= 255 then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. Step 7: Check if the update block is not empty, if so, write a magic id indicating an update block follows. We do that by putting bits (11, 2047), then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). Step 8: We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. === Add Player === putBits(11, otherPlayer.getIndex()); int yPos = other players y - players y; int xPos = other players x - players x; === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1319 2014-08-11T04:53:19Z Bl3nd 326 /* Description */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === Step 1: The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the Map Region packet (241). Step 2: Then we set up an update block, like so: { (1)...PacketBuilder updateBlock = new PacketBuilder(); } Step 3: Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: { PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); } Then once we've done that we need to make that new field initiate the bit access like so: { packet.initiateBitAccess(); } Step 4: We then need to update both the players movement and the player itself. For this go to Player Movement and Update Player. Step 5: We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). Step 6: Loop through every player and check if there is room left in the local list. If the size is >= 255 then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. Step 7: Check if the update block is not empty, if so, write a magic id indicating an update block follows. We do that by putting bits (11, 2047), then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). Step 8: We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. === Add Player === putBits(11, otherPlayer.getIndex()); int yPos = other players y - players y; int xPos = other players x - players x; === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1322 2014-08-11T14:57:03Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === Step 1: The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the Map Region packet (241). Step 2: Then we set up an update block, like so: { (1)...PacketBuilder updateBlock = new PacketBuilder(); } Step 3: Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: { PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); } Then once we've done that we need to make that new field initiate the bit access like so: { packet.initiateBitAccess(); } Step 4: We then need to update both the players movement and the player itself. For this go to Player Movement and Update Player. Step 5: We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). Step 6: Loop through every player and check if there is room left in the local list. If the size is >= 255 then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. Step 7: Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} Step 8: We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | N/A |- | int yPos = other player y - player y; | N/A |- | int xPos = other player x - player x; | N/A |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1323 2014-08-13T05:49:38Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === Step 1: The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] Step 2: Then we set up an update block, like so: { (1)...PacketBuilder updateBlock = new PacketBuilder(); } Step 3: Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: { PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); } Then once we've done that we need to make that new field initiate the bit access like so: { packet.initiateBitAccess(); } Step 4: We then need to update both the players movement and the player itself. For this go to Player Movement and Update Player. Step 5: We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). Step 6: Loop through every player and check if there is room left in the local list. If the size is >= 255 then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. Step 7: Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} Step 8: We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | N/A |- | int yPos = other player y - player y; | N/A |- | int xPos = other player x - player x; | N/A |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1324 2014-08-13T05:56:02Z Bl3nd 326 /* Setup */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: (1) {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to Player Movement and Update Player. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is >= 255 then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | N/A |- | int yPos = other player y - player y; | N/A |- | int xPos = other player x - player x; | N/A |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1325 2014-08-13T06:11:12Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: (1) {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and Update Player. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | N/A |- | int yPos = other player y - player y; | N/A |- | int xPos = other player x - player x; | N/A |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1326 2014-08-13T06:11:49Z Bl3nd 326 /* Setup */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and Update Player. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | N/A |- | int yPos = other player y - player y; | N/A |- | int xPos = other player x - player x; | N/A |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1327 2014-08-13T06:14:59Z Bl3nd 326 /* Add Player */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and Update Player. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1328 2014-08-13T06:23:38Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and Update Player. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1329 2014-08-13T06:24:12Z Bl3nd 326 /* Setup */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1330 2014-08-13T19:49:41Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > Animation Update. * Graphics: If our flag gets the update flag graphics, we go to method > Graphics Update. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1331 2014-08-13T19:54:39Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > Animation Update. * Graphics: If our flag gets the update flag graphics, we go to method > Graphics Update. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1332 2014-08-13T19:55:15Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Udpate]. * Graphics: If our flag gets the update flag graphics, we go to method > Graphics Update. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1333 2014-08-13T19:56:18Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Udpate]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1334 2014-08-13T19:56:35Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1335 2014-08-13T20:02:40Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > Chat Update. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Chat Update === This update appends a chat text update. This will contain parameters packet and otherPlayer. We first make 2 fields: {| border=2 ! Method |- | ChatMessage cm = otherPlayer.getCurrentChatMessage(); |- | byte[] bytes = cm.getText() |- |} Then we put a range of data: {| border=2 ! Method |- | putShort(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF)) |- | put((byte) otherPlayer.getRights().toInteger()) |- | put((byte) bytes.length) |- | put(bytes) |- |} Then we are finished with this update. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1336 2014-08-13T20:03:12Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Chat_Update Chat Update]. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Chat Update === This update appends a chat text update. This will contain parameters packet and otherPlayer. We first make 2 fields: {| border=2 ! Method |- | ChatMessage cm = otherPlayer.getCurrentChatMessage(); |- | byte[] bytes = cm.getText() |- |} Then we put a range of data: {| border=2 ! Method |- | putShort(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF)) |- | put((byte) otherPlayer.getRights().toInteger()) |- | put((byte) bytes.length) |- | put(bytes) |- |} Then we are finished with this update. === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1337 2014-08-13T20:04:00Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > Player Appearance Update. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Chat_Update Chat Update]. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Chat Update === This update appends a chat text update. This will contain parameters packet and otherPlayer. We first make 2 fields: {| border=2 ! Method |- | ChatMessage cm = otherPlayer.getCurrentChatMessage(); |- | byte[] bytes = cm.getText() |- |} Then we put a range of data: {| border=2 ! Method |- | putShort(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF)) |- | put((byte) otherPlayer.getRights().toInteger()) |- | put((byte) bytes.length) |- | put(bytes) |- |} Then we are finished with this update. === Appearance Update === ... === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1338 2014-08-13T20:04:47Z Bl3nd 326 /* Player Update */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Appearance_Update Player Appearance Update]. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Chat_Update Chat Update]. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Chat Update === This update appends a chat text update. This will contain parameters packet and otherPlayer. We first make 2 fields: {| border=2 ! Method |- | ChatMessage cm = otherPlayer.getCurrentChatMessage(); |- | byte[] bytes = cm.getText() |- |} Then we put a range of data: {| border=2 ! Method |- | putShort(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF)) |- | put((byte) otherPlayer.getRights().toInteger()) |- | put((byte) bytes.length) |- | put(bytes) |- |} Then we are finished with this update. === Appearance Update === ... === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1339 2014-08-13T20:09:40Z Bl3nd 326 /* Player Movement */ == Player Updating == === Description === This packet begins the player updating. (I will use Hyperions player updating to sort of explain this packet--by the documentation) MAY TAKE A BIT READING :P I need time to finish trying to explain this packet to my best ability. If you hate what I have so far or doesn't make ANY sense. Just edit it. I wouldn't mind. Or START OVER COMPLETELY === Setup === '''Step 1''': The first thing we need to do before this packet is fully received, we need to check if the player's map region has changed. If it has, then we need to send the [https://rswiki.moparisthebest.com/index.php?title=317:Construct_map_region Map Region Packet] '''Step 2''': Then we set up an update block, like so: [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Explaining_.281.29 (1)] {| border=2 ! Method |- | PacketBuilder updateBlock = new PacketBuilder(); |- |} '''Step 3''': Since this packet is written in bits instead of bytes and holds information about the local list, players to add/remove, movement and which updates are required we need to do: '''(Method 1)'''.Then once we've done that we need to make that new field initiate the bit access like so: '''(Method 2)'''. {| border=2 ! Method # ! Method |- | Method 1 | PacketBuilder packet = new PacketBuilder(188, VARIABLE_SHORT); |- | Method 2 | packet.initiateBitAccess(); |- |} '''Step 4''': We then need to update both the players movement and the player itself. For this go to [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Movement Player Movement] and [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Player_Update Update Player]. '''Step 5''': We need to write the current size of the player list so we put bits (8, and the size of the local players). Then we need to iterate through the local player list with a, for loop. And within that for loop we get the next player. Then check if the player should still be in our list. If so, then we send the update player movement method and check if an update is required. If so, send the player update. If the player should not be in our list still, then remove the player from the list and tell the client to remove the player by putting bits (1, 1) and (2, 3). {| border=2 ! Data ! Description |- | putBits(8, local player size); | Writes the current local player size |- | putBits(1, 1); | N/A |- | putBits(2, 3); | N/A |- |} '''Step 6''': Loop through every player and check if there is room left in the local list. If the size is '''>= 255''' then there is no more room left. Therefore, we cannot add more players, so we just ignore them until they get replaced by the other players that get removed. After that, we check if they should not be added, by going through the local player list and seeing if it contains the other player, if so, ignore them (continue). After those checks we add the player to the list, add the player in the packet, and update the player forcing the appearance flag. '''Step 7''': Check if the update block is not empty, if so, write a magic id indicating an update block follows (look below). Then we are finished with the bit access. Still in the update block check, we add the update block at the end of this packet. If the update block is empty, we terminate the packet normally (which means finish the bit access). {| border=2 ! Data ! Description |- | putBits(11, 2047); | Indicates an update block follows |- |} '''Step 8''': We write the packet. === Player Movement === '''This is not for the 'this' player movement. That method will come later!''' Check which type of movement took place. (PRIMARY) If no movement did take place, check if an update is required. If an update is required put bits (1, 1)//Update happened and (2, 0)//No movement. If no update is required put bits (1, 0)//Nothing changed. (SECONDARY) The player moved but didn't run? Put bits (1, 1)//Update required (2, 1)//moved one tile (3, (PRIMARY))//Write the primary sprite and (1, isUpdateRequired() ? 1 : 0). We then put an else statement for the (SECONDARY) check. Within that, we put bits (1, 1)//Update happened (2, 2)//Two tiles (3, (PRIMARY))// Walking direction (3, (SECONDARY))//Run direction and (1, isUpdateRequired() ? 1 : 0)//Block update happened. {| border=2 ! Data ! Description |- | putBits(1, 1); | Update happened |- | putBits(2, 0); | No movement |- | putBits(1, 0); | Nothing changed |- | putBits(1, 1); | Update required |- | putBits(2, 1); | Moved one tile |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- | putBits(1, 1); | Update happened |- | putBits(2, 2); | Moved two tiles |- | putBits(3, otherPlayer.getSprites().getPrimarySprite()); | Walking direction |- | putBits(3, otherPlayer.getSprites().getSecondarySprite()); | Running direction |- | putBits(1, otherPlayer.getUpdateFlags().isUpdateRequired ? 1 : 0); | Block update happened |- |} === Add Player === {| border=2 ! Data ! Description |- | putBits(11, otherPlayer.getIndex()); | Write the player index |- | int yPos = other player y - player y; | Calculate the y offsets |- | int xPos = other player x - player x; | Calculate the x offsets |- | putBits(5, xPos); | Write the x offsets |- | putBits(5, yPos); | Write the y offsets |- | putBits(1, 1); | Indicates update is required (this is always true!) |- | putBits(1, 1); | Indicates we should discard client-side walk queues |- |} === Player Update === '''Step 1''': Before we start, we need to check if there is no update required flag nor a force appearance flag. If there is not, return. '''Step 2''': Now we use the cached update block in a synchronized block. '''(All of the below will be within this synchronized block)'''. We check if the player has a cached update block then we put the cached update block into the payload and flip it, then return. '''Step 3''': We have to construct and cache our own block. {| border=2 ! Method |- | PacketBuilder block = new PacketBuilder(); |- |} '''Step 4''': Now we get into the masks! Yippee! To refer to the different mask go to the 317 Protocol [https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Player_Updating Player Update Masks]. So we first make an integer named 'mask' and make a field named 'flags' that equals the otherPlayer update flags. * Appearance: If we have a flag that equals our apperance flag and a force appearance is enabled. Our mask |= 0x1. * Animation: If we have a flag that equals our animation flag, our mask |= 0x2. * Chat: If we have a flag that equals our chat flag and !no chat, our mask |= 0x40. * Graphics: If we have a flag that equals our graphics flag, our mask |= 0x100. So after that we check if the bitmask would overflow a byte. Like so: {| border=2 ! Method |- | if (mask >= 0x100) |- |} If so, our mask |= 0x80 and we write as a short and indicate we have done so. {| border=2 ! Method |- | block.put((byte) (mask & 0xFF)) |- | block.put((byte) (mask >> 8)) |- |} If not, we write it as a byte. {| border=2 ! Method |- | block.put((byte) (mask)) |- |} And then we get into what the flags contain. * Apperance: If our flag gets the update flag appearance or the appearance is forced we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Appearance_Update Player Appearance Update]. * Animation: If our flag gets the update flag animation, we go to the method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Animation_Update Animation Update]. * Graphics: If our flag gets the update flag graphics, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Graphics_Update Graphics Update]. * Chat: If our flag gets the update flag chat and !noChat, we go to method > [https://rswiki.moparisthebest.com/index.php?title=317:Begin_player_updating#Chat_Update Chat Update]. Then we convert the block builder to a packet. {| border=2 ! Method |- | Packet blockPacket = block.toPacket() |- |} Now it is over, cache the block if we can and finally append the block at the end. === Animation Update === This update appends an animation update. This will contain parameters block and otherPlayer. The block will put a short of the current animations id and then put a byte of the current animations delay. === Graphics Update === This update appends a graphics update. This will contain parameters block and otherPlayer. The block will put a short of the current graphics id and then put an int of the current graphics delay. === Chat Update === This update appends a chat text update. This will contain parameters packet and otherPlayer. We first make 2 fields: {| border=2 ! Method |- | ChatMessage cm = otherPlayer.getCurrentChatMessage(); |- | byte[] bytes = cm.getText() |- |} Then we put a range of data: {| border=2 ! Method |- | putShort(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF)) |- | put((byte) otherPlayer.getRights().toInteger()) |- | put((byte) bytes.length) |- | put(bytes) |- |} Then we are finished with this update. === Appearance Update === ... === Explaining (1) === The update block packet holds update blocks and is sent after the main packet. 1342 2014-08-14T03:24:01Z Bl3nd 326 /* Player Updating */ == Player Updating == === Description === This packet begins the player updating. 317:Object removal 0 660 ds9rscg27p1mu9d7pb1cceitfi78cz0 1619 2015-01-15T15:57:16Z Randqm 736 Created page with "== Object removal == === Description === This packet requests the client to remove an object. === Packet Structure === {|border=2 ! Data Type ! Description |- | Negated [[D..." == Object removal == === Description === This packet requests the client to remove an object. === Packet Structure === {|border=2 ! Data Type ! Description |- | Negated [[Data Types#byte|byte]] | object type << 2 + object rotation & 3 |- | [[Data Types#byte|byte]] | 0 |- |} 317:Create Projectile 0 431 jx0pnmd8azo6y8uvtjscwx97bl6vzd6 1315 2014-08-11T03:53:31Z Bl3nd 326 Created page with "== Create Projectile == === Description === Creates a projectile. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]]..." == Create Projectile == === Description === Creates a projectile. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Position offset |- | [[Data_Types#Standard_data_types|Byte]] | Second X offset |- | [[Data_Types#Standard_data_types|Byte]] | Second Y offset |- | [[Data_Types#Standard_data_types|Short]] | Target |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Graphic ID |- | [[Data_Types#Standard_data_types|Byte]] | Starting height |- | [[Data_Types#Standard_data_types|Byte]] | Ending height |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Starting time |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Speed |- | [[Data_Types#Standard_data_types|Byte]] | Initial slope |- | [[Data_Types#Standard_data_types|Byte]] | Initial distance from source |- |} 317:Object spawn 0 661 pvcxnzchho4kakty15wvm4ryovasha7 1620 2015-01-15T15:58:53Z Randqm 736 Created page with "== Object spawn == === Description === This packet requests the client to spawn an object. === Packet Structure === {|border=2 ! Data Type ! Description |- | subtrahend [[D..." == Object spawn == === Description === This packet requests the client to spawn an object. === Packet Structure === {|border=2 ! Data Type ! Description |- | subtrahend [[Data Types#byte|byte]] | 0 |- | Little endian [[Data Types#byte|byte]] | ObjectID |- | subtrahend [[Data Types#byte|byte]] | object type << 2 + object rotation & 3 |- |} 317:Send private message 0 233 hou8kl0ppinkstsgmx5jhfiev39p5az 852 2013-06-20T17:04:27Z Sk8rdude461 228 Created page with "== Send Private Message == === Description ===" == Send Private Message == === Description === 853 2013-06-20T17:25:38Z Sk8rdude461 228 /* Description */ == Send Private Message == === Description === Sending messages to other users within the server. {| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} 856 2013-07-08T18:56:53Z Sk8rdude461 228 /* Description */ == Send Private Message == === Description === Sending messages to other users within the server. {| style="position:fixed; right=15px; top= 90px;margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} 857 2013-07-08T18:57:18Z Sk8rdude461 228 /* Description */ == Send Private Message == === Description === Sending messages to other users within the server. {| style="float=right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} 858 2013-07-08T18:58:03Z Sk8rdude461 228 == Send Private Message == === Description === Sending messages to other users within the server. {| style="float=left; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} 859 2013-07-08T18:58:36Z Sk8rdude461 228 == Send Private Message == === Description === Sending messages to other users within the server. {| style="float=right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} 860 2013-07-08T18:58:46Z Sk8rdude461 228 == Send Private Message == === Description === Sending messages to other users within the server. 861 2013-07-08T18:59:57Z Sk8rdude461 228 /* Send Private Message */ == Send Private Message == {| style=" position:absolute;float=right;right:15px; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} === Description === Sending messages to other users within the server. 862 2013-07-08T19:00:49Z Sk8rdude461 228 == Send Private Message == {| style="float:right;margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- ! scope="col" colspan="2" style="background-color:#3c5;" | Send Message Sends Message to another user. |- ! scope="row"| Opcode | 196 |- ! scope="row"| Type | VARIABLE_SHORT |- ! scope="row"| Length | N/A |} === Description === Sending messages to other users within the server. 317:NPC Dialogue 0 372 2ktr9ixmyp0dbqa2qhn5ripwvd541jf 1164 2014-06-29T04:12:55Z Bl3nd 326 /* Description */ === Description === This packet is sent when a player answers a trade request from another player. 1165 2014-06-29T04:13:23Z Bl3nd 326 /* Description */ === Description === This packet is what handles when the player hits the "Click here to continue". 1166 2014-06-29T04:13:55Z Bl3nd 326 /* Description */ == NPC Dialogue == === Description === This packet is what handles when the player hits the "Click here to continue". 317:Mouse click 0 650 d6t75yjfffszt2d5zyc9oiobyrid7e2 1607 2015-01-12T13:36:32Z Randqm 736 Created page with "== Magic on Items == === Description === This packet is sent when a player clicks somewhere on the game screen." == Magic on Items == === Description === This packet is sent when a player clicks somewhere on the game screen. 1608 2015-01-12T13:37:38Z Randqm 736 /* Magic on Items */ == Mouse click == === Description === This packet is sent when a player clicks somewhere on the game screen. 317:Ground Item Action 0 651 6rsguxwq5coupdrpglgi262yghg54qi 1609 2015-01-12T13:42:52Z Randqm 736 Created page with "== Ground Item Action == === Description === This packet is sent when a player clicks the first option on a ground item. === Packet Structure === {|border=2 ! Data Type ! De..." == Ground Item Action == === Description === This packet is sent when a player clicks the first option on a ground item. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The items X coordinate. |- | Additional [[Data Types#Little Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | The items Y coordinate. |- | Additional [[Data_Types#Standard_data_types|Short]] | The item ID. |- |} 357 Protocol 0 214 gttmww79zjsfxrjjd7i04c6ycirpp8s 703 2012-09-29T09:58:45Z Andrew 9 Created page with "== '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Pack..." == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 31 ! VARIABLE_BYTE ! N/A ! [[357:Send Message|Send Message]] ! Sends a message to the client, such as 'Welcome to RuneScape'. |- ! 96 ! VARIBLE_BYTE ! N/A ! [[357:Send Inventory|Send Inventory]] ! Sends the players inventory to the client. |- ! 121 ! FIXED ! 4 ! [[357:Load Map Region|Load Map Region]] ! Tells the client to load a map region depending on the region's X and Y coordinates. |- ! 163 ! FIXED ! 3 ! [[357:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |-} 704 2012-09-29T10:00:18Z Andrew 9 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 31 ! VARIABLE_BYTE ! N/A ! [[357:Send Message|Send Message]] ! Sends a message to the client, such as 'Welcome to RuneScape'. |- ! 96 ! VARIBLE_BYTE ! N/A ! [[357:Send Inventory|Send Inventory]] ! Sends the players inventory to the client. |- ! 121 ! FIXED ! 4 ! [[357:Load Map Region|Load Map Region]] ! Tells the client to load a map region depending on the region's X and Y coordinates. |- ! 163 ! FIXED ! 3 ! [[357:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |-} 377 Protocol 0 163 hkq7xtwludyk70wbx18qblt6347b8d1 408 2012-06-09T05:08:02Z The Wanderer 13 Created page with "[[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Ani..." [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! FIXED ! 4 ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 470 2012-08-24T15:41:06Z Dirk 98 /* Server -> Client Packets */ [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! FIXED ! 89 ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 471 2012-08-24T15:44:37Z Dirk 98 /* Server -> Client Packets */ [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 485 2012-08-25T13:54:21Z Dirk 98 /* Server -> Client Packets */ [[Category:RS2]] === Login Protocol === The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 487 2012-08-25T13:55:57Z Dirk 98 /* Login Protocol */ [[Category:RS2]] == Login Protocol == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 488 2012-08-25T13:56:48Z Dirk 98 /* Login Protocol */ [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. == Game Protocol == === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 818 2013-01-17T01:29:44Z Scully 24 /* Game Protocol */ [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> === Server -> Client Packets === {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 819 2013-01-17T01:30:50Z Scully 24 /* Server -> Client Packets */ [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 959 2014-03-08T01:28:44Z Pure 316 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 29 ! FIXED ! 0 ! [[377:Reset Open Interfaces|Reset Open Interfaces]] ! Resets all opened interfaces. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- |- ! 41 ! FIXED ! 4 ! [[377:Environment Play Ambient Wave|Environment Play Ambient Wave]] ! Plays an ambient wave. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 61 ! FIXED ! 0 ! [[377:Clear Waypoint|Input Amount]] ! Resets the waypoint. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 961 2014-03-08T01:35:42Z Pure 316 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 29 ! FIXED ! 0 ! [[377:Reset Open Interfaces|Reset Open Interfaces]] ! Resets all opened interfaces. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- |- ! 41 ! FIXED ! 4 ! [[377:Play Ambient Wave|Play Ambient Wave]] ! Plays an ambient wave. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 61 ! FIXED ! 0 ! [[377:Clear Waypoint|Input Amount]] ! Resets the waypoint. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 974 2014-03-08T02:11:29Z Pure 316 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 29 ! FIXED ! 0 ! [[377:Reset Open Interfaces|Reset Open Interfaces]] ! Resets all opened interfaces. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- |- ! 41 ! FIXED ! 4 ! [[377:Play Ambient Wave|Play Ambient Wave]] ! Plays an ambient wave. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 59 ! FIXED ! 6 ! [[377:Create Static Graphic|Create Static Graphic]] ! Creates a static graphic. |- ! 61 ! FIXED ! 0 ! [[377:Clear Waypoint|Input Amount]] ! Resets the waypoint. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 976 2014-03-08T02:13:37Z Pure 316 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all animations in the immediate area. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 29 ! FIXED ! 0 ! [[377:Reset Open Interfaces|Reset Open Interfaces]] ! Resets all opened interfaces. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- |- ! 41 ! FIXED ! 4 ! [[377:Play Ambient Wave|Play Ambient Wave]] ! Plays an ambient wave. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 59 ! FIXED ! 6 ! [[377:Create Static Graphic|Create Static Graphic]] ! Creates a static graphic. |- ! 61 ! FIXED ! 0 ! [[377:Clear Waypoint|Clear Waypoint]] ! Resets the waypoint. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 977 2014-03-08T02:22:31Z Pure 316 [[Category:RS2]] == '''Login Protocol''' == The Login protocol is identical to the [[317_Protocol#Login_Protocol_Overview|317 Login protocol]]. ==Game Protocol== The game protocol is the in-game communication of player actions between the server and client. <br/> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 2 ! FIXED ! 4 ! [[377:Interface Animation|Interface Animation]] ! Sets an interface's model animation. |- ! 3 ! FIXED ! 6 ! [[377:Move Camera|Camera Move]] ! Moves the camera. |- ! 5 ! FIXED ! 0 ! [[377:Logout|Logout]] ! Disconnects the client from the server. |- ! 10 ! FIXED ! 3 ! [[377:Send Sidebar Interface|Send Sidebar Interface]] ! Assigns an interface to one of the tabs in the game sidebar. |- ! 13 ! FIXED ! 0 ! [[377:Animation Reset|Animation Reset]] ! Resets all entity animations in the immediate area. |- ! 18 ! FIXED ! 6 ! [[377:Interface Model Rotation|Interface Model Rotation]] ! Sets the rotation speed of an item in an interface. |- ! 21 ! FIXED ! 6 ! [[377:Interface Item|Interface Item]] ! Displays an item model inside an interface. |- ! 26 ! FIXED ! 5 ! [[377:Send Sound|Send Sound]] ! Sends a sound to be played. |- ! 29 ! FIXED ! 0 ! [[377:Reset Open Interfaces|Reset Open Interfaces]] ! Resets all opened interfaces. |- ! 40 ! FIXED ! 2 ! [[377:Reset Ground Items and Objects|Reset Ground Items and Objects]] ! Resets all ground items and objects in a 8x8 region. |- |- ! 41 ! FIXED ! 4 ! [[377:Play Ambient Wave|Play Ambient Wave]] ! Plays an ambient wave. |- ! 49 ! FIXED ! 6 ! [[377:Skill Level|Skill Level]] ! Sends a skill level to the client. |- ! 50 ! FIXED ! 2 ! [[377:Walkable Interface|Walkable Interface]] ! Displays an interface in walkable mode. |- ! 53 ! VARIABLE_SHORT ! N/A ! [[377:Construct Map Region|Construct Map Region]] ! Constructs a map region given the region's x and y coordinate. |- ! 58 ! FIXED ! 0 ! [[377:Input Amount|Input Amount]] ! Displays the "Input amount" interface. |- ! 59 ! FIXED ! 6 ! [[377:Create Static Graphic|Create Static Graphic]] ! Creates a static graphic. |- ! 61 ! FIXED ! 0 ! [[377:Clear Waypoint|Clear Waypoint]] ! Resets the waypoint. |- ! 63 ! VARIABLE_BYTE ! N/A ! [[377:Send Message|Send Message]] ! Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- ! 67 ! FIXED ! 4 ! [[377:Camera Shake|Camera Shake]] ! Causes the camera to shake. |- ! 71 ! VARIABLE_SHORT ! N/A ! [[377:Update Npcs|Update Npcs]] ! Updates NPCs. |- ! 75 ! FIXED ! 2 ! [[377:Send Position|Send Position]] ! Sends a position (used for packets such as Ground Items and Projectiles) |- ! 76 ! FIXED ! 23 ! [[377:Open Welcome Screen|Open Welcome Screen]] ! Displays the welcome screen. |- ! 78 ! FIXED ! 9 ! [[377:Send Add Friend|Send Add Friend]] ! Sends a friend to be added to the friend list. |- ! 82 ! FIXED ! 3 ! [[377:Set Widget Mouse Triggered|Set Widget Mouse Triggered]] ! Set widget mouse triggered. |- ! 88 ! FIXED ! 2 ! [[377:Create Object|Create Object]] ! Sends a friend to be added to the friend list. |- ! 90 ! VARIABLE_SHORT ! N/A ! [[377:Update Players|Update Players]] ! Updates players. |- ! 107 ! FIXED ! 5 ! [[377:Send Ground Item|Send Ground Item]] ! Adds a ground item to the server. |- ! 113 ! FIXED ! 0 ! [[377:Reset Button State|Reset Button State]] ! Resets the button state for all buttons. |- ! 125 ! FIXED ! 1 ! [[377:Run Energy|Run Energy]] ! Sends the players run energy level. |- ! 126 ! FIXED ! 3 ! [[377:Initialize Player|Initialize Player]] ! Sends the player's membership status and their current index on the server's player list. |- ! 128 ! FIXED ! 4 ! [[377:Inventory Overlay|Inventory Overlay]] ! Displays an interface over the sidebar area. |-} 377:Interface Animation 0 190 8w2862nvfzv6skw5gqte511mrtevpyy 463 2012-08-24T14:40:45Z Dirk 98 Created page with "{{packet|name=Interface Animation|description=Sets a model's animation on an interface.|opcode=2|type=Fixed|length=4|revision=377}} == Interface Animation == === Description ===..." {{packet|name=Interface Animation|description=Sets a model's animation on an interface.|opcode=2|type=Fixed|length=4|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Little Endian]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Animation ID |- |} 464 2012-08-24T14:41:01Z Dirk 98 /* Packet Structure */ {{packet|name=Interface Animation|description=Sets a model's animation on an interface.|opcode=2|type=Fixed|length=4|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Animation ID |- |} 465 2012-08-24T14:44:32Z Dirk 98 /* Packet Structure */ {{packet|name=Interface Animation|description=Sets a model's animation on an interface.|opcode=2|type=Fixed|length=4|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Byte_Order|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Animation ID |- |} 971 2014-03-08T02:05:41Z Pure 316 {{packet|name=Interface Animation|description=Sets a model's animation on an interface.|opcode=2|type=Fixed|length=4|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Byte_Order|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Interface ID |- | [[Data_Types#Standard_data_types|Short]] | Animation ID |- |} 377:Move Camera 0 266 sj29pefwaz7is0rbykvq273ffk6ocuu 978 2014-03-08T02:24:02Z Pure 316 Created page with "{{packet|name=Move Camera|description=Moves the camera.|opcode=3|type=Fixed|length=6|revision=377}} == Move Camera == === Description === Moves the camera. === Packet Struct..." {{packet|name=Move Camera|description=Moves the camera.|opcode=3|type=Fixed|length=6|revision=377}} == Move Camera == === Description === Moves the camera. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Tile X coordinate. |- | [[Data_Types#Standard_data_types|Byte]] | Tile Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] | Height offset. |- | [[Data_Types#Standard_data_types|Byte]] | Position offset. |- | [[Data_Types#Standard_data_types|Byte]] | Move speed. |- |} 979 2014-03-14T15:28:27Z Pure 316 {{packet|name=Move Camera|description=Moves the camera.|opcode=3|type=Fixed|length=6|revision=377}} == Move Camera == === Description === Moves the camera. See: void client#updateCamera === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Tile X coordinate. |- | [[Data_Types#Standard_data_types|Byte]] | Tile Y coordinate. |- | [[Data_Types#Standard_data_types|Short]] | Height offset. |- | [[Data_Types#Standard_data_types|Byte]] | Position offset. |- | [[Data_Types#Standard_data_types|Byte]] | Move speed. |- |} 377:Logout 0 189 ghce2awpxnche82vvhb5c2b1gmctqgg 462 2012-08-24T14:33:19Z Dirk 98 Created page with "{{packet|name=Logout|description=Forces the client to logout.|opcode=5|type=Fixed|length=0|revision=377}} == Logout == === Description === Forces the client to logout cleanly a..." {{packet|name=Logout|description=Forces the client to logout.|opcode=5|type=Fixed|length=0|revision=377}} == Logout == === Description === Forces the client to logout cleanly and return to the login screen, without attempting a reconnection. 377:Send Sidebar Interface 0 191 rct0f5u5wedkvxh16a7911r65fhs5av 466 2012-08-24T14:45:48Z Dirk 98 Created page with "{{packet|name=Set Sidebar Interface|description=Sets the interface for the sidebar.|opcode=10|type=Fixed|length=3|revision=377}} == Interface Animation == === Description === Se..." {{packet|name=Set Sidebar Interface|description=Sets the interface for the sidebar.|opcode=10|type=Fixed|length=3|revision=377}} == Interface Animation == === Description === Sets the specified interface to the specified sidebar. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Standard_data_types|Special S]] | Sidebar Index |- | [[Data_Types#Byte_Order|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID |- |} 972 2014-03-08T02:06:09Z Pure 316 {{packet|name=Set Sidebar Interface|description=Sets the interface for the sidebar.|opcode=10|type=Fixed|length=3|revision=377}} == Interface Animation == === Description === Sets the specified interface to the specified sidebar. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Standard_data_types|Special S]] | Sidebar Index |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID |- |} 377:Animation Reset 0 256 gjnanokm958dgqvvn7xmrye8dfs5y2y 953 2014-03-07T02:28:52Z Pure 316 Created page with "{{packet|name=Animation Reset|description=Resets all animations in the immediate area.|opcode=13|type=Fixed|length=0|revision=377}} == Animation Reset == === Description === ..." {{packet|name=Animation Reset|description=Resets all animations in the immediate area.|opcode=13|type=Fixed|length=0|revision=377}} == Animation Reset == === Description === Resets all animations in the immediate area. 377:Interface Item 0 247 4fyul565rrj0kbt0wujkntg97ffz2um 941 2014-03-07T01:37:23Z Pure 316 Created page with "{{packet|name=Interface Item|description=Sends an item to an interface.|opcode=21|type=Fixed|length=6|revision=377}} == Run Energy == === Description === Sends an item to an ..." {{packet|name=Interface Item|description=Sends an item to an interface.|opcode=21|type=Fixed|length=6|revision=377}} == Run Energy == === Description === Sends an item to an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Short]] | Zoom factor. |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] | Item ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID. |- |} 942 2014-03-07T01:37:48Z Pure 316 {{packet|name=Interface Item|description=Sends an item to an interface.|opcode=21|type=Fixed|length=6|revision=377}} == Interface Item == === Description === Sends an item to an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Short]] | Zoom factor. |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] | Item ID. |- | [[Data Types#Little Endian|Little Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Interface ID. |- |} 377:Send Sound 0 264 5pdl9069ut0m03i8uvzqqr3fn9puvcb 973 2014-03-08T02:08:26Z Pure 316 Created page with "{{packet|name=Send Sound|description=Sends a sound to be played.|opcode=26|type=Fixed|length=5|revision=377}} == Send Sound == === Description === Sends a sound to be played...." {{packet|name=Send Sound|description=Sends a sound to be played.|opcode=26|type=Fixed|length=5|revision=377}} == Send Sound == === Description === Sends a sound to be played. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] | Unknown #1 |- | [[Data_Types#Standard_data_types|Byte]] | Unknown #2 |- | [[Data_Types#Standard_data_types|Short]] | Unknown #2 |- |} * Needs more work. 377:Reset Ground Items and Objects 0 258 8x7g1ir8qnt548zogvwroy4qfokag04 957 2014-03-08T01:22:51Z Pure 316 Created page with "{{packet|name=Reset Ground Items and Objects|description=Resets ground items in potential viewing area.|opcode=40|type=Fixed|length=2|revision=377}} == Reset Ground Items and ..." {{packet|name=Reset Ground Items and Objects|description=Resets ground items in potential viewing area.|opcode=40|type=Fixed|length=2|revision=377}} == Reset Ground Items and Objects == === Description === Resets ground items in potential viewing area. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special C]] | X coordinate in potential viewing area. |- | [[Data_Types#Standard_data_types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special S]] | Y coordinate in potential viewing area. |- |} 377:Play Ambient Wave 0 262 foaocb50rvppeufjd2xpgj1rhgyi9kf 967 2014-03-08T01:58:09Z Pure 316 Created page with "{{packet|name=Play Ambient Wave|description=Plays an ambient wave.|opcode=41|type=Fixed|length=4|revision=377}} == Play Ambient Wave == === Description === Plays an ambient w..." {{packet|name=Play Ambient Wave|description=Plays an ambient wave.|opcode=41|type=Fixed|length=4|revision=377}} == Play Ambient Wave == === Description === Plays an ambient wave. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Packed (xxxxyyyy) coordinates of sound. |- | [[Data_Types#Standard_data_types|Short]] | Wave index (ID). |- | [[Data_Types#Standard_data_types|Byte]] | Packed (rrrruuuu) sound settings, where r is the range of the sound. |- |} 377:Skill Level 0 248 45nxjrjisd7g5pfm0trz6tsxv4aw761 943 2014-03-07T01:40:48Z Pure 316 Created page with "{{packet|name=Skill Level|description=Sends a skill level to the client.|opcode=49|type=Fixed|length=6|revision=377}} == Skill Level == === Description === Sends a skill leve..." {{packet|name=Skill Level|description=Sends a skill level to the client.|opcode=49|type=Fixed|length=6|revision=377}} == Skill Level == === Description === Sends a skill level to the client. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special C]] | Skill ID. |- | [[Data Types#Standard data types|Byte]] | Skill level. |- | [[Data Types#Standard data types|Int]] | Skill experience. |- |} 377:Walkable Interface 0 253 0no83w3gb94m2246e3yh2sa32sdpkvg 950 2014-03-07T02:23:08Z Pure 316 Created page with "{{packet|name=Walkable interface|description=Displays an interface in walkable mode.|opcode=50|type=Fixed|length=2|revision=317}} == Walkable Interface == === Description ===..." {{packet|name=Walkable interface|description=Displays an interface in walkable mode.|opcode=50|type=Fixed|length=2|revision=317}} == Walkable Interface == === Description === This packet displays an interface in walkable mode. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] | Interface ID. |- |} 1013 2014-05-20T18:40:20Z Pure 316 {{packet|name=Walkable interface|description=Displays an interface in walkable mode.|opcode=50|type=Fixed|length=2|revision=377}} == Walkable Interface == === Description === This packet displays an interface in walkable mode. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data Types#Standard data types|Short]] | Interface ID. |- |} 377:Construct Map Region 0 192 2jkm8ggrzoq7tw2v6dk05yjykeben9b 467 2012-08-24T15:06:12Z Dirk 98 Created page with "{{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable|length=89|revision=377}} == Interface Animation == === Description === Sets the anim..." {{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable|length=89|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region Y (absolute Y coordinate / 8 + 6) |- | [[Data_Types#Standard_data_types|Bit Block]] | 1 bit (0 or 1) to decide if a tile exists. 26 bits for data about the tile (only if it exists) |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region X (absolute X coordinate / 8 + 6) |- |} === Information === The size of the packet will vary based on whether a tile exists or not. This means that the smallest size of the packet will be 89 bytes but could vary as high as 2285 bytes. If the tile exists then a 1 gets written to the output stream as a 1 otherwise a zero gets written to the stream. If the tile does exist then you would follow that 1 bit with 26 bits of information about the tile. int l9 = info >> 24 & 3; int j10 = info >> 1 & 3; int l10 = info >> 14 & 0x3ff; int j11 = info >> 3 & 0x7ff; === Implementation === for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { outStream.writeBit(1, tileExists ? 1 : 0); if(tileExists) outStream.writeBits(26, TILE_INFORMATION); } } } 468 2012-08-24T15:32:25Z Dirk 98 /* Information */ {{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable|length=89|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region Y (absolute Y coordinate / 8 + 6) |- | [[Data_Types#Standard_data_types|Bit Block]] | 1 bit (0 or 1) to decide if a tile exists. 26 bits for data about the tile (only if it exists) |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region X (absolute X coordinate / 8 + 6) |- |} === Information === The size of the packet will vary based on whether a tile exists or not. This means that the smallest size of the packet will be 89 bytes but could vary as high as 2285 bytes. If the tile exists then a 1 gets written to the output stream as a 1 otherwise a zero gets written to the stream. If the tile does exist then you would follow that 1 bit with 26 bits of information about the tile. int info = inStream.readBits(26); int unknown = info >> 24 & 3; int unknown = info >> 1 & 3; int regionX = info >> 14 & 0x3ff; int regionY = info >> 3 & 0x7ff; === Implementation === for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { outStream.writeBit(1, tileExists ? 1 : 0); if(tileExists) outStream.writeBits(26, TILE_INFORMATION); } } } 472 2012-08-24T15:44:57Z Dirk 98 {{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable Short|length=N/A|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region Y (absolute Y coordinate / 8 + 6) |- | [[Data_Types#Standard_data_types|Bit Block]] | 1 bit (0 or 1) to decide if a tile exists. 26 bits for data about the tile (only if it exists) |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region X (absolute X coordinate / 8 + 6) |- |} === Information === The size of the packet will vary based on whether a tile exists or not. This means that the smallest size of the packet will be 89 bytes but could vary as high as 2285 bytes. If the tile exists then a 1 gets written to the output stream as a 1 otherwise a zero gets written to the stream. If the tile does exist then you would follow that 1 bit with 26 bits of information about the tile. int info = inStream.readBits(26); int unknown = info >> 24 & 3; int unknown = info >> 1 & 3; int regionX = info >> 14 & 0x3ff; int regionY = info >> 3 & 0x7ff; === Implementation === for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { outStream.writeBit(1, tileExists ? 1 : 0); if(tileExists) outStream.writeBits(26, TILE_INFORMATION); } } } 473 2012-08-24T15:45:13Z Dirk 98 /* Information */ {{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable Short|length=N/A|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region Y (absolute Y coordinate / 8 + 6) |- | [[Data_Types#Standard_data_types|Bit Block]] | 1 bit (0 or 1) to decide if a tile exists. 26 bits for data about the tile (only if it exists) |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region X (absolute X coordinate / 8 + 6) |- |} === Information === If the tile exists then a 1 gets written to the output stream as a 1 otherwise a zero gets written to the stream. If the tile does exist then you would follow that 1 bit with 26 bits of information about the tile. int info = inStream.readBits(26); int unknown = info >> 24 & 3; int unknown = info >> 1 & 3; int regionX = info >> 14 & 0x3ff; int regionY = info >> 3 & 0x7ff; === Implementation === for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { outStream.writeBit(1, tileExists ? 1 : 0); if(tileExists) outStream.writeBits(26, TILE_INFORMATION); } } } 475 2012-08-25T02:51:23Z Sini 33 {{packet|name=Construct Map Region|description=Creates a map region.|opcode=53|type=Variable Short|length=N/A|revision=377}} == Interface Animation == === Description === Sets the animation for a model on an interface. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region Y (absolute Y coordinate / 8 + 6) |- | [[Data_Types#Standard_data_types|Bit Block]] | 1 bit (0 or 1) to decide if a tile exists. 26 bits for data about the tile (only if it exists) |- | [[Data_Types#Non_Standard_Data_Types|Big Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Map Region X (absolute X coordinate / 8 + 6) |- |} === Information === If the tile exists then a 1 gets written to the output stream as a 1 otherwise a zero gets written to the stream. If the tile does exist then you would follow that 1 bit with 26 bits of information about the tile. int info = inStream.readBits(26); int heightLevel = info >> 24 & 3; int rotation = info >> 1 & 3; int regionX = info >> 14 & 0x3ff; int regionY = info >> 3 & 0x7ff; === Implementation === for(int z = 0; z < 4; z++) { for(int x = 0; x < 13; x++) { for(int y = 0; y < 13; y++) { outStream.writeBit(1, tileExists ? 1 : 0); if(tileExists) outStream.writeBits(26, TILE_INFORMATION); } } } 377:Input Amount 0 249 28d53sc9ber6n6wbi9wiuu7pe1a9z3t 944 2014-03-07T01:43:05Z Pure 316 Created page with "{{packet|name=Input Amount|description=Forces the client to open the input amount interface.|opcode=58|type=Fixed|length=0|revision=377}} == Input Amount == === Description =..." {{packet|name=Input Amount|description=Forces the client to open the input amount interface.|opcode=58|type=Fixed|length=0|revision=377}} == Input Amount == === Description === Forces the client to open the input amount interface. 377:Create Static Graphic 0 265 m82ty5txekkl4p7vjxqys35iw7yovgi 975 2014-03-08T02:12:54Z Pure 316 Created page with "{{packet|name=Create Static Graphic|description=Creates a static graphic.|opcode=59|type=Fixed|length=6|revision=377}} == Create Static Graphic == === Description === Creates..." {{packet|name=Create Static Graphic|description=Creates a static graphic.|opcode=59|type=Fixed|length=6|revision=377}} == Create Static Graphic == === Description === Creates a static graphic. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | Position (xxxxyyyy) of the graphic. |- | [[Data_Types#Standard_data_types|Short]] | Graphic ID. |- | [[Data_Types#Standard_data_types|Byte]] | Height offset. |- | [[Data_Types#Standard_data_types|Short]] | Placement delay. |- |} 377:Send Message 0 251 lbleykq4llrza3g1moqq6hli9hf37nr 946 2014-03-07T01:49:45Z Pure 316 Created page with "{{packet|name=Send Message|description=Sends the specified message to the client.|opcode=63|type=Variable Byte|length=N/A|revision=377}} == Send Message == === Description ==..." {{packet|name=Send Message|description=Sends the specified message to the client.|opcode=63|type=Variable Byte|length=N/A|revision=377}} == Send Message == === Description === Sends the specified message to the client. === Packet Structure === {| border=2 ! Data type ! Description |- | [[RS String|RS String]] | Message. |- |} 954 2014-03-07T02:29:30Z Pure 316 {{packet|name=Send Message|description=Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request.|opcode=63|type=Variable Byte|length=N/A|revision=377}} == Send Message == === Description === Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. === Packet Structure === {| border=2 ! Data type ! Description |- | [[RS String|RS String]] | Message. |- |} 377:Camera Shake 0 259 mm4o2mm9m20ubnh1kkpines3vcn1un4 960 2014-03-08T01:32:58Z Pure 316 Created page with "{{packet|name=Camera Shake|description=Set camera shake parameters.|opcode=67|type=Fixed|length=4|revision=377}} == Camera Shake == === Description === Set camera shake param..." {{packet|name=Camera Shake|description=Set camera shake parameters.|opcode=67|type=Fixed|length=4|revision=377}} == Camera Shake == === Description === Set camera shake parameters. It may be worth reading about Sine Waves [http://en.wikipedia.org/wiki/Sine_wave]. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Byte]] | The index of the shake parameter to modify. |- | [[Data_Types#Standard_data_types|Byte]] | The range of the shake randomness. |- | [[Data_Types#Standard_data_types|Byte]] | The amplitude (maximum displacement from 0) of the shake. |- | [[Data_Types#Standard_data_types|Byte]] | The phase (where in its cycle the oscillation is at t = 0) of the shake. |- |} 377:Open Welcome Screen 0 260 awghop77opaseqikanb7i54lfpjcglt 962 2014-03-08T01:49:17Z Pure 316 Created page with "{{packet|name=Open Welcome Screen|description=Displays the welcome screen.|opcode=21|type=Fixed|length=23|revision=377}} == Open Welcome Screen == === Description === Display..." {{packet|name=Open Welcome Screen|description=Displays the welcome screen.|opcode=21|type=Fixed|length=23|revision=377}} == Open Welcome Screen == === Description === Displays the welcome screen. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Last password change occurance |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Unknown #1. |- | [[Data Types#Standard data types|Short]] | Unused #1. |- | [[Data Types#Standard data types|Short]] | Unknown #2. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Current server time. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Inbox message count. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Last log-in time. |- | [[Data Types#Standard data types|Short]] | Amount of members credit (days) remaining. |- | [[Data Types#Standard data types|Int]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Last log-in IPV4 address. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Recovery question change status. |- | [[Data Types#Standard data types|Byte]] [[Data Types#Standard data types|offset_t]] | Unused #2. |- |} 966 2014-03-08T01:53:09Z Pure 316 {{packet|name=Open Welcome Screen|description=Displays the welcome screen.|opcode=21|type=Fixed|length=23|revision=377}} == Open Welcome Screen == === Description === Displays the welcome screen. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Last password change occurance |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Unknown #1. |- | [[Data Types#Standard data types|Short]] | Unused #1. |- | [[Data Types#Standard data types|Short]] | Unknown #2. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Current server time. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Inbox message count. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Last log-in time. |- | [[Data Types#Standard data types|Short]] | Amount of members credit (days) remaining. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Int]] | Last log-in IPV4 address. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Recovery question change status. |- | [[Data Types#Standard data types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Unused #2. |- |} 970 2014-03-08T02:04:17Z Pure 316 {{packet|name=Open Welcome Screen|description=Displays the welcome screen.|opcode=21|type=Fixed|length=23|revision=377}} == Open Welcome Screen == === Description === Displays the welcome screen. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Last password change occurance |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Unknown #1. |- | [[Data Types#Standard data types|Short]] | Unused #1. |- | [[Data Types#Standard data types|Short]] | Unknown #2. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] | Current server time. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Inbox message count. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Last log-in time. |- | [[Data Types#Standard data types|Short]] | Amount of members credit (days) remaining. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Int]] | Last log-in IPV4 address. |- | [[Data Types#Big Endian|Big Endian]] [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Recovery question change status. |- | [[Data Types#Standard data types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Unused #2. |- |} * May be inaccurate. 377:Send Add Friend 0 254 tkam4xpjtkijluuul1f1q564pg0c8nq 951 2014-03-07T02:25:18Z Pure 316 Created page with "{{packet|name=Send Add Friend|description=Sends a friend to be added to the friend list.|opcode=78|type=Fixed|length=9|revision=377}} == Send Add Friend == === Description ==..." {{packet|name=Send Add Friend|description=Sends a friend to be added to the friend list.|opcode=78|type=Fixed|length=9|revision=377}} == Send Add Friend == === Description === Sends a friend to be added to the friend list. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Long]] | Player name (as long). |- | Unsigned [[Data Types#Standard data types|Byte]] | World. |- |} 377:Send Ground Item 0 263 hh9c0i7fgg32bpu48v6qvxlxo4y5vlj 968 2014-03-08T02:02:00Z Pure 316 Created page with "{{packet|name=Send Ground Item|description=Adds a ground item to the server. |opcode=107|type=Fixed|length=5|revision=377}} == Send Ground Item == === Description === Adds a ..." {{packet|name=Send Ground Item|description=Adds a ground item to the server. |opcode=107|type=Fixed|length=5|revision=377}} == Send Ground Item == === Description === Adds a ground item to the server. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Short]] | Item id. |- | [[Data Types#Standard data types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special S]] | Packed (xxxxyyyy) coordinates of the ground item. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Stack amount of the item. |- |} 969 2014-03-08T02:02:08Z Pure 316 {{packet|name=Send Ground Item|description=Adds a ground item to the server. |opcode=107|type=Fixed|length=5|revision=377}} == Send Ground Item == === Description === Adds a ground item to the server. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data Types#Standard data types|Short]] | Item ID. |- | [[Data Types#Standard data types|Byte]] [[Data_Types#Non_Standard_Data_Types|Special S]] | Packed (xxxxyyyy) coordinates of the ground item. |- | [[Data Types#Standard data types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Stack amount of the item. |- |} 377:Reset Button State 0 255 0v648ez8o1r91aqa8l3ou5g8jbi6hcu 952 2014-03-07T02:28:27Z Pure 316 Created page with "{{packet|name=Reset Button State|description=Resets the button state for all buttons.|opcode=113|type=Fixed|length=0|revision=377}} == Reset Button State == === Description =..." {{packet|name=Reset Button State|description=Resets the button state for all buttons.|opcode=113|type=Fixed|length=0|revision=377}} == Reset Button State == === Description === Resets the button state for all buttons. 377:Run Energy 0 246 546ddggh830dk8jivaazwqzt906m3yt 940 2014-03-07T01:31:52Z Pure 316 Created page with "{{packet|name=Run Energy|description=Sets the player's run energy in the client.|opcode=125|type=Fixed|length=1|revision=377}} == Run Energy == === Description === Sets the p..." {{packet|name=Run Energy|description=Sets the player's run energy in the client.|opcode=125|type=Fixed|length=1|revision=377}} == Run Energy == === Description === Sets the player's run energy in the client. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data Types#Standard data types|Byte]] | The energy level. |- |} 947 2014-03-07T02:15:50Z Pure 316 {{packet|name=Run Energy|description=Sends the players run energy level.|opcode=125|type=Fixed|length=1|revision=377}} == Run Energy == === Description === Sends the players run energy level. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data Types#Standard data types|Byte]] | The energy level. |- |} 958 2014-03-08T01:24:02Z Pure 316 {{packet|name=Run Energy|description=Sends the players run energy level.|opcode=125|type=Fixed|length=1|revision=377}} == Run Energy == === Description === Sends the players run energy level. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data Types#Standard data types|Byte]] | The amount of energy remaining. |- |} 377:Initialize Player 0 252 t4wbm5nrnrfvf58ll5o63okjbzuoisr 949 2014-03-07T02:21:09Z Pure 316 Created page with "{{packet|name=Initialize Player|description=Sends the player's membership status and their current index on the server's player list.|opcode=249|type=Fixed|length=3|revision=3..." {{packet|name=Initialize Player|description=Sends the player's membership status and their current index on the server's player list.|opcode=249|type=Fixed|length=3|revision=377}} == Initialize Player == === Description === Sends the player's membership status and their current index on the server's player list. === Packet Structure === {| border=2 ! Data type ! Description |- | Unsigned [[Data_Types#Standard_data_types|Byte]] | Membership flag (1 = member, 0 = free). |- | Unsigned [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Short]] | Player list index. |- |} 377:Inventory Overlay 0 250 e4q8ttl33quqa4k2fnpz990o7qt1syr 945 2014-03-07T01:45:55Z Pure 316 Created page with "{{packet|name=Inventory Overlay|description=Sets the interface overlay for the inventory.|opcode=128|type=Fixed|length=4|revision=377}} == Inventory Overlay == === Descriptio..." {{packet|name=Inventory Overlay|description=Sets the interface overlay for the inventory.|opcode=128|type=Fixed|length=4|revision=377}} == Inventory Overlay == === Description === Sets the specified interface to the specified inventory. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Standard_data_types|Special A]] | Interface ID. |- | [[Data_Types#Byte_Order|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Inventory interface ID |- |} 948 2014-03-07T02:16:01Z Pure 316 {{packet|name=Inventory Overlay|description=Displays the specified interface over the specified inventory.|opcode=128|type=Fixed|length=4|revision=377}} == Inventory Overlay == === Description === Displays the specified interface over the specified inventory. === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Standard_data_types|Special A]] | Interface ID. |- | [[Data_Types#Byte_Order|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | Inventory interface ID |- |} 443 Protocol 0 193 a2gzu40x8z9ucw0wp1hgci8jcnl92qo 476 2012-08-25T03:06:14Z Sini 33 Created page with "[[Category:RS2]] ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[414:Player_Update|Player Up..." [[Category:RS2]] ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[414:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[414:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[414:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[414:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[414:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[414:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[414:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[414:Logout|Logout]] ! Logs the client out from the server. |-} 477 2012-08-25T03:09:10Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[414:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[414:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[414:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[414:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[414:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[414:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[414:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[414:Logout|Logout]] ! Logs the client out from the server. |-} 479 2012-08-25T03:15:10Z Sini 33 moved [[414 Protocol]] to [[443 Protocol]]: Oops, named it wrong. [[Category:RS2]] [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[414:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[414:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[414:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[414:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[414:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[414:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[414:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[414:Logout|Logout]] ! Logs the client out from the server. |-} 481 2012-08-25T03:17:07Z Sini 33 [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |-} 482 2012-08-25T03:18:12Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |-} 490 2012-08-25T18:05:23Z Sini 33 [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 491 2012-08-25T18:11:52Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 492 2012-08-25T18:14:24Z Sini 33 /* Client > Server Protocol */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 493 2012-08-25T18:14:42Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 494 2012-08-25T18:15:02Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 495 2012-08-25T18:15:10Z Sini 33 /* Client > Server Protocol */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 496 2012-08-25T18:15:29Z Sini 33 /* Client > Server Protocol */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 497 2012-08-25T18:17:27Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 498 2012-08-25T18:18:48Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 499 2012-08-25T18:25:00Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 500 2012-08-25T18:26:37Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 501 2012-08-25T18:28:03Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset_Items]] ! Resets all the items in an item container. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 502 2012-08-25T18:28:16Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 503 2012-08-25T18:31:11Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Map|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 504 2012-08-25T18:33:18Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 505 2012-08-25T18:34:33Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 506 2012-08-25T18:34:47Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 507 2012-08-25T18:35:04Z Sini 33 /* Client > Server Protocol */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 508 2012-08-25T18:35:15Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3, padding = 3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 509 2012-08-25T18:35:31Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3; padding = 3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 510 2012-08-25T18:35:39Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Rebuilds the players scene graph but the sectors for which the map will use are provided. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 511 2012-08-25T18:36:12Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 512 2012-08-25T19:07:38Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 513 2012-08-25T19:09:36Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 514 2012-08-25T23:21:55Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 515 2012-08-25T23:28:24Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 516 2012-08-25T23:31:33Z Sini 33 /* Server > Client Packets */ [[Category:RS2]] ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 517 2012-08-25T23:35:06Z Sini 33 [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the screen is overlayed with a widget. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 518 2012-08-25T23:40:41Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 519 2012-08-25T23:43:29Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 520 2012-08-25T23:44:26Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 25 ! Scene Graph Rebuild ! Ingame client state where the client rebuilds the scene graph. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 521 2012-08-25T23:44:44Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 522 2012-08-25T23:46:33Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading ! Out of game client state where the client is loading itself to the login screen. |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 523 2012-08-25T23:51:52Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Out of game client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Out of game client state where the client is loading itself to the login screen. |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 524 2012-08-25T23:56:47Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Out of game client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Out of game client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Out of game client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Out of game client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Ingame client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Out of game client state where the client engages to log in to the server. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 525 2012-08-26T00:00:29Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 526 2012-08-26T00:02:18Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 527 2012-08-26T00:03:11Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server > Client Packets=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Protocol=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 528 2012-08-26T00:04:09Z Sini 33 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server > Client Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client > Server Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 529 2012-08-26T00:04:37Z Sini 33 /* Game Protocol */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 530 2012-08-26T00:06:36Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 531 2012-08-26T00:10:40Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 532 2012-08-26T00:11:01Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 533 2012-08-26T00:14:32Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 534 2012-08-26T00:16:36Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 535 2012-08-26T00:19:22Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 536 2012-08-26T00:22:46Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 537 2012-08-26T00:26:38Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 538 2012-08-26T00:34:04Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 539 2012-08-26T00:36:12Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 540 2012-08-26T00:42:44Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 541 2012-08-26T00:46:51Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states may be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 543 2012-08-26T00:52:50Z Sini 33 /* Client States */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 548 2012-08-26T05:21:28Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 549 2012-08-26T05:24:23Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 550 2012-08-26T05:26:14Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 551 2012-08-26T05:31:48Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 552 2012-08-26T17:54:16Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 553 2012-08-26T17:58:38Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 554 2012-08-26T22:20:20Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 555 2012-08-26T22:20:38Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 556 2012-08-26T23:45:13Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 557 2012-08-26T23:46:08Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Close Window|Close Window]] ! Called when the currently opened window is closed. |} 558 2012-08-27T00:01:35Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 559 2012-08-27T00:55:23Z Sini 33 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Actions== {| border=3 |- ! Opcode ! Frame Id ! Description |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 560 2012-08-27T00:58:08Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! Action called when a friend is added. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 561 2012-08-27T00:58:58Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! Action for when a friend is added. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! Action for when an ignore is added. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 562 2012-08-27T00:59:59Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! Action for when an ignore is removed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 563 2012-08-27T03:57:36Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Action Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_add } ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_remove } ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_add } ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_remove } ! Action for when an ignore is removed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 564 2012-08-27T04:19:13Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Action Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_add } ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_remove } ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_add } ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_remove } ! Action for when an ignore is removed. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! #{ action } #{ npc_name } |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 565 2012-08-27T04:19:36Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Action Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_add } ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_remove } ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_add } ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_remove } ! Action for when an ignore is removed. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the 0 or first option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 566 2012-08-27T04:21:47Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Action Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_add } ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_remove } ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_add } ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_remove } ! Action for when an ignore is removed. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the third option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 567 2012-08-27T04:24:22Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Action Name ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_add } ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! #{ name_of_friend_to_remove } ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_add } ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! #{ name_of_ignore_to_remove } ! Action for when an ignore is removed. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 568 2012-08-27T04:25:13Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 569 2012-08-27T04:29:01Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 570 2012-08-27T04:31:30Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 571 2012-08-27T04:32:37Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! #{ action } #{ npc_name } ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 572 2012-08-27T04:32:52Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 573 2012-08-27T04:39:49Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 579 2012-08-27T23:29:50Z Sini 33 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object_Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 580 2012-08-27T23:33:56Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 581 2012-08-27T23:43:28Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 582 2012-08-27T23:53:13Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_Option_0|Item Option 0]] ! id ! slot ! widget id ! Action for the first option of a widget item. |- ! 28 ! [[443:Item_Option_0|Item Option 0]] ! id ! slot ! widget id ! Action for the first option of a widget item. |- ! 16 ! [[443:Item_Option_1|Item Option 1]] ! id ! slot ! widget id ! Action for the second option of a widget item. |- ! 54 ! [[443:Item_Option_2|Item Option 2]] ! id ! slot ! widget id ! Action for the third option of a widget item. |- ! 32 ! [[443:Item_Option_3|Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of a widget item. |- ! 19 ! [[443:Item_Option_4|Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 583 2012-08-27T23:53:46Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_Option_0|Item Option 0]] ! id ! slot ! widget id ! Action for the first option of a widget item. |- ! 16 ! [[443:Item_Option_1|Item Option 1]] ! id ! slot ! widget id ! Action for the second option of a widget item. |- ! 54 ! [[443:Item_Option_2|Item Option 2]] ! id ! slot ! widget id ! Action for the third option of a widget item. |- ! 32 ! [[443:Item_Option_3|Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of a widget item. |- ! 19 ! [[443:Item_Option_4|Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 584 2012-08-27T23:57:07Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_Option_0|Item Option 0]] ! id ! slot ! widget id ! Action for the first option of a widget item. |- ! 16 ! [[443:Item_Option_1|Item Option 1]] ! id ! slot ! widget id ! Action for the second option of a widget item. |- ! 54 ! [[443:Item_Option_2|Item Option 2]] ! id ! slot ! widget id ! Action for the third option of a widget item. |- ! 32 ! [[443:Item_Option_3|Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of a widget item. |- ! 19 ! [[443:Item_Option_4|Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of a widget item. |- ! 1004 ! [[443:Item_Option_4|Item Option 4]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 587 2012-08-28T01:17:01Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_Option_0|Item Option 0]] ! id ! slot ! widget id ! Action for the first option of a widget item. |- ! 16 ! [[443:Item_Option_1|Item Option 1]] ! id ! slot ! widget id ! Action for the second option of a widget item. |- ! 54 ! [[443:Item_Option_2|Item Option 2]] ! id ! slot ! widget id ! Action for the third option of a widget item. |- ! 32 ! [[443:Item_Option_3|Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of a widget item. |- ! 19 ! [[443:Item_Option_4|Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of a widget item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 593 2012-08-28T02:56:05Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 594 2012-08-28T03:00:54Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 595 2012-08-28T03:06:17Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of a ground item. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of a ground item. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of a ground item. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 596 2012-08-28T03:08:43Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 597 2012-08-28T03:09:05Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 598 2012-08-28T04:13:15Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 599 2012-08-28T04:16:05Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 29 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! NA ! NA ! NA ! Action for when the currently open widgets are closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 600 2012-08-28T04:18:54Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} 601 2012-08-28T04:30:32Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 602 2012-08-28T04:31:40Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 609 2012-08-28T12:07:10Z Sini 33 /* Other */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 610 2012-08-28T12:09:30Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 611 2012-08-28T12:11:14Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of a widget item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 612 2012-08-28T12:12:03Z Sini 33 /* Examine */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 614 2012-08-29T03:10:24Z Sini 33 /* Other */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 615 2012-08-29T04:16:18Z Sini 33 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 616 2012-08-29T04:21:00Z Sini 33 /* Other */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 617 2012-08-29T04:21:11Z Sini 33 /* Examine */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entity=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 618 2012-08-29T04:25:30Z Sini 33 /* Entity */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 619 2012-08-29T04:26:22Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Other Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 620 2012-08-29T04:27:27Z Sini 33 /* Other */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Other Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 621 2012-08-29T04:27:39Z Sini 33 /* Other Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Other Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of a ground item. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 622 2012-08-29T04:30:03Z Sini 33 /* Other Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Other Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 623 2012-08-29T04:30:31Z Sini 33 /* Other Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobs=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 624 2012-08-29T04:30:44Z Sini 33 /* Mobs */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobile Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 625 2012-08-29T04:32:55Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobile Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 626 2012-08-29T04:34:53Z Sini 33 /* Examine */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Mobile Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 627 2012-08-29T04:45:47Z Sini 33 /* Client Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 628 2012-08-29T04:46:02Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 629 2012-08-29T04:47:54Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Social Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 630 2012-08-29T04:50:43Z Sini 33 /* Social Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Social List Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 631 2012-08-29T04:51:20Z Sini 33 /* Client Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 636 2012-08-29T20:50:41Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 637 2012-08-29T20:50:54Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 638 2012-08-29T20:51:40Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description ! 44 |- ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 639 2012-08-29T20:52:23Z Sini 33 /* Entities */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 640 2012-09-02T03:19:43Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check_Request|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 643 2012-09-03T19:35:25Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[443:Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 644 2012-09-03T19:35:43Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 665 2012-09-08T03:45:36Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 109 ! FIXED ! NA ! [[443:Spawn_Ambient_Effect|Spawn Ambient Effect]] ! Spawns an ambient effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 666 2012-09-08T03:45:56Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 109 ! FIXED ! NA ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 667 2012-09-08T03:54:58Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 668 2012-09-08T03:56:47Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. ! |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 669 2012-09-08T03:57:09Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 670 2012-09-08T17:57:47Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Timed_Ground_Item|Spawn Timed Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 671 2012-09-08T17:59:16Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. !- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 672 2012-09-08T18:00:06Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 673 2012-09-08T18:13:10Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 674 2012-09-08T18:23:33Z Sini 33 /* Server Frames */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} 675 2012-09-08T20:51:36Z Sini 33 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the player to a position on the map. |} 676 2012-09-08T20:52:49Z Sini 33 /* NPC */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the player to a position on the map. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |} 677 2012-09-08T20:54:07Z Sini 33 /* NPC */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the npc to a position on the map. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |} 678 2012-09-08T20:59:16Z Sini 33 /* NPC */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 679 2012-09-08T20:59:37Z Sini 33 /* Update Flags */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 680 2012-09-08T21:00:53Z Sini 33 /* NPC */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed Window|Closed Window]] ! Called when the currently opened window is closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 681 2012-09-11T01:07:18Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 682 2012-09-14T03:34:06Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 4]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 683 2012-09-14T03:44:00Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 4]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 684 2012-09-14T03:44:36Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 4]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Item|Widget On Item]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 685 2012-09-14T03:50:30Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 4]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Item|Widget On Item]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! ! ! ! [[443:Still_Object_Examine|Still Object Examine]] ! |- ! ! ! ! [[443:Npc_Examine|Npc Examine]] ! |- ! ! ! ! [[443:Item_Examine|Item Examine]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 686 2012-09-14T03:53:21Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 4]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Item|Widget On Item]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! ! ! ! [[443:Still_Object_Examine|Still Object Examine]] ! |- ! ! ! ! [[443:Npc_Examine|Npc Examine]] ! |- ! ! ! ! [[443:Item_Examine|Item Examine]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 689 2012-09-15T21:45:50Z Sini 33 /* Actions */ [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 3]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Item|Widget On Item]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! ! ! ! [[443:Still_Object_Examine|Still Object Examine]] ! |- ! ! ! ! [[443:Npc_Examine|Npc Examine]] ! |- ! ! ! ! [[443:Item_Examine|Item Examine]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} 871 2013-07-14T04:23:37Z Sini 33 Blanked the page 874 2013-07-14T10:31:57Z Jmood 88 [[Category:RS2]] ==Client States== Client states are used to switch between different graphic and logic procedures. The state of the client is global. There may be cases where two states will be handled the same graphically but different logically, vice versa. {| border=3 |- ! Opcode ! Name ! Description |- ! 0 ! Loading (initial) ! Client state where the client is initially loading itself to the login screen. |- ! 5 ! Loading ! Client state where the client is loading itself to the login screen. |- ! 10 ! Login Screen ! Client state where the client is on the login screen. |- ! 20 ! Login (initial) ! Client state where the client initially engages to log in to the server. |- ! 25 ! Map Rebuild ! Ingame client state where the client rebuilds the map. |- ! 30 ! Ingame ! Default ingame client state. |- ! 35 ! Ingame (screen overlay) ! Client state where the client screen is overlayed with a widget. |- ! 40 ! Login ! Client state where the client engages to log in to the server. |- ! 1000 ! Fatal Ondemand Error ! Client state where the client has encountered a fatal ondemand error and will no longer use the ondemand service. |} ==Client Actions== ===Social=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 31 ! [[443:Add_Friend|Add Friend]] ! NA ! NA ! NA ! Action for when a friend is added. |- ! 2 ! [[443:Remove_Friend|Remove Friend]] ! NA ! NA ! NA ! Action for when a friend is removed. |- ! 21 ! [[443:Add_Ignore|Add Ignore]] ! NA ! NA ! NA ! Action for when an ignore is added. |- ! 50 ! [[443:Remove_Ignore|Remove Ignore]] ! NA ! NA ! NA ! Action for when an ignore is removed. |} ===Entities=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 44 ! [[443:Player_Option_0|Player Option 0]] ! id ! position x ! position y ! Action for the first option of a player. |- ! 22 ! [[443:Player_Option_1|Player Option 1]] ! id ! position x ! position y ! Action for the second option of a player. |- ! 52 ! [[443:Player_Option_2|Player Option 2]] ! id ! position x ! position y ! Action for the third option of a player. |- ! 56 ! [[443:Player_Option_3|Player Option 3]] ! id ! position x ! position y ! Action for the fourth option of a player. |- ! 1 ! [[443:Player_Option_4|Player Option 4]] ! id ! position x ! position y ! Action for the fifth option of a player. |- ! 41 ! [[443:Npc_Option_0|Npc Option 0]] ! id ! position x ! position y ! Action for the first option of a NPC. |- ! 17 ! [[443:Npc_Option_1|Npc Option 1]] ! id ! position x ! position y ! Action for the second option of a NPC. |- ! 13 ! [[443:Npc_Option_2|Npc Option 2]] ! id ! position x ! position y ! Action for the third option of a NPC. |- ! 53 ! [[443:Npc_Option_3|Npc Option 3]] ! id ! position x ! position y ! Action for the fourth option of a NPC. |- ! 46 ! [[443:Npc_Option_4|Npc Option 4]] ! id ! position x ! position y ! Action for the fifth option of a NPC. |- ! 40 ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! item id ! position x ! position y ! Action for the first option of a ground item. |- ! 38 ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! item id ! position x ! position y ! Action for the second option of a ground item. |- ! 34 ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! item id ! position x ! position y ! Action for the third option of a ground item. |- ! 11 ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! item id ! position x ! position y ! Action for the fourth option of a ground item. |- ! 3 ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! item id ! position x ! position y ! Action for the fifth option of a ground item. |- ! 55 ! [[443:Object_Option_0|Object Option 0]] ! info hash ! position x ! position y ! Action for the first option of an object. |- ! 57 ! [[443:Object_Option_1|Object Option 1]] ! info hash ! position x ! position y ! Action for the second option of an object. |- ! 43 ! [[443:Object_Option_2|Object Option 2]] ! info hash ! position x ! position y ! Action for the third option of an object. |- ! 6 ! [[443:Object_Option_3|Object Option 3]] ! info hash ! position x ! position y ! Action for the fourth option of an object. |- ! 1005 ! [[443:Object_Option_4|Object Option 4]] ! info hash ! position x ! position y ! Action for the fifth option of an object. |- |} ===Widget=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 28 ! [[443:Item_On_Widget_Option_0|Item on Widget Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 16 ! [[443:Item_On_Widget_Option_1|Item on Widget Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 54 ! [[443:Item_On_Widget_Option_2|Item on Widget Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 32 ! [[443:Item_On_Widget_Option_3|Item on Widget Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 19 ! [[443:Item_On_Widget_Option_4|Item on Widget Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |- ! 35 ! [[443:Widget_Item_Option_0|Widget Item Option 0]] ! id ! slot ! widget id ! Action for the first option of an item on a widget. |- ! 30 ! [[443:Widget_Item_Option_1|Widget Item Option 1]] ! id ! slot ! widget id ! Action for the second option of an item on a widget. |- ! 26 ! [[443:Widget_Item_Option_2|Widget Item Option 2]] ! id ! slot ! widget id ! Action for the third option of an item on a widget. |- ! 25 ! [[443:Widget_Item_Option_3|Widget Item Option 3]] ! id ! slot ! widget id ! Action for the fourth option of an item on a widget. |- ! 49 ! [[443:Widget_Item_Option_4|Widget Item Option 4]] ! id ! slot ! widget id ! Action for the fifth option of an item on a widget. |} ===Examine=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 1006 ! [[443:Object_Examine|Object Examine]] ! id ! position x ! position y ! Action for the examine option of an object. |- ! 1001 ! [[443:Npc_Examine|Npc Examine]] ! id ! position x ! position y ! Action for the examine option of a Npc. |- ! 1003 ! [[443:Ground_Item_Examine|Ground Item Examine]] ! id ! position x ! position y ! Action for the examine option of a ground item. |- ! 1004 ! [[443:Item_Examine|Item Examine]] ! id ! slot ! widget id ! Action for the examine option of an item. |} ===Other=== {| border=3 |- ! Opcode ! Frame Name ! Variable 0 ! Variable 1 ! Variable 2 ! Description |- ! 29 ! [[443:Close_Window|Close Window]] ! NA ! NA ! NA ! Action for when the currently open window is closed. |} ==Game Protocol== ===Server Frames=== {| border=3 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 29 ! VARIABLE SHORT ! NA ! [[443:Player_Update|Player Update]] ! Updates the players within the client's view. |- ! 238 ! VARIABLE SHORT ! NA ! [[443:NPC_Update|NPC Update]] ! Updates the npcs within the client's view. |- ! 121 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Scene Graph]] ! Rebuilds the players scene graph. |- ! 193 ! VARIABLE SHORT ! NA ! [[443:Rebuild_Scene_Graph|Rebuild Custom Scene Graph]] ! Builds a custom scene graph. |- ! 199 ! FIXED ! 3 ! [[443:Set_Location|Set Location]] ! Sets the location on the map of where the player is. |- ! 111 ! FIXED ! 6 ! [[443:Move_Camera_To|Move Camera To]] ! Moves the camera to a location on the map. |- ! 157 ! VARIABLE BYTE ! NA ! [[443:Send_Message|Send Message]] ! Sends a message to the client's chatbox. |- ! 58 ! FIXED ! 6 ! [[443:Update_Skill|Update Skill]] ! Updates a skill by sending its experience and dynamic level. |- ! 226 ! FIXED ! 1 ! [[443:Update_Run_Energy|Update Run Energy]] ! Updates the amount of run energy the player has. |- ! 87 ! FIXED ! 1 ! [[443:Set_Minimap_State|Set Minimap State]] ! Sets the minimap state. |- ! 117 ! FIXED ! 1 ! [[443:System_Update|System Update]] ! Informs the client that a system update will be happening. |- ! 192 ! VARIABLE SHORT ! NA ! [[443:Execute_Client_Script|Execute Client Script]] ! Executes a client script. |- ! 204 ! VARIABLE SHORT ! NA ! [[Class_Check|Class Check Request]] ! Parses a request for a class check request. |- ! 89 ! FIXED ! 5 ! [[443:Player_Sound_Effect|Player Sound Effect]] ! Plays a sound effect. |- ! 74 ! FIXED ! 6 ! [[443:Set_State_Value|Set State Value (large)]] ! Sets the value of a client state variable. |- ! 62 ! FIXED ! 3 ! [[443:Set_State_Value|Set State Value (small)]] ! Sets the value of a client state variable. |- ! 163 ! FIXED ! 0 ! [[443:Reset_States|Reset States]] ! Resets all the client state variables. |- ! 160 ! FIXED ! 4 ! [[443:Display_Window|Display Window]] ! Displays a widget as a window. |- ! 221 ! FIXED ! 4 ! [[443:Display_Screen_Overlay|Display Screen Overlay]] ! Displays widgets over the entire screen of the client. |- ! 6 ! FIXED ! 2 ! [[443:Display_Chatbox_Interface|Display Chatbox Interface]] ! Displays the chatbox as a widget. |- ! 178 ! FIXED ! 0 ! [[443:Close_Displayed_Widgets|Close Displayed Widgets]] ! Closes all the displayed widgets except for the chatbox interface. |- ! 51 ! FIXED ! 0 ! [[443:Fetch_Input|Fetch Input]] ! Fetches input from the chatbox. |- ! 3 ! FIXED ! 6 ! [[443:Change_Inactive_Color|Change Inactive Color]] ! Changes the widget's inactive color. |- ! 232 ! FIXED ! 10 ! [[443:Set_Offset|Set Offset]] ! Sets the x and y offset of a widget. |- ! 31 ! FIXED ! 4 ! [[443:Display_Player_On_Widget|Display Player on Widget]] ! Displays the local player on a widget. |- ! 137 ! FIXED ! 10 ! [[443:Display_Item_On_Widget|Display Item on Widget]] ! Displays the model of an item on a widget. |- ! 147 ! FIXED ! 10 ! [[443:Set_Model_Rotation|Set Model Rotation]] ! Sets the x and y rotation of a model on a widget. |- ! 73 ! FIXED ! 8 ! [[443:Rotate_Model|Rotate Model]] ! Sets the step amount to rotate the model continuously about the x axis. |- ! 228 ! VARIABLE SHORT ! NA ! [[443:Send_Items|Send Items]] ! Sends the items in an item container. |- ! 213 ! VARIABLE SHORT ! NA ! [[443:Update_Items|Update Items]] ! Updates the items in an item container from their slot id. |- ! 245 ! FIXED ! 0 ! [[443:Reset_Items|Reset Items]] ! Resets all the items in an item container. |- ! 82 ! FIXED ! 2 ! [[443:Set_Spawn_Sector|Set Spawn Sector]] ! Sets the sector on the map where entities will be spawned. |- ! 244 ! VARIABLE SHORT ! NA ! [[443:Spawn_Sector|Spawn Sector]] ! Parses the sector of the map to spawn entities, then the actual entity spawns. |- ! 207 ! FIXED ! 5 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item. |- ! 94 ! FIXED ! 7 ! [[443:Spawn_Ground_Item|Spawn Ground Item]] ! Spawns a ground item that will ignore whoever it has already been spawned to. |- ! 79 ! FIXED ! 7 ! [[443:Update_Ground_Item|Update Ground Item]] ! Updates the item amount for a ground item. |- ! 84 ! FIXED ! 3 ! [[443:Remove_Ground_Item|Remove Ground Item]] ! Removes a ground item. |- ! 122 ! FIXED ! 4 ! [[443:Spawn_Still_Object|Spawn Still Object]] ! Spawns a still object. |- ! 170 ! FIXED ! 4 ! [[443:Animate_Still_Object|Animate Still Object]] ! Animates a still object. |- ! 69 ! FIXED ! 2 ! [[443:Remove_Still_Object|Remove Still Object]] ! Removes a still object. |- ! 115 ! FIXED ! 6 ! [[443:Spawn_Still_Graphic|Spawn Still Graphic]] ! Spawns a still graphic. |- ! 101 ! FIXED ! 15 ! [[443:Spawn_Projectile|Spawn Projectile]] ! Spawns a projectile. |- ! 109 ! FIXED ! 5 ! [[443:Spawn_Ambient_Sound_Effect|Spawn Ambient Sound Effect]] ! Spawns an ambient sound effect. |- ! 133 ! FIXED ! 2 ! [[443:Reset_Sector|Reset Sector]] ! Resets all the ground items and still objects in a sector. |- ! 41 ! FIXED ! 0 ! [[443:Logout|Logout]] ! Logs the client out from the server. |} ===Client Frames=== ==== Actions ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 90 ! FIXED ! 8 ! [[443:Add_Friend|Add Friend]] ! Called when a new name has been added to the friend list. |- ! 159 ! FIXED ! 8 ! [[443:Remove_Friend|Remove Friend]] ! Called when a name has been removed from the friend list. |- ! 198 ! FIXED ! 8 ! [[443:Add_Ignore|Add Ignore]] ! Called when a new name has been added to the ignore list. |- ! 250 ! FIXED ! 8 ! [[443:Remove_Ignore|Remove Ignore]] ! Called when a name has been removed from the ignore list. |- ! 11 ! FIXED ! 2 ! [[443:Player_Option_0|Player Option 0]] ! Called when the first option of a player is activated. |- ! 169 ! FIXED ! 2 ! [[443:Player_Option_1|Player Option 1]] ! Called when the second option of a player is activated. |- ! 229 ! FIXED ! 2 ! [[443:Player_Option_2|Player Option 2]] ! Called when the third option of a player is activated. |- ! 101 ! FIXED ! 2 ! [[443:Player_Option_3|Player Option 3]] ! Called when the fourth option of a player is activated. |- ! 206 ! FIXED ! 2 ! [[443:Player_Option_4|Player Option 4]] ! Called when the fifth option of a player is activated. |- ! ! ! ! [[443:Npc_Option_0|Npc Option 0]] ! |- ! ! ! ! [[443:Npc_Option_1|Npc Option 1]] ! |- ! ! ! ! [[443:Npc_Option_2|Npc Option 2]] ! |- ! ! ! ! [[443:Npc_Option_3|Npc Option 3]] ! |- ! ! ! ! [[443:Npc_Option_4|Npc Option 4]] ! |- ! ! ! ! [[443:Ground_Item_Option_0|Ground Item Option 0]] ! |- ! ! ! ! [[443:Ground_Item_Option_1|Ground Item Option 1]] ! |- ! ! ! ! [[443:Ground_Item_Option_2|Ground Item Option 2]] ! |- ! ! ! ! [[443:Ground_Item_Option_3|Ground Item Option 3]] ! |- ! ! ! ! [[443:Ground_Item_Option_4|Ground Item Option 4]] ! |- ! ! ! ! [[443:Still_Object_Option_0|Still Object Option 0]] ! |- ! ! ! ! [[443:Still_Object_Option_1|Still Object Option 1]] ! |- ! ! ! ! [[443:Still_Object_Option_2|Still Object Option 2]] ! |- ! ! ! ! [[443:Still_Object_Option_3|Still Object Option 3]] ! |- ! ! ! ! [[443:Still_Object_Option_4|Still Object Option 4]] ! |- ! ! ! ! [[443:Item_On_Player|Item On Player]] ! |- ! ! ! ! [[443:Item_On_NPC|Item On NPC]] ! |- ! ! ! ! [[443:Item_On_Ground_Item|Item On Ground Item]] ! |- ! ! ! ! [[443:Item_On_Still_Object|Item On Still Object]] ! |- ! ! ! ! [[443:Item_On_Item|Item On Item]] ! |- ! ! ! ! [[443:Widget_On_Player|Widget On Player]] ! |- ! ! ! ! [[443:Widget_On_NPC|Widget On NPC]] ! |- ! ! ! ! [[443:Widget_On_Ground_Item|Widget On Ground Item]] ! |- ! ! ! ! [[443:Widget_On_Still_Object|Widget On Still Object]] ! |- ! ! ! ! [[443:Widget_On_Item|Widget On Item]] ! |- ! ! ! ! [[443:Widget_On_Widget|Widget On Widget]] ! |- ! ! ! ! [[443:Still_Object_Examine|Still Object Examine]] ! |- ! ! ! ! [[443:Npc_Examine|Npc Examine]] ! |- ! ! ! ! [[443:Item_Examine|Item Examine]] ! |- ! 54 ! FIXED ! 4 ! [[443:Widget_Action|Widget Action]] ! Called when a widget action is activated. |- ! 70 ! FIXED ! 0 ! [[443:Closed_Overlays|Closed Overlays]] ! Called when the currently opened overlays are closed. |} ==== Other ==== {| border = 3, padding = 2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- ! 194 ! VARIABLE BYTE ! NA ! [[Class_Check|Class Check Response]] ! Response to a class check request sent from the server. |- ! 4 ! NA ! VARIABLE BYTE ! [[443:Chat|Chat]] ! Called when the client enters in a chat message. |- ! 21 ! 0 ! FIXED ! [[443:Map_Rebuilt|Map Rebuilt]] ! Called when the map has been successfully rebuilt. |- ! 174 ! NA ! VARIABLE BYTE ! [[443:Command|Command]] ! Called when the client inputs a command. |} === Update Flags === All flags are listed in order in which they are parsed. ==== Player ==== ==== NPC ==== {| border=3px ! Opcode ! Name ! Description |- ! 0x2 ! Face Position ! Turns to face the NPC to a position on the map. |- ! 0x20 ! Animate ! Animates the NPC. |- ! 0x40 ! Display Hit One ! Displays a hit on the NPC. |- ! 0x4 ! Display Still Graphic ! Displays a still graphic on the NPC. |- ! 0x10 ! Turn to mobile entity ! Turns to face the NPC to a mobile entity on the map. |- ! 0x80 ! Display Hit Two ! Displays a hit on the npc. |- ! 0x1 ! Turn into NPC ! Changes the id of the NPC and its animations. |- ! 0x8 ! Display chat text ! Displays chat text above the head of the NPC. |} Class Check 0 208 2pk80mfnbm9s7cfcndjqmtx6raug1yq 645 2012-09-03T19:41:16Z Sini 33 Created page with "The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, updat..." The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. 646 2012-09-03T19:42:03Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. 647 2012-09-03T19:42:38Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Response == 648 2012-09-03T19:50:32Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == {| border=2px ! Opcode ! Description |- ! 0 ! Successfully executed the request. |- ! -1 ! ClassNotFoundException - On receive. |- ! -2 ! SecurityException - On receive. |- ! -3 ! NullPointerException - On receive. |- ! -4 ! Exception - On receive. |- ! -5 ! Throwable - On receive. |} 649 2012-09-03T19:50:40Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Response Return Codes == {| border=2px ! Opcode ! Description |- ! 0 ! Successfully executed the request. |- ! -1 ! ClassNotFoundException - On receive. |- ! -2 ! SecurityException - On receive. |- ! -3 ! NullPointerException - On receive. |- ! -4 ! Exception - On receive. |- ! -5 ! Throwable - On receive. |} 650 2012-09-03T19:54:51Z Sini 33 /* Response Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Response Return Codes == {| border=2px ! Opcode ! Description |- ! 0 ! Successfully executed the request. |- ! -1 ! ClassNotFoundException - On receive. |- ! -2 ! SecurityException - On receive. |- ! -3 ! NullPointerException - On receive. |- ! -4 ! Exception - On receive. |- ! -5 ! Throwable - On receive. |- ! -10 ! ClassNotFoundException - On send. |- ! -11 ! InvalidClassException - On send. |- ! -12 ! StreamCorruptedException - On send. |- ! -13 ! OptionalDataException - On send. |- ! -14 ! IllegalAccessException - On send. |- ! -15 ! IllegalArgumentException - On send. |- ! -16 ! InvocationTargetException - On send. |- ! -17 ! SecurityException - On send. |- ! -18 ! IOException - On send. |- ! -19 ! NullPointerException - On receive. |- ! -20 ! Exception - On receive. |- ! -21 ! Throwable - On receive. |} 651 2012-09-03T19:55:17Z Sini 33 /* Response Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Response Return Codes == {| border=2px ! Opcode ! Description |- ! 0 ! Successfully executed the request. |- ! -1 ! ClassNotFoundException - On receive. |- ! -2 ! SecurityException - On receive. |- ! -3 ! NullPointerException - On receive. |- ! -4 ! Exception - On receive. |- ! -5 ! Throwable - On receive. |- ! -10 ! ClassNotFoundException - On send. |- ! -11 ! InvalidClassException - On send. |- ! -12 ! StreamCorruptedException - On send. |- ! -13 ! OptionalDataException - On send. |- ! -14 ! IllegalAccessException - On send. |- ! -15 ! IllegalArgumentException - On send. |- ! -16 ! InvocationTargetException - On send. |- ! -17 ! SecurityException - On send. |- ! -18 ! IOException - On send. |- ! -19 ! NullPointerException - On send. |- ! -20 ! Exception - On send. |- ! -21 ! Throwable - On send. |} 652 2012-09-03T20:05:49Z Sini 33 /* Response Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. {| border=2px ! Opcode ! Name ! On Receive/Respond ! Description |- ! 0 ! Successful ! Respond ! Successfully executed the request. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! Receive ! NullPointerException ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Receive ! Exception ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Receive ! Throwable ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! Respond ! ClassNotFoundException ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! Respond ! InvalidClassException ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! Response ! StreamCorruptedException ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! Response ! OptionalDataException ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! Response ! IllegalAccessException ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! Response ! IllegalArgumentException ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! Response ! InvocationTargetException ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! Response ! SecurityException ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! Response ! IOException ! An IOException was thrown while responding to a request from the server. |- ! -19 ! Response ! NullPointerException ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Response ! Exception ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Response ! Throwable ! An error or exception was thrown while receiving a request from the server. |} 653 2012-09-03T20:08:39Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receieve ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 654 2012-09-03T20:15:09Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receieve ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 655 2012-09-03T20:17:01Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For an method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receieve ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 656 2012-09-03T20:17:20Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For an method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 657 2012-09-03T20:18:56Z Sini 33 /* Return Codes */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 658 2012-09-03T20:22:46Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. == Request Types == {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 659 2012-09-03T20:23:43Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Request Types == {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 660 2012-09-03T20:31:46Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Structure == +---------------------+ | uid : dword | +---------------------+----------------------+------------------------+ | request | response code : byte | type dependent data... | +---------------------+----------------------+------------------------+ | payload crc : dword | +---------------------+ == Request Types == {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 661 2012-09-03T20:32:09Z Sini 33 /* Structure */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Structure == +---------------------+ | uid : dword | +---------------------+----------------------+------------------------+ | for each request | response code : byte | type dependent data... | +---------------------+----------------------+------------------------+ | payload crc : dword | +---------------------+ == Request Types == {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 662 2012-09-03T20:36:08Z Sini 33 /* Request Types */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Structure == +---------------------+ | uid : dword | +---------------------+----------------------+------------------------+ | for each request | response code : byte | type dependent data... | +---------------------+----------------------+------------------------+ | payload crc : dword | +---------------------+ == Request Types == For request types 0, 2, 4 there will only be one successful response code and a dword value of the value being requested will be sent. For request type 1, only the successful response code will be used but no value will be sent back. {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 663 2012-09-03T20:36:20Z Sini 33 /* Structure */ The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Response Structure == +---------------------+ | uid : dword | +---------------------+----------------------+------------------------+ | for each request | response code : byte | type dependent data... | +---------------------+----------------------+------------------------+ | payload crc : dword | +---------------------+ == Request Types == For request types 0, 2, 4 there will only be one successful response code and a dword value of the value being requested will be sent. For request type 1, only the successful response code will be used but no value will be sent back. {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 664 2012-09-03T20:39:51Z Sini 33 The class check originated with the new Runescape engine update which took place around the 4xx revisions. It gives the Jagex servers the ability to check the modifiers, update, or fetch the value for a field. It also gives functionality to invoke a method with parameters and get it's return value, or check it's modifiers. Each of these functionalities are described with a request type. A class check request is built up with many of these request types. Each request is tagged with an unique id. == Request Structure == +-------------------------+ | amount requests : ubyte | +-------------------------+ | uid : dword | +-------------------------+--------------+------------------------+ | for each request | type : ubyte | type dependent data... | +-------------------------+--------------+------------------------+ == Response Structure == +---------------------+ | uid : dword | +---------------------+----------------------+------------------------+ | for each request | response code : byte | type dependent data... | +---------------------+----------------------+------------------------+ | payload crc : dword | +---------------------+ == Request Types == For request types 0, 2, 4 there will only be one successful response code and a dword value of the value being requested will be sent. For request type 1, only the successful response code will be used but no value will be sent back. {| border=2px ! Opcode ! Name ! Description |- ! 0 ! Fetch Numeric Field ! Fetches the value of a numeric field. |- ! 1 ! Update Numeric Field ! Updates the value of a numeric field. |- ! 2 ! Get Field Modifiers ! Gets the modifiers of a field. |- ! 3 ! Invoke Method ! Invokes a method and sends back its return object. |- ! 4 ! Get Method Modifiers ! Gets the modifiers of a method. |} == Return Codes == All the return codes are in descending priority by numerical order. For opcode 0, there are cases where a numeric value is sent to the server on fetch requests. This value is always a dword. For a method invoke request, there isn't a value that is sent to the server. It is just assumed that there wasn't a return object from the invoked method. {| border=2px ! Opcode ! Name ! On Receive/Response ! Description |- ! 0 ! Successful ! Response ! Successfully executed the request. |- ! 1 ! Successful - Returned numeric value ! Response ! Successfully executed the request, and returned a numeric value. |- ! 2 ! Successful - Returned string value ! Response ! Successfully executed the request, and returned a string value. |- ! 4 ! Successful - Returned object value ! Response ! Successfully executed the request, and returned an object value. |- ! -1 ! ClassNotFoundException ! Receive ! A ClassNotFoundException was thrown while receiving a request from the server. |- ! -2 ! SecurityException ! Receive ! A SecurityException was thrown while receiving a request from the server. |- ! -3 ! NullPointerException ! Receive ! A NullPointerException was thrown while receiving a request from the server. |- ! -4 ! Exception ! Receive ! An Exception was thrown while receiving a request from the server. |- ! -5 ! Throwable ! Receive ! An error or exception was thrown while receiving a request from the server. |- ! -10 ! ClassNotFoundException ! Response ! A ClassNotFoundException was thrown while responding to a request from the server. |- ! -11 ! InvalidClassException ! Response ! An InvalidClassException was thrown while responding to a request from the server. |- ! -12 ! StreamCorruptedException ! Response ! A StreamCorruptedException was thrown while responding to a request from the server. |- ! -13 ! OptionalDataException ! Response ! An OptionDataException was thrown while responding to a request from the server. |- ! -14 ! IllegalAccessException ! Response ! An IllegalAccessException was thrown while responding to a request from the server. |- ! -15 ! IllegalArgumentException ! Response ! An IllegalArgumentException was thrown while responding to a request from the server. |- ! -16 ! InvocationTargetException ! Response ! An InvocationTargetException was thrown while responding to a request from the server. |- ! -17 ! SecurityException ! Response ! A SecurityException was thrown while responding to a request from the server. ! |- ! -18 ! IOException ! Response ! An IOException was thrown while responding to a request from the server. |- ! -19 ! NullPointerException ! Response ! A NullPointerException was thrown while responding to a request from the server. |- ! -20 ! Exception ! Response ! An Exception was thrown while responding to a request from the server. |- ! -21 ! Throwable ! Response ! An error or exception was thrown while receiving a request from the server. |} 464 Protocol 0 130 c1fmd4myl0pm22cvvna4hl2ywnnaq99 330 2011-11-16T17:58:10Z Scully 24 Created page with "== '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the..." == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. 331 2011-11-16T18:02:21Z Scully 24 /* Packet structure */ == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} 332 2011-11-16T18:03:15Z Scully 24 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} 333 2011-11-16T18:04:11Z Scully 24 [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} 334 2011-11-16T19:36:21Z Scully 24 /* Client -> Server Packets */ [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Idle]] | Sent when the player enters a chat message. |- |} 335 2011-11-16T19:43:39Z Scully 24 /* Client -> Server Packets */ [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |- | 49 | VARIABLE BYTE | 13 | [[464:Character Design|Character Design]] | |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Chat]] | Sent when the player enters a chat message. |- Sent when the player enters a chat message. |- |} 336 2011-11-16T19:48:15Z Scully 24 /* Server -> Client Packets */ [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 163 | Fixed | 1 | [[317:Run Energy|Run Energy]] | Sends the players run energy percentage. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |- | 49 | VARIABLE BYTE | 13 | [[464:Character Design|Character Design]] | |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Chat]] | Sent when the player enters a chat message. |- Sent when the player enters a chat message. |- |} 337 2011-11-16T19:49:22Z Scully 24 /* Client -> Server Packets */ [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 163 | Fixed | 1 | [[317:Run Energy|Run Energy]] | Sends the players run energy percentage. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 49 | VARIABLE BYTE | 13 | [[464:Character Design|Character Design]] | Sent when accepting the player's appearance on the design screen. |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Chat]] | Sent when the player enters a chat message. |- |} 468 Protocol 0 240 1qbfo5v80baflog6q2t1lp3ohvxewgz 914 2013-10-25T00:24:04Z James7746 304 Created page with "[[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specifi..." [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 163 | Fixed | 1 | [[317:Run Energy|Run Energy]] | Sends the players run energy percentage. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 49 | VARIABLE BYTE | 13 | [[464:Character Design|Character Design]] | Sent when accepting the player's appearance on the design screen. |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Chat]] | Sent when the player enters a chat message. |- |} 915 2013-10-25T00:26:23Z James7746 304 /* Server -> Client Packets */ [[Category:RS2]] Currently under development. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Blank at the moment. =='''Game Protocol'''== ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 147 | DataType.SHORT, DataOrder.LITTLE, | 1 | [[317:Run Energy|Run Energy]] | Sends the Mapregion |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 49 | VARIABLE BYTE | 13 | [[464:Character Design|Character Design]] | Sent when accepting the player's appearance on the design screen. |- | 115 | VARIABLE BYTE | N/A | [[464:Chat|Chat]] | Sent when the player enters a chat message. |- |} 474 Protocol 0 15 bj2jw6lpecz4zyymfh0ce9zxsw70i3f 50 2011-06-18T04:24:54Z Admin 1 Created page with "{{Crappy}} Not much progress has been made with this revision, don't worry about it too much." {{Crappy}} Not much progress has been made with this revision, don't worry about it too much. 60 2011-06-18T04:54:25Z Admin 1 {{Crappy}} Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 80 2011-06-18T05:53:06Z Admin 1 {{Crappy}} Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 95 2011-06-20T04:01:10Z Admin 1 /* Packet structure */ {{Crappy}} Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 127 2011-06-20T04:55:37Z Admin 1 [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 224 2011-06-26T18:11:23Z Admin 1 [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- |} 278 2011-07-16T06:39:48Z W3 12 [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- |} 279 2011-07-16T06:43:43Z W3 12 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 904 2013-10-18T00:54:53Z Arham 4 303 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 3 | FIXED | N/A | [[474:Fourth Interface Option|Remove ignore]] | This is triggered when a fourth interface option has been clicked. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 905 2013-10-18T00:55:11Z Arham 4 303 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 3 | FIXED | N/A | [[474:Fourth Interface Option|Fourth Interface Option]] | This is triggered when a fourth interface option has been clicked. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 906 2013-10-18T01:01:35Z Arham 4 303 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 3 | FIXED | N/A | [[474:Fourth Interface Option|Fourth Interface Option]] | This is triggered when a fourth interface option has been clicked. |- | 4 | FIXED | N/A | [[474:Fourth Object Option|Fourth Object Option]] | This is triggered when a fourth object option has been clicked. |- | 11 | FIXED | N/A | [[474:Minimap Walk|Minimap Walk]] | Sends walking data to the server. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 22 | FIXED | N/A | [[474:Kick Clanchat Participant|Kick Clanchat Participant]] | Indicates a friend of the clanChat owner attempts to kick a fellow clanChatParticipant (non-owner). |- | 29 | FIXED | N/A | [[474:Sixth Interface Option|Sixth Interface Option]] | Tells the server a sixth interface option has been clicked. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 34 | FIXED | N/A | [[474:Client Focus|Client Focus]] | Tells the server the clients focus has changed. |- | 35 | FIXED | N/A | [[474:Use Magic On Player|Use Magic On Player]] | Indicates the player wants to use a spell on another player. |- | 37 | FIXED | N/A | [[474:Third interface option|Third interface option]] | This is triggered when one a third interface option has been clicked. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 911 2013-10-18T01:15:23Z Arham 4 303 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 3 | FIXED | N/A | [[474:Fourth Interface Option|Fourth Interface Option]] | This is triggered when a fourth interface option has been clicked. |- | 4 | FIXED | 6 | [[474:Fourth Object Option|Fourth Object Option]] | This is triggered when a fourth object option has been clicked. |- | 11 | FIXED | N/A | [[474:Minimap Walk|Minimap Walk]] | Sends walking data to the server. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 22 | FIXED | N/A | [[474:Kick Clanchat Participant|Kick Clanchat Participant]] | Indicates a friend of the clanChat owner attempts to kick a fellow clanChatParticipant (non-owner). |- | 29 | FIXED | N/A | [[474:Sixth Interface Option|Sixth Interface Option]] | Tells the server a sixth interface option has been clicked. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 34 | FIXED | N/A | [[474:Client Focus|Client Focus]] | Tells the server the clients focus has changed. |- | 35 | FIXED | N/A | [[474:Use Magic On Player|Use Magic On Player]] | Indicates the player wants to use a spell on another player. |- | 37 | FIXED | N/A | [[474:Third interface option|Third interface option]] | This is triggered when one a third interface option has been clicked. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 912 2013-10-18T01:16:52Z Arham 4 303 /* Client -> Server Packets */ [[Category:RS2]] Not much progress has been made with this revision, don't worry about it too much. == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 209 | VARIABLE_BYTE | N/A | [[474:Send message|Send message]] | Sends a server message (e.g. 'Welcome to RuneScape') or trade/duel request. |- | 231 | VARIABLE_SHORT | N/A | [[474:Send string|Send string]] | Replaces a string of text. (e.g. Replace: 'Click here to Play' with 'Play Now!') |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 1 | FIXED | 8 | [[474:Remove ignore|Remove ignore]] | Sent when a player removes a player from their ignore list. |- | 3 | FIXED | 6 | [[474:Fourth Interface Option|Fourth Interface Option]] | This is triggered when a fourth interface option has been clicked. |- | 4 | FIXED | N/A | [[474:Fourth Object Option|Fourth Object Option]] | This is triggered when a fourth object option has been clicked. |- | 11 | FIXED | N/A | [[474:Minimap Walk|Minimap Walk]] | Sends walking data to the server. |- | 13 | FIXED | 12 | [[474:Item on NPC|Item on NPC]] | Sent when a player uses an item on an NPC. |- | 21 | FIXED | 2 | [[474:Npc action 2|Npc action 2]] | Sent when a player clicks the second option of an NPC. |- | 22 | FIXED | N/A | [[474:Kick Clanchat Participant|Kick Clanchat Participant]] | Indicates a friend of the clanChat owner attempts to kick a fellow clanChatParticipant (non-owner). |- | 29 | FIXED | N/A | [[474:Sixth Interface Option|Sixth Interface Option]] | Tells the server a sixth interface option has been clicked. |- | 31 | FIXED | 6 | [[474:Object action 1|Object action 1]] | Sent when the player clicks the first option of an object, such as "Cut" for trees. |- | 34 | FIXED | N/A | [[474:Client Focus|Client Focus]] | Tells the server the clients focus has changed. |- | 35 | FIXED | N/A | [[474:Use Magic On Player|Use Magic On Player]] | Indicates the player wants to use a spell on another player. |- | 37 | FIXED | N/A | [[474:Third interface option|Third interface option]] | This is triggered when one a third interface option has been clicked. |- | 203 | FIXED | 6 | [[474:Object action 2|Object action 2]] | Sent when the player clicks the second option of an object, such as "Use-quickly" for Bank Booths. |- | 34 | FIXED | 1 | [[474:Focus change|Focus change]] | Sent when the game client window goes out of focus. |- | 35 | FIXED | 8 | [[474:Magic on player|Magic on player]] | Sent when the player casts magic on another player. |- | 226 | FIXED | 2 | [[474:Examine object|Examine object]] | Sent when you examine an object. |- |} 474:Remove ignore 0 238 2lhcbkemazb948tsghivcexanblow22 907 2013-10-18T01:07:00Z Arham 4 303 Created page with "{{packet|name=Remove ignore|description=Sent when a player removes a player from their ignore list.|opcode=1|type=Fixed|length=8|revision=474}} == Open Welcome Screen == === ..." {{packet|name=Remove ignore|description=Sent when a player removes a player from their ignore list.|opcode=1|type=Fixed|length=8|revision=474}} == Open Welcome Screen == === Description === Signals the player wants to remove an ignore. === Packet Structure === {|border=2 ! Data Type ! Description |- | Long | The player that is going to be removed from the ignore's name. |- |} 908 2013-10-18T01:08:44Z Arham 4 303 /* Open Welcome Screen */ {{packet|name=Remove ignore|description=Sent when a player removes a player from their ignore list.|opcode=1|type=Fixed|length=8|revision=474}} == Remove ignore == === Description === Signals the player wants to remove an ignore. === Packet Structure === {|border=2 ! Data Type ! Description |- | Long | The player that is going to be removed from the ignore's name. |- |} 909 2013-10-18T01:10:01Z Arham 4 303 /* Packet Structure */ {{packet|name=Remove ignore|description=Sent when a player removes a player from their ignore list.|opcode=1|type=Fixed|length=8|revision=474}} == Remove ignore == === Description === Signals the player wants to remove an ignore. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Long]] | The player that is going to be removed from the ignore's name. |- |} 474:Fourth Interface Option 0 239 mfpnz4aarrc01vwx7xxv46mr94qhim2 910 2013-10-18T01:11:27Z Arham 4 303 Created page with "{{packet|name=Fourth Interface Option|description=Triggered when a fourth interface option has been clicked.|opcode=3|type=Fixed|length=N/A|revision=474}} == Fourth Interface ..." {{packet|name=Fourth Interface Option|description=Triggered when a fourth interface option has been clicked.|opcode=3|type=Fixed|length=N/A|revision=474}} == Fourth Interface Option == === Description === This is triggered when a fourth interface option has been clicked. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Int]] | The button ID. |- | [[Data_Types#Standard_data_types|Short]] | The item container slot. |- |} 1020 2014-05-22T21:01:48Z Pure 316 {{packet|name=Fourth Interface Option|description=Triggered when a fourth interface option has been clicked.|opcode=3|type=Fixed|length=6|revision=474}} == Fourth Interface Option == === Description === This is triggered when a fourth interface option has been clicked. === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Int]] | The button ID. |- | [[Data_Types#Standard_data_types|Short]] | The item container slot. |- |} 508 Protocol 0 16 csay5pbmlnq09ijhspny62o2wsbswdk 51 2011-06-18T04:25:29Z Admin 1 Created page with "{{Crappy}} I'm sure this is very similar if not the same to #503." {{Crappy}} I'm sure this is very similar if not the same to #503. 61 2011-06-18T04:54:37Z Admin 1 {{Crappy}} I'm sure this is very similar if not the same to #503. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> 81 2011-06-18T05:53:23Z Admin 1 {{Crappy}} I'm sure this is very similar if not the same to #503. == '''Packet structure''' == ? == '''Login''' == ? == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 92 2011-06-20T03:59:55Z Admin 1 /* Login */ {{Crappy}} I'm sure this is very similar if not the same to #503. == '''Packet structure''' == ? == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 93 2011-06-20T04:00:16Z Admin 1 {{Crappy}} == '''Packet structure''' == ? == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 94 2011-06-20T04:00:41Z Admin 1 /* Packet structure */ {{Crappy}} == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 128 2011-06-20T04:55:50Z Admin 1 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Incoming Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> == '''Outgoing Data''' == '''TODO:''' Document packet structures <table border="1" cellpadding="3" cellspacing="3"> <tr> <td><b>opcode</b></td> <td><b>usage</b></td> <td><b>size</b></td> <td><b>payload</b></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> 225 2011-06-26T18:12:19Z Admin 1 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 ushort - packet size only if packet size is sent as -2 </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- |} 338 2011-11-18T16:18:17Z Teemuzz 25 /* Client -> Server Packets */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 ushort - packet size only if packet size is sent as -2 </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 634 2012-08-29T10:56:45Z Andrew 9 /* Login */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Personal Details step of the Create account dialogue - connection type 85 * Username selection phase of the create account dialogue - connection type 118 * Password stage of create account, sends all information from previous steps - connection type 48 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 ushort - packet size only if packet size is sent as -2 </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 635 2012-08-29T10:57:29Z Andrew 9 /* Login */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 ushort - packet size only if packet size is sent as -2 </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 1213 2014-07-09T20:01:38Z Pure 316 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 (length: VAR_BYTE) ushort - packet size only if packet size is sent as -2 (length: VAR_SHORT) </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 634 Protocol 0 162 okfmaitxtsjk84p1f7tnbtu1c6njf4d 399 2012-05-22T04:24:19Z Sini 33 Created page with "==634 Protocol==" ==634 Protocol== 400 2012-05-22T04:25:14Z Sini 33 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: <pre> Needs documentation on how to login </pre> 401 2012-05-25T20:04:53Z Sini 33 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. An addition to modern modern protocols was the addition to allow packets with an opcode of a word to be deciphered from the buffer. This is done by taking the first two ISAAC PRNG seeds; each byte from the buffer at the current offset is deciphered sequentially. If the first byte deciphered is less than the maximum of a byte then the packet is assumed to be byte length, otherwise it's considered to be word length. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: <pre> Needs documentation on how to login </pre> 402 2012-05-25T20:05:12Z Sini 33 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. An addition to modern modern protocols was the addition to allow packets with an opcode of a word to be deciphered from the buffer. This is done by taking the first two ISAAC PRNG seeds; each byte from the buffer at the current offset is deciphered sequentially. If the first byte deciphered is less than the maximum of a signed byte then the packet is assumed to be byte length, otherwise it's considered to be word length. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: <pre> Needs documentation on how to login </pre> 403 2012-05-25T20:59:47Z Sini 33 /* Packet structure */ [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. An addition to modern emulation protocols was the addition to allow packets with an opcode of a word to be deciphered from the buffer. This is done by taking the first two ISAAC PRNG seeds; each byte from the buffer at the current offset is deciphered sequentially. If the first byte deciphered is less than the maximum of a signed byte then the packet is assumed to be byte length, otherwise it's considered to be word length. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: <pre> Needs documentation on how to login </pre> 405 2012-06-06T21:14:21Z Sini 33 Blanked the page 407 2012-06-07T23:35:09Z The Wanderer 13 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. An addition to modern emulation protocols was the addition to allow packets with an opcode of a word to be deciphered from the buffer. This is done by taking the first two ISAAC PRNG seeds; each byte from the buffer at the current offset is deciphered sequentially. If the first byte deciphered is less than the maximum of a signed byte then the packet is assumed to be byte length, otherwise it's considered to be word length. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: <pre> Needs documentation on how to login </pre> 666 Protocol 0 225 e3u46c8ub65b11q8mhk4mjglsr73zee 812 2013-01-04T00:42:46Z Method 103 Created page with basic structure for handshake and packet information. [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server to indicate the type of connection. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Handshake 14 | 14 | 0 | | |- ! Handshake 15 | 15 | 4 | | |- ! Handshake 16 | 16 | Variable (short) | | |- ! Handshake 17 | 17 | 0 | | |- ! Handshake 19 | 19 | Variable (short) | | |- ! Handshake 22 | 22 | Variable (short) | | |- ! Handshake 23 | 23 | 4 | | |- ! Handshake 24 | 24 | Variable (byte) | | |- ! Handshake 26 | 26 | 0 | | |- ! Handshake 27 | 27 | 0 | | |- ! Handshake 28 | 28 | Variable (short) | | |- ! Handshake 29 | 29 | Variable (short) | | |- ! Handshake 30 | 30 | Variable (short) | | |- |} == '''Packets''' == This section documents the packets sent between the client and server during normal gameplay. === '''Client-to-Server''' === {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} === '''Server-to-Client''' === {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} 813 2013-01-05T05:38:29Z Method 103 Added information about the various handshake packets. [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Packets''' == This section documents the packets sent between the client and server during normal gameplay. === '''Client-to-Server''' === {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} === '''Server-to-Client''' === {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} 866 2013-07-14T02:49:54Z Method 103 Reorganized game protocol section [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == This section documents the packets sent between the client and server during normal gameplay. === '''Packets''' === ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} 867 2013-07-14T03:07:48Z Method 103 Start of update protocol [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == This section documents the packets sent between the client and server during normal gameplay. === '''Packets''' === ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === 868 2013-07-14T03:08:13Z Method 103 [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === 869 2013-07-14T03:54:47Z Method 103 Update protocol packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of data with the chosen code before it responds to the client. 870 2013-07-14T03:58:31Z Method 103 Clarification [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Packet 16 | 16 | 7 | | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Packet 23 | 23 | 7 | | |- ! Packet 24 | 24 | 7 | | |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Packet 28 | 28 | 7 | | |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Packet 45 | 45 | 7 | | |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Packet 49 | 49 | 7 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 891 2013-09-21T23:00:08Z Method 103 Ground object packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. | |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 892 2013-09-21T23:03:34Z Method 103 Fix table formatting [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Packet 1 | 1 | 7 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Packet 38 | 38 | 7 | | |- ! Packet 39 | 39 | 7 | | |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Packet 58 | 58 | 7 | | |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Packet 75 | 75 | 7 | | |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Packet 86 | 86 | 7 | | |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 893 2013-09-21T23:15:02Z Method 103 Location packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Packet 10 | 10 | 3 | | |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Packet 27 | 27 | 3 | | |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Packet 29 | 29 | 3 | | |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Packet 61 | 61 | 3 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Packet 69 | 69 | 3 | | |- ! Packet 70 | 70 | 3 | | |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 894 2013-09-21T23:21:49Z Method 103 Npc packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Packet 4 | 4 | 3 | | |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Packet 14 | 14 | 3 | | |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Packet 43 | 43 | 3 | | |- ! Packet 44 | 44 | 3 | | |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Packet 47 | 47 | 3 | | |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 3 | | |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Packet 72 | 72 | 3 | | |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Packet 83 | 83 | 3 | | |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Packet 90 | 90 | 3 | | |- ! Packet 91 | 91 | 3 | | |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 895 2013-09-21T23:34:13Z Method 103 Player packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 0 | | |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Player Option 8 | 4 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the eighth option for a player is selected. |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Player Option 10 | 14 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the tenth option for a player is selected. |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Packet 32 | 32 | 4 | | |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Player Option 1 | 43 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the first option for a player is selected. |- ! Player Option 2 | 44 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the second option for a player is selected. |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Player Option 5 | 47 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fifth option for a player is selected. |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Player Option 9 | 51 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the ninth option for a player is selected. |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Player Option 7 | 72 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the seventh option for a player is selected. |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Player Option 4 | 83 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fourth option for a player is selected. |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Player Option 3 | 90 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the third option for a player is selected. |- ! Player Option 6 | 91 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the sixth option for a player is selected. |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 896 2013-09-22T19:54:34Z Method 103 Map build packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Map Build Complete | 0 | 0 | None | Indicates that the client has just finished rebuilding its map. |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Player Option 8 | 4 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the eighth option for a player is selected. |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Player Option 10 | 14 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the tenth option for a player is selected. |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Detect Modified Client | 32 | 4 | style="text-align: left" | * value: int32 | Sent on each map rebuild if the client detects that it is not running as an applet. The ''value'' field will always have value 0x3f008edd. |- ! Packet 33 | 33 | 0 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Player Option 1 | 43 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the first option for a player is selected. |- ! Player Option 2 | 44 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the second option for a player is selected. |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Player Option 5 | 47 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fifth option for a player is selected. |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Player Option 9 | 51 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the ninth option for a player is selected. |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Player Option 7 | 72 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the seventh option for a player is selected. |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Player Option 4 | 83 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fourth option for a player is selected. |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Player Option 3 | 90 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the third option for a player is selected. |- ! Player Option 6 | 91 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the sixth option for a player is selected. |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 897 2013-09-22T19:57:32Z Method 103 Keepalive packet [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Map Build Complete | 0 | 0 | None | Indicates that the client has just finished rebuilding its map. |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Player Option 8 | 4 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the eighth option for a player is selected. |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Player Option 10 | 14 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the tenth option for a player is selected. |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Detect Modified Client | 32 | 4 | style="text-align: left" | * value: int32 | Sent on each map rebuild if the client detects that it is not running as an applet. The ''value'' field will always have value 0x3f008edd. |- ! No Timeout | 33 | 0 | None | Sent if the client has not sent the server any data for 50 ticks. |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Player Option 1 | 43 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the first option for a player is selected. |- ! Player Option 2 | 44 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the second option for a player is selected. |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Player Option 5 | 47 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fifth option for a player is selected. |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Player Option 9 | 51 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the ninth option for a player is selected. |- ! Packet 52 | 52 | 4 | | |- ! Packet 53 | 53 | 18 | | |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Packet 56 | 56 | 5 | | |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Player Option 7 | 72 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the seventh option for a player is selected. |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Player Option 4 | 83 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fourth option for a player is selected. |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Player Option 3 | 90 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the third option for a player is selected. |- ! Player Option 6 | 91 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the sixth option for a player is selected. |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 898 2013-09-25T04:31:56Z Method 103 Walking packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Map Build Complete | 0 | 0 | None | Indicates that the client has just finished rebuilding its map. |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | 8 | | |- ! Player Option 8 | 4 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the eighth option for a player is selected. |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Player Option 10 | 14 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the tenth option for a player is selected. |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Packet 31 | 31 | Variable (byte) | | |- ! Detect Modified Client | 32 | 4 | style="text-align: left" | * value: int32 | Sent on each map rebuild if the client detects that it is not running as an applet. The ''value'' field will always have value 0x3f008edd. |- ! No Timeout | 33 | 0 | None | Sent if the client has not sent the server any data for 50 ticks. |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | Variable (byte) | | |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Player Option 1 | 43 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the first option for a player is selected. |- ! Player Option 2 | 44 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the second option for a player is selected. |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Player Option 5 | 47 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fifth option for a player is selected. |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Player Option 9 | 51 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the ninth option for a player is selected. |- ! Packet 52 | 52 | 4 | | |- ! Minimap Walk | 53 | 18 | style="text-align: left" | * dest_y: le_int16 * ctrl_pressed: int8c * dest_x: le_int16a * dummy1: int8 * dummy2: int8 * camera_yaw: int16 * dummy3: int8 * yaw_random: int8 * scale_random: int8 * dummy4: int8 * world_x: int16 * world_y: int16 * dummy5: int8 | Sent when a position on the minimap is clicked. Fields ''dummy1'' and ''dummy2'' should have value -1. ''dummy3'' should have value 57. ''dummy4'' should have value 89. ''dummy5'' should have value 63. The ''yaw_random'' and ''scale_random'' contain the current random offsets added to the client's camera yaw and minimap scale values. The ''world_x'' and ''world_y'' fields contain the client's current position in world coordinates. |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Game View Walk | 56 | 5 | style="text-align: left" | * dest_y: le_int16 * ctrl_pressed: int8c * dest_x: le_int16a | Sent when a position in the 3d game world is clicked. |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Packet 68 | 68 | Variable (byte) | | |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Player Option 7 | 72 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the seventh option for a player is selected. |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Player Option 4 | 83 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fourth option for a player is selected. |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Player Option 3 | 90 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the third option for a player is selected. |- ! Player Option 6 | 91 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the sixth option for a player is selected. |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 899 2013-09-25T04:45:36Z Method 103 Friend and ignore packets [[Category:RS2]] This page is an attempt to document the protocol and other relevant information for client build 666. == '''Handshakes''' == This section documents the handshake packets sent from the client to the server. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Init Game Connection | 14 | 0 | None | Indicates that the connection is for logging the client into the lobby or game. |- ! Init Update Connection | 15 | 4 | style="text-align: left" | * client_build: int32 | Indicates that the connection is for streaming the game's resources to the client. |- ! Game Login | 16 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** unknown: int8 ** screen_type: int8 ** screen_width: int16 ** screen_height: int16 ** multisampling_level: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** preferences_length: int8 ** preferences_data: int8[preferences_length] ** System info *** sysinfo_version: int8 *** os_type: int8 *** is_64bit: int8 *** os_version: int8 *** java_vendor: int8 *** java_release: int8 *** java_version: int8 *** java_update: int8 *** unsigned: int8 *** heap_size: int16 *** processor_count: int8 *** total_memory: int24 *** unknown: int16 *** unknown: int8 *** unknown: int8 *** unknown: int8 *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: jstring *** unknown: int8 *** unknown: int16 ** unknown: int32 ** user_flow: int64 ** has_additional_info: int8 *** additional_info: cstring ** has_jagtheora: int8 ** using_javascript: int8 ** archive_checksums: int32[36] | Attempts to login to the game server. |- ! Handshake 17 | 17 | 0 | None | Not used but present in the client. |- ! Lobby Login | 19 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** unknown: int64 ** password: cstring ** server_session_key: int64 ** client_session_key: int64 * XTEA block ** username: cstring ** game_id: int8 ** language: int8 ** uid: int8[24] ** settings: cstring ** affiliate_id: int32 ** archive_checksums: int32[36] | Attempts to login to the lobby server. |- ! Create Account | 22 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** affiliate_id: int16 ** password: cstring ** user_flow: int64 ** language: int8 ** game_id: int8 ** uid: int8[24] ** has_additional_info: int8 *** additional_info: cstring ** age: int8 ** email_updates: int8 ** padding: int8[7] | Attempts to create an account with the given information. |- ! Handshake 23 | 23 | 4 | None | Not used but present in the client. |- ! Handshake 24 | 24 | Variable (byte) | None | Not used but present in the client. |- ! Finished Advertisement | 26 | 0 | None | Notifies the server that the client has finished viewing the advertisement. |- ! Handshake 27 | 27 | 0 | None | Not used but present in the client. |- ! Check Email | 28 | Variable (short) | style="text-align: left" | * client_build: int32 * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** padding: int32[10] ** unknown: int16 * XTEA block ** email: cstring ** language: int8 ** padding: int8[7] | Asks the server to verify whether the given email can be used to create an account. |- ! Init Social Network Connection | 29 | Variable (short) | style="text-align: left" | * client_build: int32 * reconnecting: int8 (if game server connection) * rsa_block_len: int16 * RSA block ** block_header: int8 ** xtea_key: int32[4] ** social_network_id: int8 ** unknown: int16 ** language: int8 ** affiliate_id: int32 ** padding: int32[6] ** client_session_key: int64 ** game_id: int8 ** unknown: int8 | Initializes a connection using a social network. |- ! Social Network Login | 30 | Variable (short) | style="text-align: left" | * Game login ** XTEA block *** unknown: int8 *** screen_type: int8 *** screen_width: int16 *** screen_height: int16 *** multisampling_level: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** preferences_length: int8 *** preferences_data: int8[preferences_length] *** System info **** sysinfo_version: int8 **** os_type: int8 **** is_64bit: int8 **** os_version: int8 **** java_vendor: int8 **** java_release: int8 **** java_version: int8 **** java_update: int8 **** unsigned: int8 **** heap_size: int16 **** processor_count: int8 **** total_memory: int24 **** unknown: int16 **** unknown: int8 **** unknown: int8 **** unknown: int8 **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: jstring **** unknown: int8 **** unknown: int16 *** unknown: int32 *** user_flow: int64 *** has_additional_info: int8 **** additional_info: cstring *** has_jagtheora: int8 *** using_javascript: int8 *** archive_checksums: int32[36] * Lobby login ** XTEA block *** game_id: int8 *** language: int8 *** uid: int8[24] *** settings: cstring *** affiliate_id: int32 *** archive_checksums: int32[36] | Attempts to login to either the game or lobby server using a social network. |- |} == '''Game Protocol''' == === '''Packets''' === This section documents the packets sent between the client and server during normal gameplay. ==== '''Client-to-Server''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Map Build Complete | 0 | 0 | None | Indicates that the client has just finished rebuilding its map. |- ! Location Option 1 | 1 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the first option for a location is selected. |- ! Remove Ignore | 2 | Variable (byte) | style="text-align: left" | * name: cstring | Sent when the client wants to stop ignoring a player. |- ! Packet 3 | 3 | 8 | | |- ! Player Option 8 | 4 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the eighth option for a player is selected. |- ! Packet 5 | 5 | Variable (byte) | | |- ! Packet 6 | 6 | 15 | | |- ! Packet 7 | 7 | 8 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | Variable (byte) | | |- ! Npc Option 3 | 10 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the third option for an npc is selected. |- ! Packet 11 | 11 | 8 | | |- ! Packet 12 | 12 | Variable (byte) | | |- ! Packet 13 | 13 | Variable (byte) | | |- ! Player Option 10 | 14 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the tenth option for a player is selected. |- ! Packet 15 | 15 | 4 | | |- ! Ground Object Option 5 | 16 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fifth option for a ground object is selected. |- ! Packet 17 | 17 | 8 | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (byte) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 2 | | |- ! Packet 22 | 22 | Variable (byte) | | |- ! Ground Object Option 2 | 23 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the second option for a ground object is selected. |- ! Ground Object Option 3 | 24 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the third option for a ground object is selected. |- ! Packet 25 | 25 | 8 | | |- ! Packet 26 | 26 | 16 | | |- ! Npc Option 6 | 27 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the sixth option for an npc is selected. |- ! Ground Object Option 6 | 28 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the sixth option for a ground object is selected. |- ! Npc Option 1 | 29 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the first option for an npc is selected. |- ! Packet 30 | 30 | Variable (byte) | | |- ! Add Friend | 31 | Variable (byte) | style="text-align: left" | * name: cstring | Sent when the client wants to be friends with a player. |- ! Detect Modified Client | 32 | 4 | style="text-align: left" | * value: int32 | Sent on each map rebuild if the client detects that it is not running as an applet. The ''value'' field will always have value 0x3f008edd. |- ! No Timeout | 33 | 0 | None | Sent if the client has not sent the server any data for 50 ticks. |- ! Packet 34 | 34 | 6 | | |- ! Remove Friend | 35 | Variable (byte) | style="text-align: left" | * name: cstring | Sent when the client wants to stop being friends with a player. |- ! Packet 36 | 36 | 6 | | |- ! Packet 37 | 37 | 4 | | |- ! Location Option 5 | 38 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fifth option for a location is selected. |- ! Location Option 2 | 39 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the second option for a location is selected. |- ! Packet 40 | 40 | 8 | | |- ! Packet 41 | 41 | 12 | | |- ! Packet 42 | 42 | 15 | | |- ! Player Option 1 | 43 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the first option for a player is selected. |- ! Player Option 2 | 44 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the second option for a player is selected. |- ! Ground Object Option 1 | 45 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the first option for a ground object is selected. |- ! Packet 46 | 46 | Variable (byte) | | |- ! Player Option 5 | 47 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fifth option for a player is selected. |- ! Packet 48 | 48 | 8 | | |- ! Ground Object Option 4 | 49 | 7 | style="text-align: left" | * pos_y: int16 * object_id: int16 * pos_x: int16 * ctrl_pressed: int8 | Sent when the fourth option for a ground object is selected. |- ! Packet 50 | 50 | Variable (byte) | | |- ! Player Option 9 | 51 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the ninth option for a player is selected. |- ! Packet 52 | 52 | 4 | | |- ! Minimap Walk | 53 | 18 | style="text-align: left" | * dest_y: le_int16 * ctrl_pressed: int8c * dest_x: le_int16a * dummy1: int8 * dummy2: int8 * camera_yaw: int16 * dummy3: int8 * yaw_random: int8 * scale_random: int8 * dummy4: int8 * world_x: int16 * world_y: int16 * dummy5: int8 | Sent when a position on the minimap is clicked. Fields ''dummy1'' and ''dummy2'' should have value -1. ''dummy3'' should have value 57. ''dummy4'' should have value 89. ''dummy5'' should have value 63. The ''yaw_random'' and ''scale_random'' contain the current random offsets added to the client's camera yaw and minimap scale values. The ''world_x'' and ''world_y'' fields contain the client's current position in world coordinates. |- ! Packet 54 | 54 | 8 | | |- ! Packet 55 | 55 | Variable (byte) | | |- ! Game View Walk | 56 | 5 | style="text-align: left" | * dest_y: le_int16 * ctrl_pressed: int8c * dest_x: le_int16a | Sent when a position in the 3d game world is clicked. |- ! Packet 57 | 57 | 11 | | |- ! Location Option 4 | 58 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the fourth option for a location is selected. |- ! Packet 59 | 59 | Variable (byte) | | |- ! Packet 60 | 60 | 1 | | |- ! Npc Option 5 | 61 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fifth option for an npc is selected. |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | 4 | | |- ! Packet 64 | 64 | 0 | | |- ! Packet 65 | 65 | 11 | | |- ! Packet 66 | 66 | 8 | | |- ! Packet 67 | 67 | 2 | | |- ! Add Ignore | 68 | Variable (byte) | style="text-align: left" | * name: cstring * temporary: int8 | Sent when the client wants to ignore a player. |- ! Npc Option 4 | 69 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the fourth option for an npc is selected. |- ! Npc Option 2 | 70 | 3 | style="text-align: left" | * npc_index: le_int16a * ctrl_pressed: int8c | Sent when the second option for an npc is selected. |- ! Packet 71 | 71 | 16 | | |- ! Player Option 7 | 72 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the seventh option for a player is selected. |- ! Packet 73 | 73 | 2 | | |- ! Packet 74 | 74 | Variable (byte) | | |- ! Location Option 6 | 75 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the sixth option for a location is selected. |- ! Packet 76 | 76 | 4 | | |- ! Packet 77 | 77 | 2 | | |- ! Packet 78 | 78 | 3 | | |- ! Packet 79 | 79 | Variable (byte) | | |- ! Packet 80 | 80 | Variable (byte) | | |- ! Packet 81 | 81 | Variable (byte) | | |- ! Packet 82 | 82 | Variable (byte) | | |- ! Player Option 4 | 83 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the fourth option for a player is selected. |- ! Packet 84 | 84 | 8 | | |- ! Packet 85 | 85 | 8 | | |- ! Location Option 3 | 86 | 7 | style="text-align: left" | * pos_y: int16a * pos_x: le_int16a * location_id: le_int16 * ctrl_pressed: int8 | Sent when the third option for a location is selected. |- ! Packet 87 | 87 | 0 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | Variable (byte) | | |- ! Player Option 3 | 90 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the third option for a player is selected. |- ! Player Option 6 | 91 | 3 | style="text-align: left" | * player_index: int16 * ctrl_pressed: int8 | Sent when the sixth option for a player is selected. |- ! Packet 92 | 92 | 4 | | |- ! Packet 93 | 93 | Variable (byte) | | |- |} ==== '''Server-to-Client''' ==== {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Length ! Fields ! Description |- ! Packet 0 | 0 | 2 | | |- ! Packet 1 | 1 | 0 | | |- ! Packet 2 | 2 | Variable (byte) | | |- ! Packet 3 | 3 | Variable (byte) | | |- ! Packet 4 | 4 | 0 | | |- ! Packet 5 | 5 | Variable (short) | | |- ! Packet 6 | 6 | Variable (short) | | |- ! Packet 7 | 7 | 20 | | |- ! Packet 8 | 8 | 6 | | |- ! Packet 9 | 9 | 10 | | |- ! Packet 10 | 10 | 2 | | |- ! Packet 11 | 11 | Variable (short) | | |- ! Packet 12 | 12 | 7 | | |- ! Packet 13 | 13 | Variable (short) | | |- ! Packet 14 | 14 | 6 | | |- ! Packet 15 | 15 | Variable (byte) | | |- ! Packet 16 | 16 | 2 | | |- ! Packet 17 | 17 | Variable (byte) | | |- ! Packet 18 | 18 | 1 | | |- ! Packet 19 | 19 | Variable (short) | | |- ! Packet 20 | 20 | 4 | | |- ! Packet 21 | 21 | 3 | | |- ! Packet 22 | 22 | 6 | | |- ! Packet 23 | 23 | Variable (short) | | |- ! Packet 24 | 24 | 5 | | |- ! Packet 25 | 25 | 17 | | |- ! Packet 26 | 26 | 6 | | |- ! Packet 27 | 27 | 16 | | |- ! Packet 28 | 28 | 0 | | |- ! Packet 29 | 29 | 4 | | |- ! Packet 30 | 30 | 3 | | |- ! Packet 31 | 31 | 10 | | |- ! Packet 32 | 32 | Variable (short) | | |- ! Packet 33 | 33 | 6 | | |- ! Packet 34 | 34 | 6 | | |- ! Packet 35 | 35 | 7 | | |- ! Packet 36 | 36 | Variable (byte) | | |- ! Packet 37 | 37 | 6 | | |- ! Packet 38 | 38 | Variable (short) | | |- ! Packet 39 | 39 | 6 | | |- ! Packet 40 | 40 | 9 | | |- ! Packet 41 | 41 | Variable (short) | | |- ! Packet 42 | 42 | 12 | | |- ! Packet 43 | 43 | 2 | | |- ! Packet 44 | 44 | 1 | | |- ! Packet 45 | 45 | Variable (byte) | | |- ! Packet 46 | 46 | 3 | | |- ! Packet 47 | 47 | 8 | | |- ! Packet 48 | 48 | 4 | | |- ! Packet 49 | 49 | 3 | | |- ! Packet 50 | 50 | Variable (byte) | | |- ! Packet 51 | 51 | 4 | | |- ! Packet 52 | 52 | Variable (byte) | | |- ! Packet 53 | 53 | 0 | | |- ! Packet 54 | 54 | Variable (byte) | | |- ! Packet 55 | 55 | 3 | | |- ! Packet 56 | 56 | Variable (short) | | |- ! Packet 57 | 57 | 8 | | |- ! Packet 58 | 58 | 2 | | |- ! Packet 59 | 59 | 0 | | |- ! Packet 60 | 60 | 4 | | |- ! Packet 61 | 61 | 6 | | |- ! Packet 62 | 62 | Variable (byte) | | |- ! Packet 63 | 63 | Variable (byte) | | |- ! Packet 64 | 64 | 10 | | |- ! Packet 65 | 65 | 3 | | |- ! Packet 66 | 66 | 4 | | |- ! Packet 67 | 67 | 4 | | |- ! Packet 68 | 68 | 0 | | |- ! Packet 69 | 69 | Variable (short) | | |- ! Packet 70 | 70 | Variable (short) | | |- ! Packet 71 | 71 | Variable (byte) | | |- ! Packet 72 | 72 | 8 | | |- ! Packet 73 | 73 | 3 | | |- ! Packet 74 | 74 | 6 | | |- ! Packet 75 | 75 | 4 | | |- ! Packet 76 | 76 | 7 | | |- ! Packet 77 | 77 | 3 | | |- ! Packet 78 | 78 | 4 | | |- ! Packet 79 | 79 | 1 | | |- ! Packet 80 | 80 | 6 | | |- ! Packet 81 | 81 | 10 | | |- ! Packet 82 | 82 | Variable (short) | | |- ! Packet 83 | 83 | 1 | | |- ! Packet 84 | 84 | Variable (short) | | |- ! Packet 85 | 85 | 0 | | |- ! Packet 86 | 86 | Variable (short) | | |- ! Packet 87 | 87 | 8 | | |- ! Packet 88 | 88 | Variable (byte) | | |- ! Packet 89 | 89 | 8 | | |- ! Packet 90 | 90 | Variable (byte) | | |- ! Packet 91 | 91 | 10 | | |- ! Packet 92 | 92 | 28 | | |- ! Packet 93 | 93 | 12 | | |- ! Packet 94 | 94 | 0 | | |- ! Packet 95 | 95 | Variable (short) | | |- ! Packet 96 | 96 | Variable (byte) | | |- ! Packet 97 | 97 | 8 | | |- ! Packet 98 | 98 | Variable (byte) | | |- ! Packet 99 | 99 | Variable (short) | | |- ! Packet 100 | 100 | 3 | | |- ! Packet 101 | 101 | 4 | | |- ! Packet 102 | 102 | 5 | | |- ! Packet 103 | 103 | 0 | | |- ! Packet 104 | 104 | 1 | | |- ! Packet 105 | 105 | 6 | | |- ! Packet 106 | 106 | Variable (byte) | | |- ! Packet 107 | 107 | 5 | | |- ! Packet 108 | 108 | 9 | | |- ! Packet 109 | 109 | 6 | | |- ! Packet 110 | 110 | 2 | | |- ! Packet 111 | 111 | 3 | | |- ! Packet 112 | 112 | Variable (short) | | |- ! Packet 113 | 113 | 1 | | |- ! Packet 114 | 114 | Variable (byte) | | |- ! Packet 115 | 115 | 6 | | |- ! Packet 116 | 116 | 12 | | |- ! Packet 117 | 117 | Variable (byte) | | |- ! Packet 118 | 118 | Variable (byte) | | |- ! Packet 119 | 119 | 11 | | |- ! Packet 120 | 120 | 6 | | |- ! Packet 121 | 121 | 4 | | |- ! Packet 122 | 122 | Variable (short) | | |- ! Packet 123 | 123 | 3 | | |- ! Packet 124 | 124 | 7 | | |- ! Packet 125 | 125 | 0 | | |- ! Packet 126 | 126 | 0 | | |- ! Packet 127 | 127 | Variable (byte) | | |- ! Packet 128 | 128 | 0 | | |- ! Packet 129 | 129 | 2 | | |- ! Packet 130 | 130 | Variable (byte) | | |- ! Packet 131 | 131 | 6 | | |- ! Packet 132 | 132 | 5 | | |- ! Packet 133 | 133 | 6 | | |- ! Packet 134 | 134 | Variable (short) | | |- ! Packet 135 | 135 | 6 | | |- ! Packet 136 | 136 | 6 | | |- ! Packet 137 | 137 | 2 | | |- ! Packet 138 | 138 | Variable (short) | | |- ! Packet 139 | 139 | 7 | | |- ! Packet 140 | 140 | 1 | | |- ! Packet 141 | 141 | Variable (short) | | |- ! Packet 142 | 142 | 10 | | |- ! Packet 143 | 143 | 6 | | |- ! Packet 144 | 144 | Variable (byte) | | |- |} == '''Update Protocol''' == This section documents the communication between the client and server over the connection used to stream resources. === '''Handshake Response''' === After receiving a handshake for the update protocol, the server responds with one of the following packets: {| class="wikitable" style="text-align: center" |- ! Name ! Id ! Fields ! Description |- ! OK | 0 | style="text-align: left" | * required_resource_sizes: int32[27] | Indicates a successful connection. |- ! OUT_OF_DATE | 6 | None | Indicates that the client is outdated. |- ! SERVER_FULL | 7 | None | Indicates that the server is full at the moment. |- ! IP_LIMIT | 9 | None | Indicates that the client is being rate limited. |- |} === '''Packets''' === This section documents the packets sent between the client and server over the update connection. ==== '''Client-to-Server''' ==== All packets sent by the client are 4 bytes long. Each packet includes a 1-byte opcode and a 3-byte payload. {| class="wikitable" style="text-align: center" |- ! Name ! Opcode ! Fields ! Description |- ! Prefetch Request | 0 | style="text-align: left" | * index: int8 * file: int16 | A passive request for a resource. |- ! Urgent Request | 1 | style="text-align: left" | * index: int8 * file: int16 | An urgent request for a resource. |- ! Client Logged In | 2 | style="text-align: left" | * padding: int24 | Indicates that the client has logged in. May be useful for adjusting response rate. |- ! Client Logged Out | 3 | style="text-align: left" | * padding: int24 | Indicates that the client has logged out. May be useful for adjusting response rate. |- ! Update XOR Code | 4 | style="text-align: left" | * xor_code: int8 * padding: int16 | Proposes a code to be used to encrypt all traffic. May be used to bypass firewalls or related software. |- ! Connection Information | 6 | style="text-align: left" | * version: int24 | Sent after a connection is established. The ''version'' field always has the value 3. |- ! Drop Request Queue | 7 | style="text-align: left" | * padding: int24 | Asks for currently pending requests to be dropped by the server. This packet is restricted to administrators by the client. |- |} ==== '''Server-to-Client''' ==== The server responds to the client's requests for particular resources by sending back the (possibly compressed) files. The data is in the following format: {| class="wikitable" style="text-align: center" |- ! Field ! Description |- | index: int8 | The resource's index. |- | file: int16 | The resource's file number. |- | compression_type: int8 | The compression type of the file. Can be 0 (uncompressed), 1 (compressed using BZIP2), or 2 (compressed using GZIP). |- | file_size: int32 | The (possibly compressed) size of the file. |- | uncompressed_size: int32 | The uncompressed size of the file. This is only present if the file is compressed (i.e. the ''compression_type'' field is set to 1 or 2). |- | data: int8[file_size] | The (possibly compressed) file data. |- |} Of particular note is that the response is grouped into 512-byte blocks. For every block after the first, the first byte of the block '''must''' be 0xff (decimal 255). In addition, if the client has updated its XOR code to be nonzero, the server must XOR each byte of the response with the chosen code before it sends it to the client. 668 Protocol 0 160 40rvu0w748t28u48omg1wvyjrgqow92 391 2012-04-29T23:38:44Z Buroa 55 Created page with "[[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a val..." [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * Update - connection type 15 * Fresh login - connection type 16 * JAGGRAB - connection type 17 * Reconnecting login - connection type 18 * Worldlist - varies, connection type 255 in #508 * Potentially more... The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored by At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted. The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. Trailing behind the session keys comes the client's username packed to a 64-bit long and password written as a C-string (NUL-terminated ASCII). This block is then RSA encrypted and stored for later use. Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time [NOW CLASSIFIED AS CONNECTION TYPE]. The byte is 18 or 16, respectively. Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the client revision int. After the client revision, an unknown byte is written that seems to always be zero (possibly the memory usage game-type flag [low mem/high mem]), followed by constantly zero byte and yet another zero byte. Next the packet writes the game applet width and height in pixels as shorts, followed quickly after by the UID (unique identifier or user identifier). Next comes the C-string settings string passed as a param to the applet, and after it the int affiliate identifier (probably identifies the game affiliate it was run on) with another int right after it. This int that trails behind is an unknown int that only has 22 bits used, all of which represent various flags within the client. Any clues as to what they are would be nice. The packet is just about crafted completely. [In 525, a strange short is written here]. To finish off the main chunk, the client writes all cache's reference table index-based CRC32 checksums as ints (29 in 539, 27 in 508, etc). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server. The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol. == '''Game Protocol''' == Game packet header: <pre> ubyte - opcode ubyte - packet size only if packet size is sent as -1 ushort - packet size only if packet size is sent as -2 </pre> After the header is read by the server, the packet specific data is then read and decoded by the server. ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 392 2012-04-29T23:42:06Z Buroa 55 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * JAGGRAB - connection type 15 * Create account - connection type 28 * Facebook login - connection type 29 * Potentially more... <pre> Needs documentation on how to login </pre> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 8 | FIXED | 2 | [[508:System update|System update]] | Displays the system update counter on the player's client. |- | 93 | FIXED | 7 | [[508:Send interface|Send interface]] | |- | 99 | FIXED | 1 | [[508:Run energy|Run energy]] | Sets the players run energy. |- | 104 | FIXED | 0 | [[508:Logout|Logout]] | Logs the player out. |- | 217 | FIXED | 6 | [[508:Send skill levels|Send skill levels]] | Sends the player's skill levels to the client to be drawn on the skill tab. |- | 218 | VARIABLE BYTE | N/A | [[508:Send message|Send message]] | Writes a string to the client's chat box. |- | 239 | FIXED | 3 | [[508:Set window pane|Set window pane]] | |- | 252 | VARIABLE BYTE | N/A | [[508:Send player option|Send player option]] | |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 393 2012-04-29T23:46:26Z Buroa 55 [[Category:RS2]] == '''Packet structure''' == When the client sends a packet to the server, the first byte encapsulates its opcode. This specific opcode is encrypted with a value generated by the ISAAC PRNG seeded with a dynamically server generated key during the login block. The server decrypts it and associates the opcode to the packet's respective predefined size. If the packet does not contain a fixed size, the opcode will be followed by either a byte or a word - varying per packet - for its proper size. This is then followed by the payload. == '''Login''' == Every connection to the main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of: * Login initiation - connection type 14 * JAGGRAB - connection type 15 * Create account - connection type 28 * Facebook login - connection type 29 * Potentially more... <pre> Needs documentation on how to login </pre> ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 69 | VARIABLE_SHORT | - | [[668:System update|System update]] | Displays the system update counter on the player's client. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 63 | FIXED | 6 | [[508:Dialogue Options|Dialogue Options.]] | Sent when a player clicks an dialogue button. The data sent is InterfaceId, buttonId, and something yet not discovered. |- |} 718 Protocol 0 333 7mb3sb89jgcgnj3hlpe8ecwwz31660q 1080 2014-06-03T02:26:32Z Sk8rdude461 228 Created page with "This page is for arham to add his 718 data. Since he doesn't know how to add pages." This page is for arham to add his 718 data. Since he doesn't know how to add pages. 1081 2014-06-03T02:28:11Z Sk8rdude461 228 This page is for arham to add his 718 data. Since he doesn't know how to add pages. Category:RS2 1082 2014-06-03T02:28:29Z Sk8rdude461 228 This page is for arham to add his 718 data. Since he doesn't know how to add pages. [[Category:Category:RS2]] 1083 2014-06-03T02:28:42Z Sk8rdude461 228 This page is for arham to add his 718 data. Since he doesn't know how to add pages. [[Category:RS2]] 1093 2014-06-04T23:50:40Z Arham 4 303 [[Category:RS2]] == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |} 1094 2014-06-05T00:26:42Z Arham 4 303 [[Category:RS2]] == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 2 | N/A | -2 | [[718:Friends packet|Friends packet]] | Sends a friend to the friend list. |- | 5 | N/A | 4 | [[718:Close window|Close window]] | Closes an interface. |- | 6 | N/A | 1 | [[718:Player under NPC priority|Player under NPC priority]] | N/A |- | 9 | N/A | 6 | [[718:Music effect|Music effect]] | Plays a music effect. |- | 10 | N/A | -1 | [[718:Set mouse|Set mouse]] | N/A |- | 11 | N/A | -2 | [[718:World list|World list]] | Sends the world list. |- | 14 | N/A | 23 | [[718:Interface|Interface]] | Opens an interface. |- | 17 | N/A | -2 | [[718:Open URL|Open URL]] | Opens a hyperlink. |- | 20 | N/A | 16 | [[718:Projectile|Projectile]] | Plays a projectile. |- | 23 | N/A | 4 | [[718:Player on IComponent|Music effect]] | N/A |- | 25 | N/A | 1 | [[718:Run energy|Run energy]] | Sends the run energy. |- | 30 | N/A | -1 | [[718:Send friend quick chat|Send friend quick chat]] | Sends a friend a quick chat message. |- | 31 | N/A | 8 | [[718:Model on IComponent|Model on IComponent]] | Sends a model to an IComponent (child interface). |- | 32 | N/A | -1 | [[718:Receive friend quick chat|Receive friend quick chat]] | Displays a received quick chat message to a friend. |- | 33 | N/A | -1 | [[718:Receive personal message|Receive personal message]] | Received a private message (PM) and displays it. |- | 39 | N/A | 19 | [[718:Game pane|Game pane]] | Sends the game pane. |- | 40 | N/A | 12 | [[718:IComponent Settings|IComponent Settings]] | N/A |- | 42 | N/A | -2 | [[718:Load map scene|Load map scene]] | Loads a map. |- | 44 | N/A | 6 | [[718:Shake camera|Shake camera]] | Shakes the camera of the character. |- | 45 | N/A | 2 | [[718:Destroy object|Destroy object]] | Removes an object from the screen. |- | 55 | N/A | -2 | [[718:Ignores|Ignores]] | Sends a player to a player's ignore list. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |} 1095 2014-06-05T00:31:39Z Arham 4 303 [[Category:RS2]] == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 2 | N/A | -2 | [[718:Friends packet|Friends packet]] | Sends a friend to the friend list. |- | 5 | N/A | 4 | [[718:Close window|Close window]] | Closes an interface. |- | 6 | N/A | 1 | [[718:Player under NPC priority|Player under NPC priority]] | N/A |- | 9 | N/A | 6 | [[718:Music effect|Music effect]] | Plays a music effect. |- | 10 | N/A | -1 | [[718:Set mouse|Set mouse]] | N/A |- | 11 | N/A | -2 | [[718:World list|World list]] | Sends the world list. |- | 14 | N/A | 23 | [[718:Interface|Interface]] | Opens an interface. |- | 17 | N/A | -2 | [[718:Open URL|Open URL]] | Opens a hyperlink. |- | 20 | N/A | 16 | [[718:Projectile|Projectile]] | Plays a projectile. |- | 23 | N/A | 4 | [[718:Player on IComponent|Music effect]] | N/A |- | 25 | N/A | 1 | [[718:Run energy|Run energy]] | Sends the run energy. |- | 30 | N/A | -1 | [[718:Send friend quick chat|Send friend quick chat]] | Sends a friend a quick chat message. |- | 31 | N/A | 8 | [[718:Model on IComponent|Model on IComponent]] | Sends a model to an IComponent (child interface). |- | 32 | N/A | -1 | [[718:Receive friend quick chat|Receive friend quick chat]] | Displays a received quick chat message to a friend. |- | 33 | N/A | -1 | [[718:Receive personal message|Receive personal message]] | Received a private message (PM) and displays it. |- | 39 | N/A | 19 | [[718:Game pane|Game pane]] | Sends the game pane. |- | 40 | N/A | 12 | [[718:IComponent Settings|IComponent Settings]] | N/A |- | 42 | N/A | -2 | [[718:Load map scene|Load map scene]] | Loads a map. |- | 44 | N/A | 6 | [[718:Shake camera|Shake camera]] | Shakes the camera of the character. |- | 45 | N/A | 2 | [[718:Destroy object|Destroy object]] | Removes an object from the screen. |- | 55 | N/A | -2 | [[718:Ignores|Ignores]] | Sends a player to a player's ignore list. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 3 | FIXED | 16 | [[718:Item on item|Item on item]] | Send an item on item request. |- | 4 | FIXED | -1 | [[718:Add ignore|Add ignore]] | Sends a request to add a person to a person's ignore list. |- | 8 | FIXED | -1 | [[718:Walk|Walk]] | Sends a request to walk to specific coordinates. |- | 9 | FIXED | 3 | [[718:NPC Examine|NPC Examine]] | Sends a request to examine an NPC. |- |} 1098 2014-06-05T18:59:58Z Arham 4 303 [[Category:RS2]] == '''Packet structure''' == ? == '''Login''' == ? == '''Game Protocol''' == ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 2 | VARIABLE_SHORT | -2 | [[718:Friends packet|Friends packet]] | Sends a friend to the friend list. |- | 5 | FIXED | 4 | [[718:Close window|Close window]] | Closes an interface. |- | 6 | FIXED | 1 | [[718:Player under NPC priority|Player under NPC priority]] | N/A |- | 9 | FIXED | 6 | [[718:Music effect|Music effect]] | Plays a music effect. |- | 10 | VARIABLE_BYTE | -1 | [[718:Set mouse|Set mouse]] | N/A |- | 11 | FIXED | -2 | [[718:World list|World list]] | Sends the world list. |- | 14 | FIXED | 23 | [[718:Interface|Interface]] | Opens an interface. |- | 17 | VARIABLE_SHORT | -2 | [[718:Open URL|Open URL]] | Opens a hyperlink. |- | 20 | FIXED | 16 | [[718:Projectile|Projectile]] | Plays a projectile. |- | 23 | FIXED | 4 | [[718:Player on IComponent|Music effect]] | N/A |- | 25 | FIXED | 1 | [[718:Run energy|Run energy]] | Sends the run energy. |- | 30 | VARIABLE_BYTE | -1 | [[718:Send friend quick chat|Send friend quick chat]] | Sends a friend a quick chat message. |- | 31 | FIXED | 8 | [[718:Model on IComponent|Model on IComponent]] | Sends a model to an IComponent (child interface). |- | 32 | FIXED | -1 | [[718:Receive friend quick chat|Receive friend quick chat]] | Displays a received quick chat message to a friend. |- | 33 | VARIABLE_BYTE | -1 | [[718:Receive personal message|Receive personal message]] | Received a private message (PM) and displays it. |- | 39 | FIXED | 19 | [[718:Game pane|Game pane]] | Sends the game pane. |- | 40 | FIXED | 12 | [[718:IComponent Settings|IComponent Settings]] | N/A |- | 42 | VARIABLE_SHORT | -2 | [[718:Load map scene|Load map scene]] | Loads a map. |- | 44 | FIXED | 6 | [[718:Shake camera|Shake camera]] | Shakes the camera of the character. |- | 45 | FIXED | 2 | [[718:Destroy object|Destroy object]] | Removes an object from the screen. |- | 55 | VARIABLE_SHORT | -2 | [[718:Ignores|Ignores]] | Sends a player to a player's ignore list. |- |} ===Client -> Server Packets=== {| border=2 |- ! Opcode ! Type ! Length (bytes) ! Name ! Description |- | 3 | FIXED | 16 | [[718:Item on item|Item on item]] | Send an item on item request. |- | 4 | VARIABLE_BYTE | -1 | [[718:Add ignore|Add ignore]] | Sends a request to add a person to a person's ignore list. |- | 8 | VARIABLE_BYTE | -1 | [[718:Walk|Walk]] | Sends a request to walk to specific coordinates. |- | 9 | FIXED | 3 | [[718:NPC Examine|NPC Examine]] | Sends a request to examine an NPC. |- |} 718:Friends packet 0 344 9b9dw3cohw5ppavjoba2ao0a3z742d2 1099 2014-06-05T19:06:05Z Arham 4 303 Created page with "<h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"..." <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td></tr> <td> String </td> <td> Display name </td> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td> <td> Short </td> <td> The World ID </td> <td> Byte </td> <td> The player's rank </td> <td> String </td> <td> Display name </td> </table> 1100 2014-06-05T19:06:29Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td></tr> <td> String </td> <td> Display name </td></tr> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td></tr> <td> Short </td> <td> The World ID </td></tr> <td> Byte </td> <td> The player's rank </td></tr> <td> String </td> <td> Display name </td></tr> </table> 1101 2014-06-05T19:06:45Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td></tr> <td> String </td> <td> Display name </td> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td> <td> Short </td> <td> The World ID </td> <td> Byte </td> <td> The player's rank </td> <td> String </td> <td> Display name </td> </table> 1102 2014-06-05T19:06:51Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td> <td> String </td> <td> Display name </td> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td> <td> Short </td> <td> The World ID </td> <td> Byte </td> <td> The player's rank </td></tr> <td> String </td> <td> Display name </td> </table> 1103 2014-06-05T19:07:13Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td> <tr> <td> String </td> <td> Display name </td></tr> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td> <td> Short </td> <td> The World ID </td> <td> Byte </td> <td> The player's rank </td> <td> String </td> <td> Display name </td> </table> 1104 2014-06-05T19:07:29Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td> <tr> <td> String </td> <td> Display name </td></tr> <tr> <td> String </td> <td> If the display name does not equal the player's username, then this send the username </td></tr> <tr> <td> Short </td> <td> The World ID </td></tr> <tr> <td> Byte </td> <td> The player's rank </td></tr> <td> String </td> <td> Display name </td> </table> 1105 2014-06-05T19:07:54Z Arham 4 303 <h3><span class="mw-headline"> Description </span></h3> <p>Sends friend data to the client </p> <h3><span class="mw-headline"> Packet Structure </span></h3> <table border="2"> <tr> <th> Data type </th><th> Description </th></tr> <tr> <td> Byte </td><td> If it is a warning message </td> <tr> <td> String </td> <td> Display name </td></tr> <tr> <td> String </td> <td> If the display name does not equal the player's username, then this sends the username </td></tr> <tr> <td> Short </td> <td> The World ID </td></tr> <tr> <td> Byte </td> <td> The player's rank </td></tr> <td> String </td> <td> Display name </td> </table> 1110 2014-06-07T01:28:10Z Arham 4 303 {{packet|name=Friends packet|description=Sends friend data to the client|opcode=2|type=VARIABLE_SHORT|length=-2|revision=718}} == Friends packet == === Description === Sends friend data to the client === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Standard_data_types|Short]] || If it is a warning message. |- | [[Data_Types#Standard_data_types|String]] || Display name |- | [[Data_Types#Standard_data_types|String]] || If the display name does not equal the player's username, then this sends the username |- | [[Data_Types#Standard_data_types|Short]] || The World ID |- | [[Data_Types#Standard_data_types|Byte]] || The player's rank |} 718:Close window 0 348 amfcst5n6e4x8bmu8uwelfg98oxl31y 1109 2014-06-07T01:25:00Z Arham 4 303 Created page with "{{packet|name=Close window|description=Closes a window/interface.|opcode=5|type=Fixed|length=4|revision=718}} == Close window == === Description === Closes an interface that..." {{packet|name=Close window|description=Closes a window/interface.|opcode=5|type=Fixed|length=4|revision=718}} == Close window == === Description === Closes an interface that is displayed (NOT CHATBOX INTERFACES!). === Packet Structure === {| border=2 ! Data type ! Description |- | [[Data_Types#Little_Endian|Little Endian]] [[Data_Types#Standard_data_types|Int]] || Window ID. |} 718:Player under NPC priority 0 350 rmlrcf8n11obbml8fi0iu6nyrepx06e 1112 2014-06-07T01:31:55Z Arham 4 303 Created page with "{{packet|name=Player under NPC priority|description=Prioritizes the player under the NPC.|opcode=6|type=Fixed|length=1|revision=718}} == Player under NPC priority == === Desc..." {{packet|name=Player under NPC priority|description=Prioritizes the player under the NPC.|opcode=6|type=Fixed|length=1|revision=718}} == Player under NPC priority == === Description === Prioritizes the player under the NPC. === Packet Structure === {| border=2 ! Data type ! Description |- | Byte C || If is to prioritize (1) or not (0). |} 718:Music effect 0 351 484mik9v7pj0lcutrdeebrzizzka4ns 1113 2014-06-07T01:34:31Z Arham 4 303 Created page with "{{packet|name=Music effect|description=Plays a music effect.|opcode=9|type=Fixed|length=6|revision=718}} == Music effect == === Description === Plays a sound effect (like th..." {{packet|name=Music effect|description=Plays a music effect.|opcode=9|type=Fixed|length=6|revision=718}} == Music effect == === Description === Plays a sound effect (like the birds chirping). === Packet Structure === {| border=2 ! Data type ! Description |- | 128 Byte || The volume (0 - 255). |- | 24 Bit Integer V2 || ? |- | Short || Music effect ID. |} 718:Interface 0 352 0165bz6treydcbmfo7elk71n1p1m5ow 1114 2014-06-07T01:38:28Z Arham 4 303 Created page with "{{packet|name=Send Interface|description=Sends an interface to be opened.|opcode=14|type=Fixed|length=23|revision=718}} == Send Interface == === Description === Opens an int..." {{packet|name=Send Interface|description=Sends an interface to be opened.|opcode=14|type=Fixed|length=23|revision=718}} == Send Interface == === Description === Opens an interface (NOT CHATBOX INTERFACES!). === Packet Structure === {| border=2 ! Data type ! Description |- | Short || The interface ID. |- | Int || ? |- | Int V2 || ? |- | Int V1 || Window ID. |- | Byte || If it is a walkable interface (1) or not (0). |- | Int V1 || ? |- | Int V2 || ? |} 718:Open URL 0 353 39h1714s4atn61ccad4mdhihkyih4p5 1115 2014-06-07T01:40:39Z Arham 4 303 Created page with "{{packet|name=Open URL|description=Opens a hyperlink.|opcode=17|type=VARIABLE_SHORT|length=-2|revision=718}} == Close window == === Description === Opens a hyperlink sent (d..." {{packet|name=Open URL|description=Opens a hyperlink.|opcode=17|type=VARIABLE_SHORT|length=-2|revision=718}} == Close window == === Description === Opens a hyperlink sent (doesn't write to the chatbox, just opens). === Packet Structure === {| border=2 ! Data type ! Description |- | Byte || ? |- | String || The URL. |} 742 Protocol 0 219 87qqmqz7gsuulxon2zdmvcku6ggh4bv 735 2012-11-09T15:42:52Z Orient 121 Created page with "===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | - 23 | [[742:Interface Packet|Interface Packet]] | Produces an in..." ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | - 23 | [[742:Interface Packet|Interface Packet]] | Produces an interface for the player to see. |- | 116 | Unknown | - -1 | [[742:Commands Packet|Commands Packet]] | The packet to utilize commands. |- | 156 | Unknown | - 3 | [[742:A Config Packet|A Config Packet]] | A packet to send one of the four/five types of configs. |- | 89 | Unknown | - -2 | [[742:Maps Packet|Maps Packet]] | A packet that sends the loading of maps. |- | 90 | Unknown | - -2 | [[742:Player Update Packet|Player Update Packet]] | A packet to update the player's appearance etcetera. |- | 72 | Unknown | - -2 | [[742:NPC Update Packet|NPC Update Packet]] | A packet to update a NPC's appearance etcetera. |- | 29 | Unkown | - -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- |} 736 2012-11-09T17:30:04Z Orient 121 [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | - 23 | [[742:Interface Packet|Interface Packet]] | Produces an interface for the player to see. |- | 116 | Unknown | - -1 | [[742:Commands Packet|Commands Packet]] | The packet to utilize commands. |- | 156 | Unknown | - 3 | [[742:A Config Packet|A Config Packet]] | A packet to send one of the four/five types of configs. |- | 89 | Unknown | - -2 | [[742:Maps Packet|Maps Packet]] | A packet that sends the loading of maps. |- | 90 | Unknown | - -2 | [[742:Player Update Packet|Player Update Packet]] | A packet to update the player's appearance etcetera. |- | 72 | Unknown | - -2 | [[742:NPC Update Packet|NPC Update Packet]] | A packet to update a NPC's appearance etcetera. |- | 29 | Unkown | - -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- |} 737 2012-11-09T17:36:31Z Orient 121 /* Server -> Client Packets */ [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | 23 | [[742:Interface Packet|Interface Packet]] | Produces an interface for the player to see. |- | 116 | Unknown | -1 | [[742:Commands Packet|Commands Packet]] | The packet to utilize commands. |- | 156 | Unknown | - 3 | [[742:A Config Packet|A Config Packet]] | A packet to send one of the four/five types of configs. |- | 89 | Unknown | -2 | [[742:Maps Packet|Maps Packet]] | A packet that sends the loading of maps. |- | 90 | Unknown | -2 | [[742:Player Update Packet|Player Update Packet]] | A packet to update the player's appearance etcetera. |- | 72 | Unknown | -2 | [[742:NPC Update Packet|NPC Update Packet]] | A packet to update a NPC's appearance etcetera. |- | 29 | Unkown | -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- |} 738 2012-11-09T17:37:36Z Orient 121 /* Server -> Client Packets */ [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | 23 | [[742:Interface Packet|Interface Packet]] | Produces an interface for the player to see. |- | 116 | Unknown | -1 | [[742:Commands Packet|Commands Packet]] | The packet to utilize commands. |- | 156 | Unknown | -3 | [[742:A Config Packet|A Config Packet]] | A packet to send one of the four/five types of configs. |- | 89 | Unknown | -2 | [[742:Maps Packet|Maps Packet]] | A packet that sends the loading of maps. |- | 90 | Unknown | -2 | [[742:Player Update Packet|Player Update Packet]] | A packet to update the player's appearance etcetera. |- | 72 | Unknown | -2 | [[742:NPC Update Packet|NPC Update Packet]] | A packet to update a NPC's appearance etcetera. |- | 29 | Unkown | -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- |} 741 2012-11-11T03:46:53Z Orient 121 /* Server -> Client Packets */ [[Category:RS2]] ===Server -> Client Packets=== {| border=2 |- ! Opcode ! Type ! Size ! Name ! Description |- | 47 | Unknown | 23 | [[742:Interface Packet|Interface Packet]] | Produces an interface for the player to see. |- | 116 | Unknown | -1 | [[742:Commands Packet|Commands Packet]] | The packet to utilize commands. |- | 156 | Unknown | -3 | [[742:A Config Packet|A Config Packet]] | A packet to send one of the four/five types of configs. |- | 89 | Unknown | -2 | [[742:Maps Packet|Maps Packet]] | A packet that sends the loading of maps. |- | 90 | Unknown | -2 | [[742:Player Update Packet|Player Update Packet]] | A packet to update the player's appearance etcetera. |- | 72 | Unknown | -2 | [[742:NPC Update Packet|NPC Update Packet]] | A packet to update a NPC's appearance etcetera. |- | 29 | Unkown | -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- | 67 | Unkown | -2 | [[742:Items Packet|Items Packet]] | A packet to load items in a way? |- | 120 | Unkown | -1 | [[742:Friends Chat Receive Message Packet|Friends Chat Receive Message Packet]] | A packet that sends the FC message. |- | 147 | Unkown | 2 | [[742:System Update Packet|System Update Packet]] | A packet for the system update timer. |- | 6 | Unkown | 3 | [[742:World Tile Packet|World Tile Packet]] | A packet to send the World Tile. |- | 29 | Unkown | -2 | [[742:RunScripts Packet|RunScripts Packet]] | A packet to send Runscripts. |- | 40 | Unkown | 1 | [[742:Send Skills Packet|Send Skills Packet]] | A packet to send the skills of a player. |- |} Category:RS3 14 2092 o6rvyzhaztoimgp4zkg1twc6v714v5i 3066 2015-04-17T07:26:50Z Wmeddy 4459 Rolex Replica Watches Online Rolex Replica Watches Online Actually Swiss movements happen to be the largest reason for which they've come this far. A big if not the most important factor in selecting a Swiss watch is the brand that you plan to purchase. To purchase one such watch you don't have to go anywhere just take a seat and turn on your computer because there traders are reaching their customers through their official website. As a result of the availability of these watches at a cheaper rate in the market, the number of customers who are willing to buy them increased sharply. While the Submariner is produced in several combinations of materials and several combinations of colors, there is only one Sea-Dweller watch. Sports watches are constructed using a variety of materials with the most durable being stainless steel and plastic. Rolex watches carry a hefty price tag. Many people cannot afford them, and some decide to finance them over a period of time. With the costs and expectations of a Rolex, comes detail. Each Rolex watch consists of numerous tiny parts, assembled systematically to ensure each functions out performs expectations. It is considered as one of the top manufacturers of Swiss watches. Swiss watches continue its legacy of quality timepieces as the people's demands continue to evolve over the years. When the watch is combined with a keyring, it makes a sensible choice of accessory for many watch enthusiasts. That is the reason for which swiss [http://www.topwatchbase.com replica rolex watches] happen to be so accepted with gentlemen about the earth. 3067 2015-04-17T07:27:40Z Wmeddy 4459 Blanked the page Category:Cache 14 200 t7nw4fyh16a8cgabiy8st51k0cz4d5q 588 2012-08-28T02:11:21Z Jmood 88 Category Cache for Cache related information == '''Cache Archive Format''' == == '''JAGGRAB Protocol''' == == '''Ondemand Protocol''' == Archive Format 0 203 91ngkzt6pkslctdb1inwwvin4hr47r0 591 2012-08-28T02:20:17Z Jmood 88 Created page with "[[Category:Cache]] == Introduction == Since 194 all way up until 377, all the files in cache 0 have an archive-like format which contains a collection of named files (e.g. '''B..." [[Category:Cache]] == Introduction == Since 194 all way up until 377, all the files in cache 0 have an archive-like format which contains a collection of named files (e.g. '''BADENC.TXT''' is a file which contains bad words in the '''wordenc''' archive). === Diagram === ---- [http://img263.imageshack.us/img263/9678/68481568.png External Diagram Image] == Usage == These files are used by the client for a variety of purposes. Some, such as the '''DATA''' file contain data themselves (in this case the interfaces). Others, such as the '''MAP_INDEX''' file, contain information about where to locate the map and landscape files in the cache. == Format == tribyte uncompressedsize tribyte compressedsize If the uncompressed and compressed sizes are equal, the whole file is not compressed but the individual entries are compressed using bzip2. If they are not equal, the entire file is compressed using bzip2 but the individual entries are not. Also note, the magic id at the start of the bzip2 entries are not included in the cache. If you use an existing API to read the files and want to add this back, you must append the four characters: BZh1 before you decompress. short fileCount Each file entry has the format: int nameHash tribyte uncompressedSize tribyte compressedSize When you are looping through the files, you need to keep track of the file offset yourself. This psuedocode demonstrates how: int offset = buffer.getCurrentOffset() + numFiles * 10; for(int i = 0; i < numFiles; i++) { // read values int thisFileOffset = offset; offset += thisFileCompressedSize; } To get a named file by its name, you should first hash the name using this method: public static int hash(String name) { int hash = 0; name = name.toUpperCase(); for(int j = 0; j < name.length(); j++) { hash = (hash * 61 + name.charAt(j)) - 32; } return hash; } Then, loop through the file entries you loaded earlier to find a matching hash. Read the compressed file size from the offset. If the whole file is not compressed, you should decompress the individual entry. == '''#194 Archive Format''' == The 194 (RuneScape 2 beta) client worked with a very simple cache format. Each file in the cache was a file on the operating system. === Name hashing === Every name in the cache was hashed using the following method which is, incidentally, similar to the way player names are converted to longs. public static final long gethash(String string) { string = string.trim(); long l = 0L; for (int i = 0; i < string.length() && i < 12; i++) { char c = string.charAt(i); l *= 37L; if (c >= 'A' && c <= 'Z') l += (long) ('\001' + c - 'A'); else if (c >= 'a' && c <= 'z') l += (long) ('\001' + c - 'a'); else if (c >= '0' && c <= '9') l += (long) ('\033' + c - '0'); } return l; } The resulting long was converted to a string and the file was given that name. === Files === The files in the cache were the ones used in the [[JAGGRAB_Protocol|JAGGRAB Protocol]] (i.e. files in cache 0 in old engine caches) and map (mX_Y) and landscape (lX_Y) files. Incidentally, this naming is very similar to the names of the map and landscape files in new engine caches. == '''#317 Archive Format''' == The old engine cache is made up two types of files. === Data file === The data file holds all of the files in the cache and is named '''main_file_cache.dat'''. It is therefore very big, typically ~10-20 megabytes.. === Index file === There are several index files, named '''main_file_cache.idx''' and then postfixed with a number. Each index file holds 'pointers' to where a file is located in the main cache. Each index file represents a type of file. === Index file format === The index file is made up of 6 byte blocks which hold information about where a file can be located in the data file. The format of a single block is as follows: tribyte fileSize tribyte initialDataBlockId === Data file format === The data file is made up of 520 byte blocks. The format of each of these blocks is as follows: short nextFileId short currentFilePartId tribyte nextDataBlockId byte nextFileTypeId byte[512] blockData === Explanation === An example will be used here as it is easier to follow. Let us say, the client wishes to fetch file type 2, file id 17. First off, it will open the main_file_cache.idx2 file and seek to the index 17 * 6 (102). It will then read two tribytes. fileSize = 1200 intialDataBlockId = 4 The client will now open the main_file_cache.dat file and seek to the index 4 * 520 (2080). The values it reads will be: nextFileId = 17 currentFilePartId = 0 nextDataBlockId = 5 nextFileTypeId = 2 blockData = ... It will read the first 512 bytes of the file and then knows that there is 688 bytes left. Therefore, it has to read the next block. nextFileId = 17 currentFilePartId = 1 nextDataBlockId = 6 nextFileTypeId = 2 blockData ... It reads these next 512 bytes of the file and now knows that there are 176 bytes left. So for a final time, it will read the next block. nextFileId = 18 currentFilePartId = 2 nextDataBlockId = 7 nextFileTypeId = 2 blockData = ... It can ignore most of these values (the next ones are meaningless at this stage) and read the final 176 bytes. The whole 1200 byte file has now been read. JAGGRAB Protocol 0 201 9todx9lrlu0g24191nbsagtcwjy9qym 589 2012-08-28T02:13:03Z Jmood 88 Created page with "[[Category:Cache]] == Introduction == The JAGGRAB protocol is used to 'grab' cache files from the file server and download them. It is a text-based protocol, similar to HTTP, ..." [[Category:Cache]] == Introduction == The JAGGRAB protocol is used to 'grab' cache files from the file server and download them. It is a text-based protocol, similar to HTTP, and the client will fall back to HTTP if JAGGRAB is unavailable. This generally happens in unsigned mode and helps users who are behind firewalls. == Request format == A request is simply the text JAGGRAB, a space, the path to the file and a newline character. Therefore, it is very similar to a HTTP/0.9 GET request. JAGGRAB /path/to/file === New engine === In (perhaps all) new engine clients, the client prefixes the JAGGRAB request line with a single byte (value 17). == Response format == The response is simply the raw file data. Once the response is sent, the connection is closed. == Files == There are a number of files which map to files in the cache. * '''/crc''' - the CRC table * '''/title''' - cache 0, file 1 * '''/config''' - cache 0, file 2 * '''/interface''' - cache 0, file 3 * '''/media''' - cache 0, file 4 * '''/versionlist''' - cache 0, file 5 * '''/textures''' - cache 0, file 6 * '''/wordenc''' - cache 0, file 7 * '''/sounds''' - cache 0, file 8 NOTE: the client will usually postfix these with random numbers, so when checking for the file only the start of the string should be examined: not the whole one.<BR> NOTE: The crc is postfixed with the client revision 705 2012-09-30T08:41:07Z Graham 97 [[Category:Cache]] == Introduction == The JAGGRAB protocol is used to 'grab' cache files from the file server and download them. It is a text-based protocol, similar to HTTP/0.9, and the client will fall back to HTTP if JAGGRAB is unavailable. This generally happens in unsigned mode and helps users who are behind firewalls. == Request format == A request is simply the text JAGGRAB, a space, the path to the file and a newline character. Therefore, it is very similar to a HTTP/0.9 GET request. JAGGRAB /path/to/file === New engine === In (perhaps all) new engine clients, the client prefixes the JAGGRAB request line with a single byte (value 17). == Response format == The response is simply the raw file data. Once the response is sent, the connection is closed. == Files == There are a number of files which map to files in the cache. * '''/crc''' - the CRC table * '''/title''' - cache 0, file 1 * '''/config''' - cache 0, file 2 * '''/interface''' - cache 0, file 3 * '''/media''' - cache 0, file 4 * '''/versionlist''' - cache 0, file 5 * '''/textures''' - cache 0, file 6 * '''/wordenc''' - cache 0, file 7 * '''/sounds''' - cache 0, file 8 NOTE: the client will usually postfix these with random numbers, so when checking for the file only the start of the string should be examined: not the whole one. This is to help avoid caches when these files are fetched over HTTP.<BR> NOTE: The crc is postfixed with the client revision Ondemand Protocol 0 2804 stodnau88nzv7c8ej4ib30guijmtgfh 590 2012-08-28T02:17:30Z Jmood 88 Created page with "[[Category:Cache]] == Introduction == The 'Ondemand' protocol is used to stream updates to the cache. The client knows which files to update from the CRC file downloaded using ..." [[Category:Cache]] == Introduction == The 'Ondemand' protocol is used to stream updates to the cache. The client knows which files to update from the CRC file downloaded using the [[:Category:JAGGRAB_Protocol|JAGGRAB protocol]]. == Request packet == The client first authenticates as an ondemand client by using the opcode '15' (as opposed to the game, which uses the type '14'). The format of the request is: unsigned byte cacheId; unsigned short fileId; unsigned byte priority; There can be multiple requests per session. == Response packet == The response is sent in blocks. The maximum size of a block is 500 bytes. Smaller blocks (at the end of a file) are permitted. Each block has the format: unsigned byte cacheId; unsigned short fileId; unsigned short fileSize; unsigned byte blockNumber; unsigned byte[] blockData; 613 2012-08-29T01:50:07Z Jmood 88 [[Category:Cache]] == Introduction == The 'Ondemand' protocol is used to stream updates to the cache. The client knows which files to update from the CRC file downloaded using the [[JAGGRAB_Protocol|JAGGRAB protocol]]. == Request packet == The client first authenticates as an ondemand client by using the opcode '15' (as opposed to the game, which uses the type '14'). The format of the request is: unsigned byte cacheId; unsigned short fileId; unsigned byte priority; There can be multiple requests per session. == Response packet == The response is sent in blocks. The maximum size of a block is 500 bytes. Smaller blocks (at the end of a file) are permitted. Each block has the format: unsigned byte cacheId; unsigned short fileId; unsigned short fileSize; unsigned byte blockNumber; unsigned byte[] blockData; Map Region System 0 120 bc3x504xsrsmgrq0hbkvztwcf5jxaev 285 2011-07-19T16:54:41Z Admin 1 Created page with "== Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X,..." == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: [code] int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; [/code] This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is [b]395[/b] and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is [b]50[/b] and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map and there is no Map X or Map Y. A Map is however a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center and is also the [b]formatted chunk[/b]. When a region update is called by the server, a new map is called but you must understand that the formatted chunk never changes; the tiles in the map however are updated and trimmed. When the player moves out of the formatted chunk the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region but when the range of +- 32 from the point in the center of the chunk is reached a update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==How Regions are Loaded== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 286 2011-07-19T16:55:06Z Admin 1 == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is [b]395[/b] and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is [b]50[/b] and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map and there is no Map X or Map Y. A Map is however a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center and is also the [b]formatted chunk[/b]. When a region update is called by the server, a new map is called but you must understand that the formatted chunk never changes; the tiles in the map however are updated and trimmed. When the player moves out of the formatted chunk the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region but when the range of +- 32 from the point in the center of the chunk is reached a update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==How Regions are Loaded== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 287 2011-07-19T16:55:56Z Admin 1 == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is [b]395[/b] and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is [b]50[/b] and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map and there is no Map X or Map Y. A Map is however a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center and is also the [b]formatted chunk[/b]. When a region update is called by the server, a new map is called but you must understand that the formatted chunk never changes; the tiles in the map however are updated and trimmed. When the player moves out of the formatted chunk the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region but when the range of +- 32 from the point in the center of the chunk is reached a update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 288 2011-07-19T16:56:55Z Admin 1 == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is 395 and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is 50 and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map and there is no Map X or Map Y. A Map is however a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center and is also the formatted chunk. When a region update is called by the server, a new map is called but you must understand that the formatted chunk never changes; the tiles in the map however are updated and trimmed. When the player moves out of the formatted chunk the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region but when the range of +- 32 from the point in the center of the chunk is reached a update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 363 2012-01-26T01:26:08Z Gara494 32 /* Map */ == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is 395 and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is 50 and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map, and there is no Map X or Map Y. A Map is, however, a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center, and is also the formatted chunk. When a region update is called by the server, a new map is called, but you must understand that the formatted chunk never changes; the tiles in the map, however, are updated and trimmed. When the player moves out of the formatted chunk, the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region, but when the range of +- 32 from the point in the center of the chunk is reached, an update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 404 2012-06-06T21:10:17Z Sini 33 Blanked the page 406 2012-06-07T23:34:04Z The Wanderer 13 == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is 395 and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is 50 and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map, and there is no Map X or Map Y. A Map is, however, a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center, and is also the formatted chunk. When a region update is called by the server, a new map is called, but you must understand that the formatted chunk never changes; the tiles in the map, however, are updated and trimmed. When the player moves out of the formatted chunk, the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region, but when the range of +- 32 from the point in the center of the chunk is reached, an update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://www.gliffy.com/pubdoc/2764885/L.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://www.gliffy.com/pubdoc/2764957/L.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 409 2012-06-13T20:42:09Z Z 61 Links provided by Sinisoul are unreliable. == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is 395 and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is 50 and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map, and there is no Map X or Map Y. A Map is, however, a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center, and is also the formatted chunk. When a region update is called by the server, a new map is called, but you must understand that the formatted chunk never changes; the tiles in the map, however, are updated and trimmed. When the player moves out of the formatted chunk, the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region, but when the range of +- 32 from the point in the center of the chunk is reached, an update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://i.imgur.com/C3huO.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://i.imgur.com/ydl78.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 872 2013-07-14T04:24:23Z Sini 33 Blanked the page 873 2013-07-14T10:29:50Z Jmood 88 Reverted edits by [[Special:Contributions/Sini|Sini]] ([[User talk:Sini|talk]]) to last revision by [[User:Z|Z]] == Intro == Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary: == Definitions == ===Tile=== A tile is a representation of an absolute coordinate. ''Example: Varrock Coordinates [3211, 3424] represents one tile.'' ===Tile Chunk=== A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is: int chunkX = (getAbsoluteX() >> 3) - 6; int chunkY = (getAbsoluteY() >> 3) - 6; This centers the chunk on the map, more on that later. The normal chunk equation is: int chunkX = (getAbsoluteX() >> 3); int chunkY = (getAbsoluteY() >> 3); ''Example: The Coordinates [3211, 3424] Chunk X (formatted) is 395 and the Chunk Y (un-formatted) is 428.'' ===Region=== A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is: int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8; int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8; ''Example: The Coordinates [3211, 3424] Region X is 50 and the Region Y is 53.'' Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes. ===Map=== There is no calculation for a map, and there is no Map X or Map Y. A Map is, however, a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center, and is also the formatted chunk. When a region update is called by the server, a new map is called, but you must understand that the formatted chunk never changes; the tiles in the map, however, are updated and trimmed. When the player moves out of the formatted chunk, the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region, but when the range of +- 32 from the point in the center of the chunk is reached, an update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused? ===Diagram=== [http://i.imgur.com/C3huO.png External Image] The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes. ==Loading== These were the regions loaded for the coordinates [3183, 3217]: [http://i.imgur.com/ydl78.png External Image] If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area. The amount of regions that are to be loaded can be calculated this way: Please note that Region X and Region Y are not formatted. int amt = 0; for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) amt++; } Along with this, the base X and base Y of each of the region can be calculated: for(int i21 = (player.getLocation().getRegionX() - 6) / 8; i21 <= (player.getLocation().getRegionX() + 6) / 8; i21++) { for(int k23 = (player.getLocation().getRegionY() - 6) / 8; k23 <= (player.getLocation().getRegionY() + 6) / 8; k23++) System.out.println(i21+" X "+(i21 << 6)+","+k23+" Y "+(k23 << 6));;; } The 'X' and 'Y' coordinates represents the coordinates of the region as depicted in the diagram. After the regions are loaded they are trimmed to the tiles that are necessary. Well hope this gave you some idea of how regions are loaded and such, tell me if you need explanation on anything. Heres an example of a location class that I wrote, sorry for the lack of comments. If you read everything then this should make sense: package net.forge.content.world.node; /** * RuneForge | 317 * Location.java * @version 1.0.0 * @author SiniSoul (SiniSoul@live.com) */ public final class Location { /** * The Tile X and Y coordinates. */ private int tilex = 0, tiley = 0; /** * The Height of the location. */ private int height = 0; /** * The asynchronous Chunk X and Y coordinates; used in region updating. */ private int chunkx = 0, chunky = 0; /** * * @param tilex */ public void setTileX(int tilex) { this.tilex = (tilex & 0xFFFF); } /** * * @return */ public int getTileX() { return tilex; } /** * * @param tilex */ public void setTileY(int tiley) { this.tiley = (tiley & 0xFFFF); } /** * * @return */ public int getTileY() { return tiley; } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkX(boolean formated) { return formated ? (getTileX() >> 3) - 6 : (getTileX() >> 3); } /** * * @param formated If the chunk is formatted for map positioning or * other formatted chunk comparison. * @return */ public int calculateChunkY(boolean formated) { return formated ? (getTileY() >> 3) - 6 : (getTileY() >> 3); } /** * */ public void updateChunkX() { this.chunkx = calculateChunkX(true); } /** * */ public void updateChunkY() { this.chunkx = calculateChunkY(true); } /** * * @return */ public int getChunkX() { return chunkx; } /** * * @return */ public int getMapLocalX() { return getTileX() - (getChunkX() << 3); } /** * * @return */ public int getChunkY() { return chunky; } /** * * @return */ public int getMapLocalY() { return getTileX() - (getChunkY() << 3); } /** * * @param height */ public void setHeight(int height) { this.height = (height & 0x3); } /** * * @return */ public int getHeight() { return height; } /** * * @return */ public int getRegionX() { return calculateChunkX(false) >> 3; } /** * * @return */ public int getRegionLocalX() { return getTileX() - (getRegionX() << 6); } /** * * @return */ public int getRegionY() { return calculateChunkY(false) >> 3; } /** * * @return */ public int getRegionLocalY() { return getTileY() - (getRegionY() << 6); } /** * * @param tilex * @param tiley * @param height */ public void set(int tilex, int tiley, int height) { setTileX(tilex); setTileY(tiley); setHeight(height); } /** * * @param tilex * @param tiley * @param height */ public Location(int tilex, int tiley, int height) { set(tilex, tiley, height); updateChunkX(); updateChunkY(); } } 317:Mage NPC 0 2806 bgmu4a92foi0g2luoimaj96fslc86r0 3789 2015-06-08T15:24:21Z Pure 316 Created page with "{{packet|name=Mage NPC|description=Sent when a player attempts to use a magic attack on an NPC.|opcode=131|type=Fixed|length=4|revision=317}} == Mage NPC == === Packet Struct..." {{packet|name=Mage NPC|description=Sent when a player attempts to use a magic attack on an NPC.|opcode=131|type=Fixed|length=4|revision=317}} == Mage NPC == === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Non_Standard_Data_Types|Little Endian]] [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | ? |- | [[Data_Types#Standard_data_types|Short]] [[Data_Types#Non_Standard_Data_Types|Special A]] | ? |- |} 317:Player Option 0 2805 1y52umkcgt89vrg4agkhkmu2leuqbht 3788 2015-06-08T15:21:57Z Pure 316 Created page with "{{packet|name=Player Option|description=Adds an option to a player's right click context menu.|opcode=104|type=Variable|length=?|revision=317}} == Player Option == === Packet..." {{packet|name=Player Option|description=Adds an option to a player's right click context menu.|opcode=104|type=Variable|length=?|revision=317}} == Player Option == === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] C | The option position. |- | [[Data_Types#Standard_data_types|Byte]] A | Flag |- | [[Data_Types#Standard_data_types|String]] | Action text. |- |} 3791 2015-06-08T15:26:26Z Pure 316 {{packet|name=Player Option|description=Adds an option to a player's right click context menu.|opcode=104|type=Variable|length=N/A|revision=317}} == Player Option == === Packet Structure === {|border=2 ! Data Type ! Description |- | [[Data_Types#Standard_data_types|Byte]] C | The option position. |- | [[Data_Types#Standard_data_types|Byte]] A | Flag |- | [[Data_Types#Standard_data_types|String]] | Action text. |- |} Template:Packet 10 33 gzkynazo6j3ao66skjciu20k2aepp4s 145 2011-06-26T17:44:30Z Admin 1 Created page with "{| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- | colspan="2" style="background-color:#3c5;" | '''{{{name}}}'''<br/>{{{description}..." {| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1" |- | colspan="2" style="background-color:#3c5;" | '''{{{name}}}'''<br/>{{{description}}} |- ! '''Opcode''' | {{{opcode}}} |- ! '''Type''' | {{{type}}} |- ! '''Length''' | {{{length}}} |- |} <includeonly> [[Category:Packet]] [[Category:Packet:{{{revision}}}]] </includeonly>