[[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. |}