_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CServerSetup Class Reference

#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)
 
ServerSetupStateRacesArrayget_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CServerSetup()

CServerSetup::CServerSetup ( )
inline

Member Function Documentation

◆ Clear()

void CServerSetup::Clear ( )

◆ Deserialize()

size_t CServerSetup::Deserialize ( const unsigned char *  p)

◆ get_Difficulty()

char CServerSetup::get_Difficulty ( )
inline

◆ get_FogOfWar()

char CServerSetup::get_FogOfWar ( )
inline

◆ get_GameTypeOption()

char CServerSetup::get_GameTypeOption ( )
inline

◆ get_Inside()

char CServerSetup::get_Inside ( )
inline

◆ get_Opponents()

char CServerSetup::get_Opponents ( )
inline

◆ get_Race()

ServerSetupStateRacesArray* CServerSetup::get_Race ( )
inline

◆ get_ResourcesOption()

char CServerSetup::get_ResourcesOption ( )
inline

Client ready state.

◆ get_RevealMap()

char CServerSetup::get_RevealMap ( )
inline

◆ get_UnitsOption()

char CServerSetup::get_UnitsOption ( )
inline

◆ operator!=()

bool CServerSetup::operator!= ( const CServerSetup rhs) const
inline

◆ operator==()

bool CServerSetup::operator== ( const CServerSetup rhs) const

◆ Serialize()

size_t CServerSetup::Serialize ( unsigned char *  p) const

◆ set_Difficulty()

char CServerSetup::set_Difficulty ( char  v)
inline

◆ set_FogOfWar()

char CServerSetup::set_FogOfWar ( char  v)
inline

◆ set_GameTypeOption()

char CServerSetup::set_GameTypeOption ( char  v)
inline

◆ set_Inside()

char CServerSetup::set_Inside ( char  v)
inline

◆ set_Opponents()

char CServerSetup::set_Opponents ( char  v)
inline

◆ set_ResourcesOption()

char CServerSetup::set_ResourcesOption ( char  v)
inline

◆ set_RevealMap()

char CServerSetup::set_RevealMap ( char  v)
inline

◆ set_UnitsOption()

char CServerSetup::set_UnitsOption ( char  v)
inline

◆ Size()

static size_t CServerSetup::Size ( )
inlinestatic

Member Data Documentation

◆ CompOpt

SlotOption CServerSetup::CompOpt[PlayerMax]

◆ racesArray

ServerSetupStateRacesArray CServerSetup::racesArray

◆ Ready

uint8_t CServerSetup::Ready[PlayerMax]

Free slot option selection {"Available", "Computer", "Closed" }.

◆ ServerGameSettings

Settings CServerSetup::ServerGameSettings

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.