_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
Go to the documentation of this file.
47 #define NetPlayerNameSize 16
49 #define MaxNetworkCommands 9
58 size_t Serialize(
unsigned char *buf)
const;
111 size_t Serialize(
unsigned char *p)
const;
209 unsigned char GetType()
const {
return type; }
212 size_t Serialize(
unsigned char *p)
const;
214 static size_t Size() {
return 2; }
217 unsigned char subtype;
431 size_t Serialize(
unsigned char *buf)
const;
433 static size_t Size() {
return 2 + 2 + 2 + 2; }
450 size_t Serialize(
unsigned char *buf)
const;
452 static size_t Size() {
return 1 + 1 + 2 + 2 + 2; }
467 size_t Serialize(
unsigned char *buf)
const;
482 size_t Serialize(
unsigned char *buf)
const;
484 static size_t Size() {
return 4 + 4; };
498 size_t Serialize(
unsigned char *buf)
const;
500 static size_t Size() {
return 2; };
514 size_t Serialize(
unsigned char *buf)
const;
538 size_t Serialize(
unsigned char *buf)
const;
555 size_t Serialize(
unsigned char *buf,
int numcommands)
const;
556 void Deserialize(
const unsigned char *buf,
unsigned int len,
int *numcommands);
557 size_t Size(
int numcommands)
const;
565 #endif // !NET_MESSAGE_H
char set_Inside(char v)
Definition: net_message.h:152
Definition: net_message.h:266
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:421
std::vector< uint16_t > Units
Definition: net_message.h:520
@ MessageCommandTrain
Unit command return goods.
Definition: net_message.h:396
@ MessageCommandResearch
Unit command cancel upgrade.
Definition: net_message.h:400
const unsigned char * Serialize() const
Definition: net_message.cpp:464
char PlyName[NetPlayerNameSize]
Definition: net_message.h:232
@ MessageCommandCancelResearch
Unit command research.
Definition: net_message.h:401
@ MessageCommandPatrol
Unit command attack ground.
Definition: net_message.h:387
@ ICMServerQuit
Ack StateInfo change.
Definition: net_message.h:188
static size_t Size()
Definition: net_message.h:61
@ ExtendedMessageSharedVision
Change diplomacy.
Definition: net_message.h:414
Definition: net_message.h:425
@ ICMMapNeeded
Client answers I am here.
Definition: net_message.h:197
uint16_t DataSize
Definition: net_message.h:328
Definition: net_message.h:80
char get_UnitsOption()
Definition: net_message.h:142
char get_Opponents()
Definition: net_message.h:148
int8_t & operator[](int idx)
Definition: net_message.h:83
@ MessageCommandCancelUpgrade
Unit command upgrade.
Definition: net_message.h:399
CServerSetup()
Definition: net_message.h:110
GameTypes GameType
Terrain type (summer,winter,...)
Definition: settings.h:242
char set_UnitsOption(char v)
Definition: net_message.h:150
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:392
uint32_t Host
Definition: net_message.h:67
@ MessageCommandResource
Unit command resource location.
Definition: net_message.h:394
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:270
@ MessageCommandAttack
Unit command autorepair.
Definition: net_message.h:385
@ ICMHello
Definition: net_message.h:172
@ ICMEngineMismatch
Setup message configure clients.
Definition: net_message.h:175
uint16_t X
Command for unit.
Definition: net_message.h:437
CInitMessage_MapFileFragment()
Definition: net_message.h:316
int32_t Stratagus
Definition: net_message.h:263
@ ExtendedMessageMapFieldsOpacityDB
Change field of view type (shadow casting or radial). Used for debug purposes.
Definition: net_message.h:417
_ic_message_subtype_
Definition: net_message.h:171
Definition: net_message.h:297
uint8_t ExtendedType
Definition: net_message.h:454
@ ExtendedMessageFieldOfViewDB
Change Auto targetting algorithm. Used for debug purposes.
Definition: net_message.h:416
void Deserialize(const unsigned char *buf, unsigned int len, int *numcommands)
Definition: net_message.cpp:818
CNetworkExtendedCommand()
Definition: net_message.h:448
@ MessageCommandGround
Unit command attack.
Definition: net_message.h:386
@ MessageCommandBoard
Unit command patrol.
Definition: net_message.h:388
CServerSetup State
Definition: net_message.h:344
int8_t Difficulty
Preset # of ai-opponents.
Definition: settings.h:241
MapRevealModes RevealMap
Which field of view is used - important to be shared for unit sight.
Definition: settings.h:244
void Clear()
Definition: net_message.cpp:222
char PlyName[NetPlayerNameSize]
Player number.
Definition: net_message.h:70
Definition: net_message.h:478
ENUM_CLASS GameTypes
Definition: settings.h:184
uint16_t Arg2
Argument 1.
Definition: net_message.h:456
@ MessageInit_FromClient
When Nothing Is Happening.
Definition: net_message.h:368
_extended_message_type_
Definition: net_message.h:412
Definition: net_message.h:237
CInitMessage_EngineMismatch()
Definition: net_message.cpp:405
static size_t Size()
Definition: net_message.h:354
static size_t Size()
Definition: net_message.h:228
const unsigned char * Serialize() const
Definition: net_message.cpp:544
bool operator!=(const CServerSetup &rhs) const
Definition: net_message.h:132
@ MessageInit_FromServer
Start connection.
Definition: net_message.h:369
static size_t Size()
Definition: net_message.h:484
@ MessageChat
Resend message.
Definition: net_message.h:376
SettingsPresets * p
Definition: net_message.h:85
char get_ResourcesOption()
Client ready state.
Definition: net_message.h:141
static size_t Size()
Definition: net_message.h:340
std::string Text
Definition: net_message.h:472
char set_Opponents(char v)
Definition: net_message.h:156
@ ExtendedMessageRevealMapDB
Change opaque flag for forest, rocks or walls. Used for debug purposes.
Definition: net_message.h:418
@ MessageQuit
Update a Selection from Team Player.
Definition: net_message.h:373
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:351
const unsigned char * Serialize() const
Definition: net_message.cpp:437
uint8_t Ready[PlayerMax]
Free slot option selection {"Available", "Computer", "Closed" }.
Definition: net_message.h:136
static size_t Size()
Definition: net_message.h:287
Definition: net_message.h:252
bool operator==(const CServerSetup &rhs) const
Definition: net_message.cpp:311
void SetName(const char *name)
Definition: net_message.cpp:230
uint16_t Arg4
Argument 3.
Definition: net_message.h:458
char get_FogOfWar()
Definition: net_message.h:143
int8_t Race
AI script for computer to use.
Definition: settings.h:136
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:720
int32_t gameCyclesPerUpdate
Lag time.
Definition: net_message.h:294
ENUM_CLASS SlotOption
Definition: net_message.h:74
@ MessageCommandMove
Unit command follow.
Definition: net_message.h:382
char set_FogOfWar(char v)
Definition: net_message.h:151
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:586
static size_t Size()
Definition: net_message.h:113
@ MessageSync
Connection reply.
Definition: net_message.h:371
@ MessageCommandStand
Unit command stop.
Definition: net_message.h:379
const unsigned char * Serialize() const
Definition: net_message.cpp:576
CInitMessage_Map()
Definition: net_message.h:300
@ ICMGameFull
MAP UID doesn't match.
Definition: net_message.h:180
@ MessageCommandRepair
Unit command move.
Definition: net_message.h:383
@ MessageCommandCancelTrain
Unit command train.
Definition: net_message.h:397
Definition: net_message.h:445
char get_Inside()
Definition: net_message.h:144
size_t Size(int numcommands) const
Definition: net_message.cpp:831
@ MessageCommandSpellCast
Command is the next byte.
Definition: net_message.h:406
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:362
int8_t Opponents
Preset # of units.
Definition: settings.h:240
char get_RevealMap()
Definition: net_message.h:145
uint16_t NetHostSlot
Participants information.
Definition: net_message.h:292
int32_t Stratagus
Name of player.
Definition: net_message.h:233
ServerSetupStateRacesArray()
Definition: net_message.h:82
char set_RevealMap(char v)
Definition: net_message.h:153
CNetworkHost()
Definition: net_message.h:57
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:284
CNetworkPacketHeader Header
Definition: net_message.h:559
Definition: net_message.h:280
const unsigned char * Serialize() const
Definition: net_message.cpp:411
uint16_t Arg3
Argument 2.
Definition: net_message.h:457
@ MessageExtendedCommand
Unit command cancel research.
Definition: net_message.h:403
Definition: net_message.h:552
Definition: net_message.h:509
static size_t Size()
Definition: net_message.h:322
static size_t Size()
Definition: net_message.h:259
static size_t Size()
Definition: net_message.h:433
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:337
@ MessageCommandAutoRepair
Unit command repair.
Definition: net_message.h:384
uint16_t PlyNr
Port on host.
Definition: net_message.h:69
Definition: net_message.h:464
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:682
SettingsPresets Presets[PlayerMax]
Multiplayer or single player.
Definition: settings.h:235
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:649
@ MessageCommandReturn
Unit command resource.
Definition: net_message.h:395
ENUM_CLASS Computer
Definition: net_message.h:75
constexpr unsigned char PlayerMax
Definition: settings.h:62
uint32_t FragmentIndex
Definition: net_message.h:329
Definition: net_message.h:54
const unsigned char * Serialize() const
Definition: net_message.cpp:379
@ ICMEngineConfMismatch
Network protocol version doesn't match.
Definition: net_message.h:177
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:512
char Data[384]
Definition: net_message.h:326
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:660
@ ICMAYT
Client is ready to run.
Definition: net_message.h:194
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:635
CNetworkCommand()
Definition: net_message.h:428
unsigned NoFogOfWar
Definition: settings.h:248
@ MessageCommandFollow
Unit command defend.
Definition: net_message.h:381
CInitMessage_State()
Definition: net_message.h:335
CNetworkCommandSync()
Definition: net_message.h:481
ENUM_CLASS MapRevealModes
Definition: settings.h:209
Settings ServerGameSettings
Definition: net_message.h:134
static size_t Size()
Definition: net_message.h:244
@ MessageResend
Quit game.
Definition: net_message.h:374
uint8_t clientIndex
Definition: net_message.h:248
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:708
Definition: net_message.h:494
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:225
uint16_t Dest
Map position Y.
Definition: net_message.h:439
std::vector< unsigned char > Command[MaxNetworkCommands]
Packet Header Info.
Definition: net_message.h:560
@ MessageCommandDismiss
Unit command explore.
Definition: net_message.h:392
uint16_t Unit
Definition: net_message.h:436
static size_t Size()
Definition: net_message.h:273
@ ICMWelcome
No player slots available.
Definition: net_message.h:181
int8_t & operator[](int idx) const
Definition: net_message.h:84
Definition: net_message.h:220
CInitMessage_LuaFilesMismatch()
Definition: net_message.cpp:431
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:557
Definition: settings.h:230
static size_t Size()
Definition: net_message.h:452
unsigned Inside
if dynamic fog of war is disabled
Definition: settings.h:249
@ ICMWaiting
Acknowledge for new client connections.
Definition: net_message.h:183
char get_Difficulty()
Definition: net_message.h:147
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:211
char set_ResourcesOption(char v)
Definition: net_message.h:149
ServerSetupStateRacesArray racesArray
Definition: net_message.h:158
@ MessageNone
Definition: net_message.h:367
size_t Size() const
Definition: net_message.cpp:689
uint32_t MapUID
Definition: net_message.h:310
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:479
@ ExtendedMessageAutoTargetingDB
Change shared vision.
Definition: net_message.h:415
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:727
@ MessageCommandBuild
Unit command unload.
Definition: net_message.h:390
uint8_t Arg1
Extended network command type.
Definition: net_message.h:455
uint16_t Y
Map position X.
Definition: net_message.h:438
uint32_t syncSeed
Definition: net_message.h:484
const unsigned char * Serialize() const
Definition: net_message.cpp:501
@ ICMGoodBye
Server has quit game.
Definition: net_message.h:189
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:319
CInitMessage_Hello()
Definition: net_message.h:223
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:675
CNetworkHost hosts[PlayerMax]
index of the receiving client in the compacted host array
Definition: net_message.h:249
@ ICMLuaFilesMismatch
Stratagus engine version doesn't match.
Definition: net_message.h:176
ServerSetupStateRacesArray * get_Race()
Definition: net_message.h:159
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:744
ENUM_CLASS Closed
Definition: net_message.h:77
size_t Deserialize(const unsigned char *buf)
Definition: net_message.cpp:756
int8_t Resources
Definition: settings.h:238
#define MaxNetworkCommands
Definition: net_message.h:49
@ MessageSelection
Heart beat.
Definition: net_message.h:372
CNetworkSelection()
Definition: net_message.h:512
@ ICMIAH
Server asks are you there.
Definition: net_message.h:195
int32_t Lag
slot for the receiving host in the server host array
Definition: net_message.h:293
@ MessageCommandStop
Chat message.
Definition: net_message.h:378
@ ICMMapUidMismatch
UNUSED:Engine configuration isn't identical.
Definition: net_message.h:178
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:256
@ ICMGo
Client has left game.
Definition: net_message.h:192
char get_GameTypeOption()
Definition: net_message.h:146
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:447
size_t Deserialize(const unsigned char *p)
Definition: net_message.cpp:272
CInitMessage_Resync()
Definition: net_message.cpp:596
@ ExtendedMessageDiplomacy
Definition: net_message.h:413
int8_t NumUnits
Preset resource factor.
Definition: settings.h:239
_message_type_
Definition: net_message.h:366
size_t Size() const
Definition: net_message.cpp:770
Definition: settings.h:133
char set_GameTypeOption(char v)
Definition: net_message.h:154
size_t Serialize(unsigned char *p) const
Definition: net_message.cpp:239
CInitMessage_Welcome()
Definition: net_message.cpp:457
uint16_t player
Definition: net_message.h:519
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:700
@ MessageCommandExplore
Unit command build building.
Definition: net_message.h:391
char set_Difficulty(char v)
Definition: net_message.h:155
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:199
@ MessageCommandResourceLoc
Unit command dismiss unit.
Definition: net_message.h:393
Definition: net_message.h:332
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:241
const unsigned char * Serialize() const
Definition: net_message.cpp:601
CNetworkHost hosts[PlayerMax]
Definition: net_message.h:291
uint16_t Port
Host address.
Definition: net_message.h:68
Definition: net_message.h:347
void Clear()
Definition: net_message.cpp:304
void Clear()
Definition: net_message.h:429
uint16_t player
Definition: net_message.h:500
static size_t Size()
Definition: net_message.h:500
#define NetPlayerNameSize
Definition: net_message.h:47
const unsigned char * Serialize() const
Definition: net_message.cpp:350
SlotOption CompOpt[PlayerMax]
Definition: net_message.h:135
@ ICMMap
Client has received Welcome and is waiting for Map/State.
Definition: net_message.h:184
@ ICMState
MapInfo (and Mapinfo Ack)
Definition: net_message.h:185
@ ICMResync
StateInfo.
Definition: net_message.h:186
CInitMessage_Config()
Definition: net_message.cpp:374
size_t Serialize(unsigned char *buf) const
Definition: net_message.cpp:625
Definition: net_message.h:313
CNetworkHost hosts[PlayerMax]
Definition: net_message.h:358
const CInitMessage_Header & GetHeader() const
Definition: net_message.h:302
@ MessageCommandUpgrade
Unit command cancel training.
Definition: net_message.h:398
@ ICMConfig
Client Request.
Definition: net_message.h:173
bool IsValid()
Definition: net_message.h:65
CNetworkCommandQuit()
Definition: net_message.h:497
static size_t Size()
Definition: net_message.h:305
char MapPath[256]
Definition: net_message.h:309
@ ExtendedMessageFogOfWarDB
Change map reveal mode. Used for debug purposes.
Definition: net_message.h:419
Definition: net_message.h:107
uint32_t Version
Stratagus engine version.
Definition: net_message.h:234
#define ENUM_CLASS
Definition: settings.h:53
@ ICMSeeYou
Client wants to leave game.
Definition: net_message.h:190
@ MessageCommandUnload
Unit command board.
Definition: net_message.h:389
uint32_t syncHash
Definition: net_message.h:488
uint8_t PathSize
Definition: net_message.h:327
@ MessageCommandDefend
Unit command stand ground.
Definition: net_message.h:380
size_t Serialize(unsigned char *buf, int numcommands) const
Definition: net_message.cpp:807
uint32_t Version
Definition: net_message.h:277
void Deserialize(const unsigned char *p)
Definition: net_message.cpp:613
(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.