1
0
Protocol/opcodes.go
2025-09-02 20:25:42 -05:00

57 lines
1.5 KiB
Go

package eq2net
// Login/chat use 1-byte opcodes
const AppOpcodeSize = 1
// The game uses 2-byte opcodes
const GameOpcodeSize = 2
// Protocol-level opcodes for the actual UDP stream
const (
OP_SessionRequest = 0x0001
OP_SessionResponse = 0x0002
OP_Combined = 0x0003
OP_SessionDisconnect = 0x0005
OP_KeepAlive = 0x0006
OP_ClientSessionUpdate = 0x0007
OP_SessionStatRequest = 0x0008
OP_SessionStatResponse = 0x0008 // Same opcode, different direction
OP_Packet = 0x0009
OP_Fragment = 0x000D
OP_OutOfOrderAck = 0x0011
OP_Ack = 0x0015
OP_AckFuture = 0x0016
OP_AckPast = 0x0017
OP_AppCombined = 0x0019
OP_OutOfSession = 0x001D
)
// Login server opcodes
const (
OP_LoginInfo = 0x0100
OP_Login2 = 0x0200
OP_GetLoginInfo = 0x0300
OP_Disconnect = 0x0500
OP_SessionId = 0x0900
OP_SendServersFragment = 0x0D00
OP_RegisterAccount = 0x2300
OP_ChangePassword = 0x4500
OP_ServerList = 0x4600
OP_SessionKey = 0x4700
OP_RequestServerStatus = 0x4800
OP_SendServerStatus = 0x4A00
OP_LoginBanner = 0x5200
OP_Version = 0x5900
)
// Common emulator opcodes (internal representation)
const (
OP_Unknown = 0x0000
OP_LoginRequestMsg = 0x0001
OP_LoginByNumRequestMsg = 0x0002
OP_WSLoginRequestMsg = 0x0003
OP_ESLoginRequestMsg = 0x0004
OP_LoginReplyMsg = 0x0005
OP_WSStatusReplyMsg = 0x0006
)