From 447c6f2e23b02626af4e11fc5cf7182130caaa65 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 29 Nov 2025 16:03:00 -0500 Subject: [PATCH] OpCodes --- Networking/Messages/OpCodes.cs | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Networking/Messages/OpCodes.cs b/Networking/Messages/OpCodes.cs index a3bf5c3..9b2d61b 100644 --- a/Networking/Messages/OpCodes.cs +++ b/Networking/Messages/OpCodes.cs @@ -31,4 +31,42 @@ public static class OpCodes public const int WORLD_INPUT = 310; // client -> server (per tick or at ~20 Hz) public const int WORLD_STATE = 311; // server -> client (snapshots, ~10–20 Hz) + // ===== Lobby/Matchmaking (400-419) ===== + public const int LOBBY_JOIN = 400; + public const int LOBBY_JOIN_RESULT = 401; + public const int LOBBY_STATE = 402; // Periodic update of lobby players + public const int LOBBY_READY = 403; + public const int LOBBY_COUNTDOWN = 404; // Game starting in X seconds + public const int LOBBY_LEAVE = 405; + + // ===== Game State (420-449) ===== + public const int GAME_START = 420; // Server -> Client: Round begins + public const int GAME_STATE = 421; // Server -> Client: Full world snapshot + public const int GAME_TICK = 422; // Server -> Client: Delta update + public const int GAME_END = 423; // Server -> Client: Round over + public const int GAME_STATS = 424; // Server -> Client: End-of-round stats + + // ===== Player Input (450-469) ===== + public const int INPUT_MOVE = 450; // Client -> Server: Movement input + public const int INPUT_ACTION = 451; // Client -> Server: Use/Interact/Pickup + public const int INPUT_SHOOT = 452; // Client -> Server: Fire weapon + public const int INPUT_DROP = 453; // Client -> Server: Drop item + public const int INPUT_CRAFT = 454; // Client -> Server: Craft request + + // ===== World Events (470-499) ===== + public const int EVENT_SPAWN = 470; // Entity spawned + public const int EVENT_DESPAWN = 471; // Entity removed + public const int EVENT_DAMAGE = 472; // Damage dealt + public const int EVENT_DEATH = 473; // Player/entity died + public const int EVENT_PICKUP = 474; // Item picked up + public const int EVENT_PROJECTILE = 475; // Projectile created + public const int EVENT_EXPLOSION = 476; // Area effect + public const int EVENT_CRAFT_COMPLETE = 477; // Crafting finished + public const int EVENT_EXTRACT = 478; // Player extracted with loot + + // ===== Chat/Social (500-509) ===== + public const int CHAT_SEND = 500; + public const int CHAT_RECEIVE = 501; + public const int CHAT_PROXIMITY = 502; // Location-based chat + }