User Tools

Site Tools


hosting:netpackets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hosting:netpackets [2025/12/03 23:09] blamedennyhosting:netpackets [2025/12/05 15:37] (current) – whoops blamedenny
Line 1: Line 1:
 ===== Network packets ===== ===== Network packets =====
 ---- ----
-<box 60% orange>FIXME **- Needs additional information on whatever client sends on net packet types 3, 4, 5 and 6.**</box> 
  
-**Network packets** are a way of contacting to the host or client via sending or receiving data. The amount of defined network packets has been changing ever since the implementation of Http Dll 2.1((GameMaker 8.1 extension with better networking features.)) in [[developmenteras:bhbeta|Brick Hill Legacy Beta]].+**Network packets** are a way of contacting to the host or client via sending or receiving data. The amount of defined network packets has been changing ever since the implementation of Http Dll 2.1((GameMaker 8.1 extension with better networking features.)) in [[developmenteras:bhbeta|Brick Hill Legacy Beta]]. This article is about the latest [[developmenteras:bhlegacy|Brick Hill Legacy]] network packets.
  
-**The table will be updated.**+//Before you'll start implementing Brick Hill network packets: Client and Host should send the Network Packet Type ID before sending other data, listed on next tables.//
  
-==== Brick Hill Legacy (latest) Network Packets ====+==== What client receives? ====
 ---- ----
 ^ Network Packet type ^ What does the network packet contain? ^  ^ Network Packet type ^ What does the network packet contain? ^ 
