Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetMessages.h
/* Copyright (C) 2016 Wildfire Games. | /* Copyright (C) 2017 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 13 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 0x01010014 // Arbitrary protocol | #define PS_PROTOCOL_VERSION 0x01010015 // Arbitrary protocol | ||||
#define PS_DEFAULT_PORT 0x5073 // 'P', 's' | #define PS_DEFAULT_PORT 0x5073 // 'P', 's' | ||||
// 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. | ||||
// 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 | ||||
{ | { | ||||
Show All 22 Lines | enum NetMessageType | ||||
NMT_JOIN_SYNC_START, | NMT_JOIN_SYNC_START, | ||||
NMT_REJOINED, | NMT_REJOINED, | ||||
NMT_KICKED, | NMT_KICKED, | ||||
NMT_CLIENT_TIMEOUT, | NMT_CLIENT_TIMEOUT, | ||||
NMT_CLIENT_PERFORMANCE, | NMT_CLIENT_PERFORMANCE, | ||||
NMT_CLIENTS_LOADING, | |||||
NMT_CLIENT_PAUSED, | NMT_CLIENT_PAUSED, | ||||
NMT_LOADED_GAME, | NMT_LOADED_GAME, | ||||
NMT_GAME_START, | NMT_GAME_START, | ||||
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 | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
START_NMT_CLASS_(ClientPerformance, NMT_CLIENT_PERFORMANCE) | START_NMT_CLASS_(ClientPerformance, NMT_CLIENT_PERFORMANCE) | ||||
NMT_START_ARRAY(m_Clients) | NMT_START_ARRAY(m_Clients) | ||||
NMT_FIELD(CStr, m_GUID) | NMT_FIELD(CStr, m_GUID) | ||||
NMT_FIELD_INT(m_MeanRTT, u32, 4) | NMT_FIELD_INT(m_MeanRTT, u32, 4) | ||||
NMT_END_ARRAY() | NMT_END_ARRAY() | ||||
END_NMT_CLASS() | END_NMT_CLASS() | ||||
// We always send all loading client guids because we don't have to bother about switching gui pages | |||||
elexis: GUIDs
because -> so that
GUI pages
Also this isnt the best location for a comment as there are… | |||||
START_NMT_CLASS_(ClientsLoading, NMT_CLIENTS_LOADING) | |||||
NMT_START_ARRAY(m_Clients) | |||||
NMT_FIELD(CStr, m_GUID) | |||||
NMT_END_ARRAY() | |||||
END_NMT_CLASS() | |||||
START_NMT_CLASS_(ClientPaused, NMT_CLIENT_PAUSED) | START_NMT_CLASS_(ClientPaused, NMT_CLIENT_PAUSED) | ||||
NMT_FIELD(CStr, m_GUID) | NMT_FIELD(CStr, m_GUID) | ||||
NMT_FIELD_INT(m_Pause, u8, 1) | NMT_FIELD_INT(m_Pause, u8, 1) | ||||
END_NMT_CLASS() | END_NMT_CLASS() | ||||
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() | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
GUIDs
because -> so that
GUI pages
Also this isnt the best location for a comment as there are no others here.
You could move it to the place where the CClientsLoadingMessage is constructed