Files
systemrevivalserver/Networking/Messages/OpCodes.cs
T
2025-11-29 16:03:00 -05:00

73 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace Server.Networking.Messages;
public static class OpCodes
{
public const int ECHO = 1;
public const int AUTH_REGISTER = 100;
public const int AUTH_REGISTER_RESULT = 101;
public const int AUTH_LOGIN = 110;
public const int AUTH_LOGIN_RESULT = 111;
public const int AUTH_WITH_TOKEN = 112;
public const int AUTH_WITH_TOKEN_RESULT = 113;
public const int ERROR = 900;
public const int CHAR_LIST = 200;
public const int CHAR_LIST_RESULT = 201;
public const int CHAR_CREATE = 202;
public const int CHAR_CREATE_RESULT = 203;
public const int CHAR_SELECT = 204;
public const int CHAR_SELECT_RESULT = 205;
public const int WORLD_SPAWN_REQUEST = 300; // client -> server (after select)
public const int WORLD_SPAWN = 301; // server -> client (your own + others joining)
public const int WORLD_DESPAWN = 302; // server -> client
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
}