eq2go/old/common/opcodes/opcodes.hpp
2025-08-06 19:00:30 -05:00

35 lines
1.6 KiB
C++

// Copyright (C) 2007 EQ2EMulator Development Team - GPL v3 License
#pragma once
// Network protocol operation codes for EQ2Emulator session management
// These constants define the packet types used in the custom UDP protocol
// Session establishment and management opcodes
static const char OP_SessionRequest = 0x01; // Initial connection request from client
static const char OP_SessionResponse = 0x02; // Server response to session request
static const char OP_SessionDisconnect = 0x05; // Clean session termination
static const char OP_SessionStatResponse = 0x08; // Session statistics response
static const char OP_OutOfSession = 0x1d; // Packet received outside valid session
// Data transmission opcodes
static const char OP_Combined = 0x03; // Multiple packets combined into single transmission
static const char OP_Packet = 0x09; // Standard data packet
static const char OP_Fragment = 0x0d; // Large packet fragmented for transmission
static const char OP_AppCombined = 0x19; // Application-level combined packets
// Connection maintenance opcodes
static const char OP_KeepAlive = 0x06; // Heartbeat to maintain connection
static const char OP_ServerKeyRequest = 0x07; // Request for server encryption key
// Acknowledgment and ordering opcodes
static const char OP_Ack = 0x15; // Standard packet acknowledgment
static const char OP_OutOfOrderAck = 0x11; // Acknowledgment for out-of-sequence packet
// Application opcode size configuration
// LOGIN and CHAT servers use 1-byte opcodes, game servers use 2-byte opcodes
#if defined(LOGIN) || defined(CHAT)
#define APP_OPCODE_SIZE 1
#else
#define APP_OPCODE_SIZE 2
#endif