-| **1** (Authentication packet, defined by Node Hill as ''Authentication'') | What **Client** sends:\\ **Token**((user's auth key)) (string)\\ **Client version** (string)\\ What **Host** sends((should be received by client)):\\  **Network ID**((object id of a ''obj_client'', assigned by Node Hill)) (32-bit integer)\\ **Brick Count** (32-bit integer)\\ **User ID**((retrieved via Brick Hill site API, hence the auth key **must be verified**)) (32-bit integer)\\  **Username** (string)\\ Are you an **admin**?((1 - true, 0 - false)) (8-bit integer)\\ **Membership type** (8-bit integer)\\ **Game ID** (32-bit integer)\\ **Game Name** (string) |  +| **1** (Authentication packet, defined by Node Hill as ''Authentication'') | **Network ID**((Object id of a ''obj_client'', assigned server-side.)) (32-bit integer)\\ **Brick Count** (32-bit integer)\\ **User ID**((Retrieved via Brick Hill site API, hence the auth key **must be verified**.)) (32-bit integer)\\  **Username** (string)\\ Are you an **admin**?((1 - true, 0 - false.)) (8-bit integer)\\ **Membership type** (8-bit integer)\\ **Game ID** (32-bit integer)\\ **Game Name** (string) |  
-| **2** (Player position Packet, defined by Node Hill as ''Position'')((Earlier: unused method of loading bricks. Exists yet commented out in the game code of latest Brick Hill Legacy Client)) | What **Client** sends:\\ **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Rotation by Z** (float int)\\ **Camera rotation by Z** (float int) | +| **3** (New player packet, client creates the ''obj_figure'' Object, defined by Node Hill as ''SendPlayers'') | **Amount of players** (8-bit integer)\\ **Network ID** (32-bit integer)\\ **Username** (string)\\ **User ID**((Retrieved via Brick Hill site API server-side.)) (32-bit integer)\\ Is new player an **admin**?((1 - true, 0 - false.)) (8-bit integer)\\ **Membership type** (8-bit integer) | 
-| **3** (New player packet, client creates the ''obj_figure'' Object, defined by Node Hill as ''SendPlayers'')| What **Host** sends:\\ **Amount of players** (8-bit integer)\\ **Network ID** (32-bit integer)\\ **Username** (string)\\ **User ID**((retrieved via Brick Hill site API on host side)) (32-bit integer)\\ Is new player an **admin**?((1 - true, 0 - false)) (8-bit integer)\\ **Membership type** (8-bit integer) | +| **4** (Client Data Packet, defined in GameMaker Client via ''packet_handler'' script; defined by Node Hill as ''Figure'')| **ID type** (string)\\ **Network ID** (32-bit integer)\\ **ID types**, defined in GameMaker client:\\ **A** - Position by X (float int)\\ **B** - Position by Y (float int)\\ **C** - Position by Z (float int)\\ **D** - ? (float int, **unused**)\\ **E** - Camera Rotation (float int, **unused**)\\ **F** - Player rotation by Z (float int)\\ **G** - Player scale by X (float int)\\ **H** - Player scale by Y (float int)\\ **I** - Player scale by Z (float int)\\ **K** - Head color (32-bit integer)\\ **L** - Torso color (32-bit integer)\\ **M** - Left Arm color (32-bit integer)\\ **N** - Right arm color (32-bit integer)\\ **O** - Left leg color (32-bit integer)\\ **P** - Right Leg color (32-bit integer)\\ **Q** - Face Item ID (string)\\ **R** - Shirt Item ID((unused, old. Same with Pants, T-Shirt)) (string)\\ **S** - Pants Item ID (string)\\ **T** - T-Shirt Item ID (string)\\ **U** - First Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **V** - Second Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **W** - Third Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **X** - Score (32-bit integer, can be negative)\\ **Y** - Team (32-bit integer)\\ \\ The next ID Types are defined by GameMaker client as **Local Changes**:\\ **1** - Walking Speed (32-bit integer)\\ **2** - Jump Height (32-bit integer)\\ **3** - Field of View (32-bit integer)\\ **4** - Camera distance (32-bit integer, can be negative)\\ **5** - Camera position by X (float int)\\ **6** - Camera position by Y (float int)\\ **7** - Camera position by Z (float int)\\ **8** - Camera rotation by X (float int)\\ **9** - Camera rotation by Y (float int)\\ **a** - Camera rotation by Z (float int)\\ **b** - Camera Type (string)\\ **c** - Camera Object (32-bit integer)\\ **e** - Health (float int)\\ **f** - Speech((bubble chat message)) (string, **limited to 500 characters**((''If this packet function didn't check the length of the chat message then hosts using Game.on('chat') could cause clients to crash by relaying very large chat messages.'')))\\ **g** - Equipped tool: **Slot ID** (32-bit integer), **Mesh UUID** (string), **Texture UUID** (string) \\ **h** - Sets ''Arm'' value to ''-1''\\ **i** - Is player alive?((1 - true, 0 - false.)) (8-bit integer)\\ \\ The next ID Types are defined by GameMaker client as **"new clothing system"**:\\ **j** - ''Clothe1'' (string)\\ **k** - ''Clothe2'' (string)\\ **l** - ''Clothe3'' (string)\\ **m** - ''Clothe4'' (string)\\ **n** - ''Clothe5'' (string)| 
-| **4** (Client Data Packet, defined in GameMaker Client via ''packet_handler'' script; defined by Node Hill as ''Figure'')| **Client** receives:\\ **ID type** (string)\\ **Network ID** (32-bit integer)\\ **ID types**, defined in GameMaker client:\\ **A** - Position by X (float int)\\ **B** - Position by Y (float int)\\ **C** - Position by Z (float int)\\ **D** - ? (float int, **unused**)\\ **E** - Camera Rotation (float int, **unused**)\\ **F** - Player rotation by Z (float int)\\ **G** - Player scale by X (float int)\\ **H** - Player scale by Y (float int)\\ **I** - Player scale by Z (float int)\\ **K** - Head color (32-bit integer)\\ **L** - Torso color (32-bit integer)\\ **M** - Left Arm color (32-bit integer)\\ **N** - Right arm color (32-bit integer)\\ **O** - Left leg color (32-bit integer)\\ **P** - Right Leg color (32-bit integer)\\ **Q** - Face Item ID (string)\\ **R** - Shirt Item ID((unused, old. Same with Pants, T-Shirt)) (string)\\ **S** - Pants Item ID (string)\\ **T** - T-Shirt Item ID (string)\\ **U** - First Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **V** - Second Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **W** - Third Equipped Hat Item ID, receives Mesh UUID (string) and Texture UUID (string)\\ **X** - Score (32-bit integer, can be negative)\\ **Y** - Team (32-bit integer)\\ \\ The next ID Types are defined by GameMaker client as **Local Changes**:\\ **1** - Walking Speed (32-bit integer)\\ **2** - Jump Height (32-bit integer)\\ **3** - Field of View (32-bit integer)\\ **4** - Camera distance (32-bit integer, can be negative)\\ **5** - Camera position by X (float int)\\ **6** - Camera position by Y (float int)\\ **7** - Camera position by Z (float int)\\ **8** - Camera rotation by X (float int)\\ **9** - Camera rotation by Y (float int)\\ **a** - Camera rotation by Z (float int)\\ **b** - Camera Type (string)\\ **c** - Camera Object (32-bit integer)\\ **e** - Health (float int)\\ **f** - Speech((bubble chat message)) (string, **limited to 500 characters**((''If this packet function didn't check the length of the chat message then hosts using Game.on('chat') could cause clients to crash by relaying very large chat messages.'' Self explanatory.)))\\ **g** - Equipped tool: **Slot ID** (32-bit integer), **Mesh UUID** (string), **Texture UUID** (string) \\ **h** - Sets ''Arm'' value to ''-1''\\ **i** - Is player alive?((1 - true, 0 - false)) (8-bit integer)\\ \\ The next ID Types are defined by GameMaker client as **"new clothing system"**:\\ **j** - ''Clothe1'' (string)\\ **k** - ''Clothe2'' (string)\\ **l** - ''Clothe3'' (string)\\ **m** - ''Clothe4'' (string)\\ **n** - ''Clothe5'' (string)| +| **5** (Remove Player Packet, defined by Node Hill as ''RemovePlayer'')| User's **Network ID** (32-bit integer) and **client** removes its ''obj_figure'' object from the game. | 
-| **5** (Remove Player Packet, defined by Node Hill as ''RemovePlayer'')| **Client** receives the user's **Network ID** (32-bit integer) and removes its ''obj_figure'' object from the game. | +|**6** (Chat Message Packet, defined by Node Hill as ''Chat'')| formed by **Host** chat **Message** (string, 500 limit)| 
-|**6** (Chat Message Packet, defined by Node Hill as ''Chat'')| **Client** receives a formed by **Host** chat **Message** (string, 500 limit)| +|**7** (Environment Data, GUI; defined by Node Hill as ''PlayerModification'') | **Data Type** (string):\\ ''topPrint'' - Top Text: **Message** (string), **Time** (32-bit integer)\\ ''centerPrint'' - Middle Text: **Message** (string), **Time** (32-bit integer)\\ ''bottomPrint'' - Bottom Text: **Message** (string), **Time** (32-bit integer)\\ ''Ambient'' - Ambient color (32-bit integer)\\ ''Sky'' - Sky color (32-bit integer)\\ ''BaseCol'' - Baseplate color (32-bit integer)\\ ''BaseSize'' - Baseplate size (32-bit integer)\\ ''Sun'' - Sun intensity (32-bit integer)\\ ''kick'' - Kicks the client((This will become a vulnerability if the player socket will not be destroyed by Host itself.))\\ ''prompt'' - Prompt message (string)\\ ''WeatherSnow'' - Sets the weather to ''snow''\\ ''WeatherRain'' - Sets the weather to ''rain''\\ ''WeatherSun'' - Sets the weather to ''sun''\\ ''TweakDisableFigureCulling'' - Disables the Figure culling option\\ ''TweakDisableLighting'' - Disables lighting\\ ''TweakRaySpacing'' - ? (float int)\\ ''MoreClickInfo'' - enables more information on click (8-bit integer)| 
-|**7** (Environment Data, GUI; defined by Node Hill as ''PlayerModification'') | What **Client** receives:\\ **Data Type** (string):\\ ''topPrint'' - Top Text: **Message** (string), **Time** (32-bit integer)\\ ''centerPrint'' - Middle Text: **Message** (string), **Time** (32-bit integer)\\ ''bottomPrint'' - Bottom Text: **Message** (string), **Time** (32-bit integer)\\ ''Ambient'' - Ambient color (32-bit integer)\\ ''Sky'' - Sky color (32-bit integer)\\ ''BaseCol'' - Baseplate color (32-bit integer)\\ ''BaseSize'' - Baseplate size (32-bit integer)\\ ''Sun'' - Sun intensity (32-bit integer)\\ ''kick'' - Kicks the client((this will become a vulnerability if the player socket will not be destroyed by **Host** itself))\\ ''prompt'' - Prompt message (string)\\ ''WeatherSnow'' - Sets the weather to ''snow''\\ ''WeatherRain'' - Sets the weather to ''rain''\\ ''WeatherSun'' - Sets the weather to ''sun''\\ ''TweakDisableFigureCulling'' - Disables the Figure culling option\\ ''TweakDisableLighting'' - Disables lighting\\ ''TweakRaySpacing'' - ? (float int)\\ ''MoreClickInfo'' - enables more information on click (8-bit integer)| +|**8** (Kill Packet, defined by Node Hill as ''Kill'')| User's **Network ID** (32-bit integer), then **client** sets the ''alive'' variable to ''0'' to its corresponding ''obj_figure'' object.| 
-|**8** (Kill Packet, defined by Node Hill as ''Kill'')| **Client** receives the user's **Network ID** (32-bit integer) and sets the ''alive'' variable to ''0'' to its corresponding ''obj_figure'' object.| +|**9** (Brick Modification Packet, defined by Node Hill as ''Brick'')| The ''obj_brick'''s **Network ID** (32-bit integer)\\ Type of **Modification** (string).\\ Brick Modifications:\\ ''pos''((Changes brick position.)) - **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ ''rot''((Changes brick rotation by Z.)) - **Rotation by Z** (float int)\\ ''scale''((Changes the scale of brick.)) - **Scale by X** (float int)\\ **Scale by Y** (float int)\\ **Scale by Z** (float int)\\ ''kill''((Unanchors the brick.)) - Time until destruction (32-bit integer)\\ ''destroy'' - Removes the brick\\ ''col''((Changes the brick color.)) - Color (32-bit integer)\\ ''alpha''((Changes the brick's transparency.)) - Alpha (float int)\\ ''lightcol''((Changes the light color.)) - Color (32-bit integer)\\ ''lightrange''((Changes the light range.)) - Range (32-bit integer)\\ ''model''((Sets the custom model to brick.)) - Mesh UUID (string)\\ Texture UUID (string)\\ ''collide''((Changes the brick collision.)) - Collision state (8-bit integer)\\ ''clickable''((Changes the click state and distance for a brick.)) - Clickable state (8-bit integer)\\ Clickable distance (32-bit integer)\\ ''global'' - ?\\ ''ignoreLight''((Logically, this should ignore the light, Client source code got its option commented out (was supposed to support 8-bit integer))) - makes ''ignoreLight'' variable true\\ | 
-|**9** (Brick Modification Packet, defined by Node Hill as ''Brick'')| **Client** receives the ''obj_brick'''s **Network ID** (32-bit integer) and the type of **Modification** (string).\\ Brick Modifications:\\ ''pos''((Changes brick position)) - **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ ''rot''((Changes brick rotation by Z)) - **Rotation by Z** (float int)\\ ''scale''((Changes the scale of brick)) - **Scale by X** (float int)\\ **Scale by Y** (float int)\\ **Scale by Z** (float int)\\ ''kill''((Unanchors the brick)) - Time until destruction (32-bit integer)\\ ''destroy'' - Removes the brick\\ ''col''((Changes the brick color)) - Color (32-bit integer)\\ ''alpha''((Changes the brick's transparency)) - Alpha (float int)\\ ''lightcol''((Changes the light color)) - Color (32-bit integer)\\ ''lightrange''((Changes the light range)) - Range (32-bit integer)\\ ''model''((Sets the custom model to brick)) - Mesh UUID (string)\\ Texture UUID (string)\\ ''collide''((Changes the brick collision)) - Collision state (8-bit integer)\\ ''clickable''((Changes the click state and distance for a brick)) - Clickable state (8-bit integer)\\ Clickable distance (32-bit integer)\\ ''global'' - ?\\ ''ignoreLight''((Logically, this should ignore the light, Client source code got its option commented out (was supposed to support 8-bit integer) )) - makes ''ignoreLight'' variable true\\ | +|**10** (New team packet, defined by Node Hill as ''Team'')| **Team ID** (32-bit integer)\\ **Name** (string)\\ **Color** (32-bit integer) | 
-|**10** (New team packet, defined by Node Hill as ''Team'')| **Client** receives:\\ **Team ID** (32-bit integer)\\ **Name** (string)\\ **Color** (32-bit integer) | +|**11** (New tool packet, defined by Node Hill as ''Tool'')| **Active state** (8-bit integer)\\ **Slot ID** (32-bit integer)\\ **Name** (string)| 
-|**11** (New tool packet, defined by Node Hill as ''Tool'')| **Client** receives:\\ **Active state** (8-bit integer)\\ **Slot ID** (32-bit integer)\\ **Name** (string)| +|**12** (Bot Data packet, defined in GameMaker Client via ''packet_handler_figure'' script; defined by Node Hill as ''Bot'')| **String ID** (string)\\ **Figure ID** (32-bit integer)\\ Regarding the ''packet_handler_figure'' Script: It generally contains the same information as ''packet_handler'' Script, except it does not need Local Changes. | 
-|**12** (Bot Data packet, defined in GameMaker Client via ''packet_handler_figure'' script; defined by Node Hill as ''Bot'')| **Client** receives:\\ **String ID** (string)\\ **Figure ID** (32-bit integer)\\ Regarding the ''packet_handler_figure'' Script: It generally contains the same information as ''packet_handler'' Script, except it does not need Local Changes. | +|**13** (New Projectile Packet, defined by Node Hill as ''Projectile'')| **Active state** (8-bit integer)\\ **Projectile ID** (32-bit integer)\\ **Diameter** (32-bit integer)\\ **Color** (32-bit integer)\\ **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Direction** (32-bit integer)\\ **Direction by Z** (32-bit integer)\\ **Velocity** (32-bit integer)|
-|**13** (New Projectile Packet, defined by Node Hill as ''Projectile'')| **Client** receives:\\ **Active state** (8-bit integer)\\ **Projectile ID** (32-bit integer)\\ **Diameter** (32-bit integer)\\ **Color** (32-bit integer)\\ **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Direction** (32-bit integer)\\ **Direction by Z** (32-bit integer)\\ **Velocity** (32-bit integer)|+
 |**14** (Clear Map Packet, defined by Node Hill as ''ClearMap'')| **Client** removes all the bricks after it has received this packet| |**14** (Clear Map Packet, defined by Node Hill as ''ClearMap'')| **Client** removes all the bricks after it has received this packet|
-|**15** (Remove Bot packet, defined by Node Hill as ''DestroyBot'')|**Client** receives the **Figure ID** (32-bit integer) and removes the bot by its **Network ID**|+|**15** (Remove Bot packet, defined by Node Hill as ''DestroyBot'')| **Figure ID** (32-bit integer), then client removes the bot by its **Network ID**|
 |**16** (Remove Brick packet, defined by Node Hill as ''DeleteBrick'')|**Client** receives the **Brick ID** (32-bit integer) and removes the brick by its ID.| |**16** (Remove Brick packet, defined by Node Hill as ''DeleteBrick'')|**Client** receives the **Brick ID** (32-bit integer) and removes the brick by its ID.|
-|**17** (''SendBrick'' Packet, Node Hill definition)| What **client** receives:\\ **Network ID** (32-bit integer)\\ **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Scale by X** (float int)\\ **Scale by Y** (float int)\\ **Scale by Z** (float int)\\ **Color** (32-bit integer)\\ **Transparency** (float int) | +|**17** (''SendBrick'' Packet, Node Hill definition)| **Network ID** (32-bit integer)\\ **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Scale by X** (float int)\\ **Scale by Y** (float int)\\ **Scale by Z** (float int)\\ **Color** (32-bit integer)\\ **Transparency** (float int) | 
-|**18** (''Heartbeat'' packetsent in Brick Hill Legacy Client via ''update_delta'' script) | What **Client** sends:\\ **Type ID** (''18'')\\ **Message** (sent via ''socket_write_message''((Http Dll 2.1 citation: ''Sends a message. A message is sent by first sending the size of the message (as uintv), followed by the actual message data. This is handled automatically by the DLL, you don't need to do anything special if the receiver also uses Http Dll 2.'')) )|+ 
 + 
 +==== What client sends? ==== 
 + 
 +^ Network Packet type ^ What does the network packet contain? ^  
 +| **1** (Authentication packet, defined by Node Hill as ''Authentication'') | **Token**((User's authentication key.)) (string)\\ **Client version** (string) |  
 +| **2** (Player position Packetdefined by Node Hill as ''Position'')((Earlier: unused method of loading bricks. Exists yet commented out in the game code of latest Brick Hill Legacy Client.)) | **Position by X** (float int)\\ **Position by Y** (float int)\\ **Position by Z** (float int)\\ **Rotation by Z** (float int)\\ **Camera rotation by Z** (float int) | 
 +|**3** (''Command'' Packet)| **Command** (via ''/'', string) | 
 +|**4** (''Projectile'' Packet)((Node Hill does not have an implementation for this packet (it's empty). )) | The projectile **ID**, the client has made a collision with (32-bit integer) \\ It's own **Network ID** (32-bit integer) | 
 +|**5** (''ClickDetection'' Packet) | Brick **Network ID** (32-bit integer) | 
 +|**6** (''PlayerInput'' Packet) | **Mouse click** (8-bit integer)\\ **Current Keyboard Key** (string) | 
 +|**18** (''Heartbeat'' packet, sent in Brick Hill Legacy Client via ''update_delta'' script)((The client should send this packet constantly **(every 10 seconds)**. )) | **Message** (sent via ''socket_write_message''((Http Dll 2.1 citation: ''Sends a message. A message is sent by first sending the size of the message (as uintv), followed by the actual message data. This is handled automatically by the DLL, you don't need to do anything special if the receiver also uses Http Dll 2.''.)) )| 
 + 
 +=== Notes ===
hosting/netpackets.1764799776.txt.gz · Last modified: by blamedenny