Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetMessages.h
Show All 22 Lines | |||||
#ifndef NETMESSAGES_H | #ifndef NETMESSAGES_H | ||||
#define NETMESSAGES_H | #define NETMESSAGES_H | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "scriptinterface/ScriptVal.h" | #include "scriptinterface/ScriptVal.h" | ||||
#define PS_PROTOCOL_MAGIC 0x5073013f // 'P', 's', 0x01, '?' | #define PS_PROTOCOL_MAGIC 0x5073013f // 'P', 's', 0x01, '?' | ||||
#define PS_PROTOCOL_MAGIC_RESPONSE 0x50630121 // 'P', 'c', 0x01, '!' | #define PS_PROTOCOL_MAGIC_RESPONSE 0x50630121 // 'P', 'c', 0x01, '!' | ||||
#define PS_PROTOCOL_VERSION 0x01010015 // Arbitrary protocol | #define PS_PROTOCOL_VERSION 0x01010016 // Arbitrary protocol | ||||
#define PS_DEFAULT_PORT 0x5073 // 'P', 's' | #define PS_DEFAULT_PORT 0x5073 // 'P', 's' | ||||
// Set when lobby authentication is required. Used in the SrvHandshakeResponseMessage. | // Set when lobby authentication is required. Used in the SrvHandshakeResponseMessage. | ||||
#define PS_NETWORK_FLAG_REQUIRE_LOBBYAUTH 0x1 | #define PS_NETWORK_FLAG_REQUIRE_LOBBYAUTH 0x1 | ||||
// Defines the list of message types. The order of the list must not change. | // Defines the list of message types. | ||||
// The order of the list must not change (unless the protocol version is changed). | |||||
wraitii: This is what is _actually_ meant as far as I can tell. | |||||
// The message types having a negative value are used internally and not sent | // The message types having a negative value are used internally and not sent | ||||
// over the network. The message types used for network communication have | // over the network. The message types used for network communication have | ||||
// positive values. | // positive values. | ||||
enum NetMessageType | enum NetMessageType | ||||
{ | { | ||||
NMT_CONNECT_COMPLETE = -256, | NMT_CONNECT_COMPLETE = -256, | ||||
NMT_CONNECTION_LOST, | NMT_CONNECTION_LOST, | ||||
NMT_INVALID = 0, | NMT_INVALID = 0, | ||||
Show All 24 Lines | enum NetMessageType | ||||
NMT_CLIENT_TIMEOUT, | NMT_CLIENT_TIMEOUT, | ||||
NMT_CLIENT_PERFORMANCE, | NMT_CLIENT_PERFORMANCE, | ||||
NMT_CLIENTS_LOADING, | NMT_CLIENTS_LOADING, | ||||
NMT_CLIENT_PAUSED, | NMT_CLIENT_PAUSED, | ||||
NMT_LOADED_GAME, | NMT_LOADED_GAME, | ||||
NMT_GAME_START, | NMT_GAME_START, | ||||
NMT_GAME_START_FAILED, | |||||
NMT_END_COMMAND_BATCH, | NMT_END_COMMAND_BATCH, | ||||
NMT_SYNC_CHECK, // OOS-detection hash checking | NMT_SYNC_CHECK, // OOS-detection hash checking | ||||
NMT_SYNC_ERROR, // OOS-detection error | NMT_SYNC_ERROR, // OOS-detection error | ||||
NMT_SIMULATION_COMMAND | NMT_SIMULATION_COMMAND | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | |||||
START_NMT_CLASS_(LoadedGame, NMT_LOADED_GAME) | START_NMT_CLASS_(LoadedGame, NMT_LOADED_GAME) | ||||
NMT_FIELD_INT(m_CurrentTurn, u32, 4) | NMT_FIELD_INT(m_CurrentTurn, u32, 4) | ||||
END_NMT_CLASS() | END_NMT_CLASS() | ||||
START_NMT_CLASS_(GameStart, NMT_GAME_START) | START_NMT_CLASS_(GameStart, NMT_GAME_START) | ||||
END_NMT_CLASS() | END_NMT_CLASS() | ||||
START_NMT_CLASS_(GameStartFailed, NMT_GAME_START_FAILED) | |||||
NMT_FIELD(CStr, m_Reason) | |||||
END_NMT_CLASS() | |||||
START_NMT_CLASS_(EndCommandBatch, NMT_END_COMMAND_BATCH) | START_NMT_CLASS_(EndCommandBatch, NMT_END_COMMAND_BATCH) | ||||
NMT_FIELD_INT(m_Turn, u32, 4) | NMT_FIELD_INT(m_Turn, u32, 4) | ||||
NMT_FIELD_INT(m_TurnLength, u32, 2) | NMT_FIELD_INT(m_TurnLength, u32, 2) | ||||
END_NMT_CLASS() | END_NMT_CLASS() | ||||
START_NMT_CLASS_(SyncCheck, NMT_SYNC_CHECK) | START_NMT_CLASS_(SyncCheck, NMT_SYNC_CHECK) | ||||
NMT_FIELD_INT(m_Turn, u32, 4) | NMT_FIELD_INT(m_Turn, u32, 4) | ||||
NMT_FIELD(CStr, m_Hash) | NMT_FIELD(CStr, m_Hash) | ||||
Show All 29 Lines |
Wildfire Games · Phabricator
This is what is _actually_ meant as far as I can tell.