_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <net_message.h>
Public Member Functions | |
CServerSetup () | |
bool | operator!= (const CServerSetup &rhs) const |
char | get_ResourcesOption () |
Client ready state. More... | |
char | get_UnitsOption () |
char | get_FogOfWar () |
char | get_Inside () |
char | get_RevealMap () |
char | get_GameTypeOption () |
char | get_Difficulty () |
char | get_Opponents () |
char | set_ResourcesOption (char v) |
char | set_UnitsOption (char v) |
char | set_FogOfWar (char v) |
char | set_Inside (char v) |
char | set_RevealMap (char v) |
char | set_GameTypeOption (char v) |
char | set_Difficulty (char v) |
char | set_Opponents (char v) |
ServerSetupStateRacesArray * | get_Race () |
net_message.cpp - The network message code. | |
size_t | Serialize (unsigned char *p) const |
size_t | Deserialize (const unsigned char *p) |
void | Clear () |
bool | operator== (const CServerSetup &rhs) const |
Static Public Member Functions | |
static size_t | Size () |
Public Attributes | |
Settings | ServerGameSettings |
SlotOption | CompOpt [PlayerMax] |
uint8_t | Ready [PlayerMax] |
Free slot option selection {"Available", "Computer", "Closed" }. More... | |
ServerSetupStateRacesArray | racesArray |
Multiplayer game setup menu state.
Some words. The ServerSetupState and LocalSetupState are "kind of" kept in sync. Most ServerGameSettings are only pushed from the server to the clients, but the CServerSetup::ServerGameSettings::Presets and CServerSetup::Ready arrays are synced. The ready array is in Host-index order, that is, it corresponds to the global Hosts array. In contrast, the CServerSetup::ServerGameSettings::Presets and CServerSetup::CompOpt arrays are set up in Player-index order, that is, they corresponds to the player slots in the map definition. This is prepared in NetworkInitServerConnect.
While in the lobby, hosts, settings, presets, and ready states are synced between client and server. The CompOpt array is not touched until the server starts the game. At this point the lua scripts will call NetworkServerStartGame and then #NetworkServerPrepareGameSettings. The first will finalize the assignments of hosts to player indices and propagate that info to all clients. The second will ensure the GameSettings are copied from the ServerSettings so that all game-relevant settings are the same on all clients.
|
inline |
void CServerSetup::Clear | ( | ) |
size_t CServerSetup::Deserialize | ( | const unsigned char * | p | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Client ready state.
|
inline |
|
inline |
|
inline |
bool CServerSetup::operator== | ( | const CServerSetup & | rhs | ) | const |
size_t CServerSetup::Serialize | ( | unsigned char * | p | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
SlotOption CServerSetup::CompOpt[PlayerMax] |
ServerSetupStateRacesArray CServerSetup::racesArray |
uint8_t CServerSetup::Ready[PlayerMax] |
Free slot option selection {"Available", "Computer", "Closed" }.
Settings CServerSetup::ServerGameSettings |