Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Enumerations | Functions | Variables
game_types.hpp File Reference
#include <string.h>

Go to the source code of this file.

Classes

struct  demoheader
 demos contain stored network messages of a game which can be replayed to review games More...
 

Macros

#define INEXOR_SERVINFO_PORT   31413
 This file contains static protocol information for the (soon to be legacy) network code. More...
 
#define INEXOR_LANINFO_PORT   31414
 
#define INEXOR_SERVER_PORT   31415
 
#define INEXOR_MASTER_PORT   31416
 
#define INEXOR_DEFAULT_MASTER   "master.inexor.org"
 
#define MAX_POSSIBLE_PORT   65535
 
#define PROTOCOL_VERSION   303
 
#define DEMO_VERSION   1
 
#define DEMO_MAGIC   "INEXOR_DEMO"
 

Enumerations

enum  { CHAN_POS = 0, CHAN_MSG, CHAN_FILE, NUM_ENET_CHANNELS }
 
enum  {
  N_CONNECT = 0, N_SERVINFO, N_WELCOME, N_INITCLIENT,
  N_POS, N_TEXT, N_SOUND, N_CDIS,
  N_SHOOT, N_EXPLODE, N_SUICIDE, N_DIED,
  N_DAMAGE, N_HITPUSH, N_SHOTFX, N_EXPLODEFX,
  N_TRYSPAWN, N_SPAWNSTATE, N_SPAWN, N_FORCEDEATH,
  N_GUNSELECT, N_TAUNT, N_FOV, N_MAPCHANGE,
  N_MAPVOTE, N_TEAMINFO, N_ITEMSPAWN, N_ITEMPICKUP,
  N_ITEMACC, N_ITEMPUSH, N_TELEPORT, N_JUMPPAD,
  N_PING, N_PONG, N_CLIENTPING, N_TIMEUP,
  N_FORCEINTERMISSION, N_SERVMSG, N_ITEMLIST, N_RESUME,
  N_EDITMODE, N_EDITENT, N_EDITF, N_EDITT,
  N_EDITM, N_FLIP, N_COPY, N_PASTE,
  N_ROTATE, N_REPLACE, N_DELCUBE, N_REMIP,
  N_EDITVSLOT, N_UNDO, N_REDO, N_NEWMAP,
  N_GETMAP, N_SENDMAP, N_CLIPBOARD, N_EDITVAR,
  N_MASTERMODE, N_KICK, N_CLEARBANS, N_CURRENTMASTER,
  N_SPECTATOR, N_SETMASTER, N_SETTEAM, N_BASES,
  N_BASEINFO, N_BASESCORE, N_REPAMMO, N_BASEREGEN,
  N_ANNOUNCE, N_LISTDEMOS, N_SENDDEMOLIST, N_GETDEMO,
  N_SENDDEMO, N_DEMOPLAYBACK, N_RECORDDEMO, N_STOPDEMO,
  N_CLEARDEMOS, N_TAKEFLAG, N_RETURNFLAG, N_RESETFLAG,
  N_INVISFLAG, N_TRYDROPFLAG, N_DROPFLAG, N_SCOREFLAG,
  N_INITFLAGS, N_SAYTEAM, N_PRIVMSG, N_HUDANNOUNCE,
  N_CLIENT, N_PAUSEGAME, N_GAMESPEED, N_PERSISTTEAMS,
  N_ADDBOT, N_DELBOT, N_INITAI, N_FROMAI,
  N_BOTLIMIT, N_BOTBALANCE, N_MAPCRC, N_CHECKMAPS,
  N_SWITCHNAME, N_SWITCHMODEL, N_SWITCHTEAM, N_INITTOKENS,
  N_TAKETOKEN, N_EXPIRETOKENS, N_DROPTOKENS, N_DEPOSITTOKENS,
  N_STEALTOKENS, N_SERVCMD, N_DEMOPACKET, N_SPAWNLOC,
  NUMMSG
}
 server message list More...
 
enum  {
  DISC_NONE = 0, DISC_EOP, DISC_KICK, DISC_MSGERR,
  DISC_IPBAN, DISC_PRIVATE, DISC_MAXCLIENTS, DISC_TIMEOUT,
  DISC_OVERFLOW, DISC_PASSWORD, DISC_NUM
}
 

Functions

int lan_info_port ()
 
int server_info_port (int servport)
 
int server_port (int infoport=-1)
 
int msgsizelookup (int msg)
 
const char * disconnectreason (int reason)
 

Variables

static const int msgsizes []
 size incuding message token, 0 for variable or not-checked sizes More...
 

Class Documentation

struct demoheader

demos contain stored network messages of a game which can be replayed to review games

Class Members
char magic[16]
int protocol
int version

Macro Definition Documentation

#define DEMO_MAGIC   "INEXOR_DEMO"
#define DEMO_VERSION   1
#define INEXOR_DEFAULT_MASTER   "master.inexor.org"
#define INEXOR_LANINFO_PORT   31414

Referenced by lan_info_port().

#define INEXOR_MASTER_PORT   31416
#define INEXOR_SERVER_PORT   31415

Referenced by server_port().

#define INEXOR_SERVINFO_PORT   31413

This file contains static protocol information for the (soon to be legacy) network code.

constant protocol and version definitions

Referenced by server_info_port().

#define MAX_POSSIBLE_PORT   65535
#define PROTOCOL_VERSION   303

Enumeration Type Documentation

anonymous enum
Enumerator
CHAN_POS 
CHAN_MSG 
CHAN_FILE 
NUM_ENET_CHANNELS 
anonymous enum

server message list

Warning
you will need to edit the msgsizes array as well.
you might get kicked from server because you modified the protocol!
Enumerator
N_CONNECT 
N_SERVINFO 

C2S send connection request to server.

N_WELCOME 

S2C send connection attempt answer (can be denied in case of wrong protocol or server password protection)

N_INITCLIENT 

S2C we are now connected. also close my GUI.

N_POS 

S2C another client connected or existing client changed name, team, or player model.

N_TEXT 

C2S|C2S send player position and rotation.

N_SOUND 

C2S send chat message to global game chat.

N_CDIS 

C2S send sound signal.

N_SHOOT 

S2C a client disconnected.

N_EXPLODE 

C2S a shot was fired.

N_SUICIDE 

C2S an explosion was triggered (grenades, rockets..)

N_DIED 

C2S I suicided (other clients receive N_DIED where actor = victim)

N_DAMAGE 

S2C a player got killed (or suicided)

N_HITPUSH 

S2C a player got damages.

N_SHOTFX 

S2C a player got pushed back.

N_EXPLODEFX 

S2C the EFFECT OF A SHOT (see N_SHOT)

N_TRYSPAWN 

S2C the EFFECT OF AN EXPLOSION (see N_EXPLODE)

N_SPAWNSTATE 

C2S a players tries to spawn.

N_SPAWN 

S2C send clients spawn information.

N_FORCEDEATH 

C2S|S2C a client is now spawning.

N_GUNSELECT 

S2C force a client to die.

N_TAUNT 

C2S a client selects a weapon.

N_FOV 

C2S|S2C (?) a client sent "Im gonna kill you" animation.

N_MAPCHANGE 

C2S|S2C a client has changed its field of view.

N_MAPVOTE 

S2C server changed map.

N_TEAMINFO 

C2S client suggests a map/mode.

N_ITEMSPAWN 

S2C send information about teams and their frags.

N_ITEMPICKUP 

S2C an item has spawned.

N_ITEMACC 

C2S I just picked up this item.

N_ITEMPUSH 

S2C item pickup was acknowledged for a client (item is occupied/despawned. wait for spawn)

N_TELEPORT 

C2S lose items when killed (BOMBERMAN)

N_JUMPPAD 

C2S|S2C a player in game has teleported to a teleport destination.

N_PING 

C2S|S2C a player in game has used a jumppad.

N_PONG 

C2S client sends ping packet to server.

N_CLIENTPING 

S2C servers answers ping packet.

N_TIMEUP 

C2S|S2C send client ping mesaure request / servers sends clients' pings.

N_FORCEINTERMISSION 

S2C change remaining time.

N_SERVMSG 

S2C server ended current game: set game time to 0 ("intermission")

N_ITEMLIST 

S2C server messages can be colored and will be rendered in game console.

N_RESUME 

C2S|S2C client request a list of items available in the current match / server answers with list.

N_EDITMODE 

S2C resume transmission of new data from lagged client (NOT: RESUMING A PAUSED GAME!)

N_EDITENT 

C2S|S2C a player toggled his edit mode on/off (requires editmode)

N_EDITF 

S2C a player creates a new entity (requires editmode)

N_EDITT 

C2S|S2C a player changed a FACE (requires editmode)

N_EDITM 

C2S|S2C a player changed a TEXTURE (requires editmode)

N_FLIP 

C2S|S2C a player edited MATERIAL (requires editmode)

N_COPY 

C2S|S2C a player flipped the current selection (requires editmode)

N_PASTE 

C2S|S2C (?) a player wants to copy a certain selection (requires editmode)

N_ROTATE 

C2S|S2C (?) send clipboard to other palyers (requires editmode)

N_REPLACE 

C2S|S2C a player rotated a selection (requires editmode)

N_DELCUBE 

C2S|S2C a player wants to replace a selection (requires editmode)

N_REMIP 

C2S|S2C a player wants to delete a selection (requires editmode)

N_EDITVSLOT 

C2S|S2C a client forcedremip (requires editmode, no administrative levels required)

N_UNDO 

C2S|S2C a client used a v.. command (vscale, vcolor..) to modify a texture.

N_REDO 

C2S|S2C send undo edit message.

N_NEWMAP 

C2S|S2C send redo edit message.

N_GETMAP 

C2S|S2C a client started a new map (requires editmode)

N_SENDMAP 

C2S a client downloaded the current map from server's map buffer (NOT ALWAYS UP TO DATE! MAP MUST BE SENT BEFORE DOWNLOADING!)

N_CLIPBOARD 

S2C server sends map to client (requires coop mode. YOU CAN'T SEND MAPS IN INSTACTF e.g. (YET))

N_EDITVAR 

C2S send copied data from your clipboard to server.

N_MASTERMODE 

C2S|S2C set map var value (requires editmode)

N_KICK 

C2S change master mode (requires permissions)

N_CLEARBANS 

C2S kick a specific player.

N_CURRENTMASTER 

C2S clear ban list.

N_SPECTATOR 

S2C server sent information about who is the current game master.

N_SETMASTER 

C2S|S2C toggle spectator status.

N_SETTEAM 

C2S claim game master.

N_BASES 

C2S|S2C team chat.

N_BASEINFO 

S2C send a list of available bases in capture mode.

N_BASESCORE 

S2C send extended information about bases.

N_REPAMMO 

S2C send base score to client.

N_BASEREGEN 

S2C replace ammo around bases in capture mode.

N_ANNOUNCE 

S2C regen capture: refill health and ammo of players near captured bases.

N_LISTDEMOS 

S2C announce spawn of quad damage or health boost (normal capture only)

N_SENDDEMOLIST 

C2S request a list of demos available for download.

N_GETDEMO 

S2C send a list of demos available for download.

N_SENDDEMO 

C2S a client requests to download a demo.

N_DEMOPLAYBACK 

S2C server sends a demo.

N_RECORDDEMO 

S2C finish demo playback.

N_STOPDEMO 

C2S advise the server to record demo.

N_CLEARDEMOS 

C2S finish demo recording add add recorded material to demo list.

N_TAKEFLAG 

C2S clear the last n / all demos.

N_RETURNFLAG 

S2C a player took a flag.

N_RESETFLAG 

S2C a player returned a flag.

N_INVISFLAG 

S2C a flag has been reset.

N_TRYDROPFLAG 

S2C send how long flag will stay transparent in hold mode ? (vistime)

N_DROPFLAG 

C2S tell the server that you would like to drop your flag.

N_SCOREFLAG 

S2C a client has dropped the flag.

N_INITFLAGS 

S2C a client has scored the flag.

N_SAYTEAM 

S2C send a list of flags available in game.

N_PRIVMSG 

C2S|S2C team chat.

N_HUDANNOUNCE 

C2S|S2C private/personal message.

N_CLIENT 

S2C BOMBERMAN Announcement.

N_PAUSEGAME 

S2C client synchronisation.

N_GAMESPEED 

C2S|S2C server paused game. stop player movement and actions.

N_PERSISTTEAMS 

C2S|S2C change game speed (and broadcast that change)

N_ADDBOT 

C2S|S2C do not shuffle teams when enabled.

N_DELBOT 

-S- add a bot to the current game

N_INITAI 

-S- remove a bot from the current game

N_FROMAI 

S2C commit AI settings to server. bots are still server side.

N_BOTLIMIT 

C2S take client number from bot x?

N_BOTBALANCE 

-S- set the bot limit

N_MAPCRC 

-S- set bot balance

N_CHECKMAPS 

C2S send map CRC32 hash value.

N_SWITCHNAME 

C2S force server to check client maps manually (requires permissions)

N_SWITCHMODEL 

C2S|S2C a player has changed his name.

N_SWITCHTEAM 

C2S|S2C a player has changed his player model.

N_INITTOKENS 

C2S|S2C a player has switched his team (some game modes have more than 2 teams!)

N_TAKETOKEN 
N_EXPIRETOKENS 
N_DROPTOKENS 
N_DEPOSITTOKENS 
N_STEALTOKENS 
N_SERVCMD 
N_DEMOPACKET 

S2C servers could send advanced messages to clients. standard clients do not interpret this custom message.

N_SPAWNLOC 

S2C send a requested demo packet.

NUMMSG 

S2C BOMBERMAN spawn location?

anonymous enum
Enumerator
DISC_NONE 
DISC_EOP 
DISC_KICK 
DISC_MSGERR 
DISC_IPBAN 
DISC_PRIVATE 
DISC_MAXCLIENTS 
DISC_TIMEOUT 
DISC_OVERFLOW 
DISC_PASSWORD 
DISC_NUM 

Function Documentation

const char* disconnectreason ( int  reason)
inline
int lan_info_port ( )
inline
int msgsizelookup ( int  msg)
inline

References msgsizes, and NUMMSG.

Referenced by game::addmsg(), and server::parsepacket().

int server_info_port ( int  servport)
inline
int server_port ( int  infoport = -1)
inline

Variable Documentation

const int msgsizes[]
static
Initial value:
=
{
N_EDITMODE, 2, N_EDITENT, 11, N_EDITF, 16, N_EDITT, 16, N_EDITM, 16, N_FLIP, 14, N_COPY, 14, N_PASTE, 14, N_ROTATE, 15, N_REPLACE, 17, N_DELCUBE, 14, N_REMIP, 1, N_EDITVSLOT, 16, N_UNDO, 0, N_REDO, 0, N_NEWMAP, 2, N_GETMAP, 1, N_SENDMAP, 0, N_EDITVAR, 0,
-1
}
S2C client synchronisation.
Definition: game_types.hpp:141
C2S request a list of demos available for download.
Definition: game_types.hpp:117
S2C a flag has been reset.
Definition: game_types.hpp:129
S2C send clients spawn information.
Definition: game_types.hpp:55
S2C server changed map.
Definition: game_types.hpp:61
S2C the EFFECT OF A SHOT (see N_SHOT)
Definition: game_types.hpp:52
C2S clear ban list.
Definition: game_types.hpp:102
C2S|S2C do not shuffle teams when enabled.
Definition: game_types.hpp:145
S2C server messages can be colored and will be rendered in game console.
Definition: game_types.hpp:75
C2S send connection request to server.
Definition: game_types.hpp:38
S2C we are now connected. also close my GUI.
Definition: game_types.hpp:40
C2S|S2C (?) a player wants to copy a certain selection (requires editmode)
Definition: game_types.hpp:86
S2C send information about teams and their frags.
Definition: game_types.hpp:63
S2C announce spawn of quad damage or health boost (normal capture only)
Definition: game_types.hpp:116
C2S|S2C team chat.
Definition: game_types.hpp:137
S2C send base score to client.
Definition: game_types.hpp:111
S2C a client disconnected.
Definition: game_types.hpp:45
C2S|S2C a player rotated a selection (requires editmode)
Definition: game_types.hpp:88
C2S|S2C a player in game has used a jumppad.
Definition: game_types.hpp:69
C2S|S2C send client ping mesaure request / servers sends clients' pings.
Definition: game_types.hpp:72
C2S take client number from bot x?
Definition: game_types.hpp:149
Definition: game_types.hpp:37
C2S send copied data from your clipboard to server.
Definition: game_types.hpp:98
C2S send sound signal.
Definition: game_types.hpp:44
C2S|S2C a player has changed his name.
Definition: game_types.hpp:154
C2S|S2C a player toggled his edit mode on/off (requires editmode)
Definition: game_types.hpp:80
C2S an explosion was triggered (grenades, rockets..)
Definition: game_types.hpp:47
Definition: game_types.hpp:160
S2C another client connected or existing client changed name, team, or player model.
Definition: game_types.hpp:41
C2S|S2C a player changed a FACE (requires editmode)
Definition: game_types.hpp:82
C2S clear the last n / all demos.
Definition: game_types.hpp:126
S2C regen capture: refill health and ammo of players near captured bases.
Definition: game_types.hpp:113
S2C send a list of flags available in game.
Definition: game_types.hpp:136
S2C BOMBERMAN Announcement.
Definition: game_types.hpp:139
C2S|S2C a player has changed his player model.
Definition: game_types.hpp:155
Definition: game_types.hpp:162
C2S|S2C a player wants to replace a selection (requires editmode)
Definition: game_types.hpp:89
-S- add a bot to the current game
Definition: game_types.hpp:146
C2S|S2C a client has changed its field of view.
Definition: game_types.hpp:60
S2C send how long flag will stay transparent in hold mode ? (vistime)
Definition: game_types.hpp:130
C2S a client selects a weapon.
Definition: game_types.hpp:58
C2S|S2C set map var value (requires editmode)
Definition: game_types.hpp:99
C2S|S2C (?) send clipboard to other palyers (requires editmode)
Definition: game_types.hpp:87
C2S|S2C send undo edit message.
Definition: game_types.hpp:93
S2C finish demo playback.
Definition: game_types.hpp:121
C2S|S2C a player has switched his team (some game modes have more than 2 teams!)
Definition: game_types.hpp:158
C2S|S2C a client is now spawning.
Definition: game_types.hpp:56
C2S claim game master.
Definition: game_types.hpp:105
C2S client suggests a map/mode.
Definition: game_types.hpp:62
S2C resume transmission of new data from lagged client (NOT: RESUMING A PAUSED GAME!) ...
Definition: game_types.hpp:79
S2C server sends a demo.
Definition: game_types.hpp:120
C2S advise the server to record demo.
Definition: game_types.hpp:122
C2S|S2C a player changed a TEXTURE (requires editmode)
Definition: game_types.hpp:83
C2S|S2C toggle spectator status.
Definition: game_types.hpp:104
S2C a player returned a flag.
Definition: game_types.hpp:128
S2C a player got damages.
Definition: game_types.hpp:50
S2C replace ammo around bases in capture mode.
Definition: game_types.hpp:112
-S- set bot balance
Definition: game_types.hpp:151
Definition: game_types.hpp:159
C2S a client requests to download a demo.
Definition: game_types.hpp:119
S2C servers could send advanced messages to clients. standard clients do not interpret this custom me...
Definition: game_types.hpp:166
S2C a client has scored the flag.
Definition: game_types.hpp:133
C2S|S2C a client used a v.. command (vscale, vcolor..) to modify a texture.
Definition: game_types.hpp:92
C2S|S2C change game speed (and broadcast that change)
Definition: game_types.hpp:143
C2S I just picked up this item.
Definition: game_types.hpp:65
C2S|S2C client request a list of items available in the current match / server answers with list...
Definition: game_types.hpp:76
S2C commit AI settings to server. bots are still server side.
Definition: game_types.hpp:148
S2C server ended current game: set game time to 0 ("intermission")
Definition: game_types.hpp:74
C2S|S2C server paused game. stop player movement and actions.
Definition: game_types.hpp:142
-S- set the bot limit
Definition: game_types.hpp:150
S2C send connection attempt answer (can be denied in case of wrong protocol or server password protec...
Definition: game_types.hpp:39
C2S I suicided (other clients receive N_DIED where actor = victim)
Definition: game_types.hpp:48
S2C change remaining time.
Definition: game_types.hpp:73
S2C a player got pushed back.
Definition: game_types.hpp:51
S2C send a list of available bases in capture mode.
Definition: game_types.hpp:109
C2S a players tries to spawn.
Definition: game_types.hpp:54
S2C force a client to die.
Definition: game_types.hpp:57
C2S tell the server that you would like to drop your flag.
Definition: game_types.hpp:131
S2C send extended information about bases.
Definition: game_types.hpp:110
C2S|S2C send redo edit message.
Definition: game_types.hpp:94
C2S|C2S send player position and rotation.
Definition: game_types.hpp:42
C2S a client downloaded the current map from server's map buffer (NOT ALWAYS UP TO DATE! MAP MUST BE ...
Definition: game_types.hpp:96
C2S|S2C a client forcedremip (requires editmode, no administrative levels required) ...
Definition: game_types.hpp:91
S2C send a requested demo packet.
Definition: game_types.hpp:167
C2S finish demo recording add add recorded material to demo list.
Definition: game_types.hpp:123
C2S a shot was fired.
Definition: game_types.hpp:46
Definition: game_types.hpp:161
C2S force server to check client maps manually (requires permissions)
Definition: game_types.hpp:153
C2S send map CRC32 hash value.
Definition: game_types.hpp:152
S2C the EFFECT OF AN EXPLOSION (see N_EXPLODE)
Definition: game_types.hpp:53
S2C a player creates a new entity (requires editmode)
Definition: game_types.hpp:81
S2C servers answers ping packet.
Definition: game_types.hpp:71
S2C an item has spawned.
Definition: game_types.hpp:64
C2S change master mode (requires permissions)
Definition: game_types.hpp:100
C2S client sends ping packet to server.
Definition: game_types.hpp:70
C2S|S2C (?) a client sent "Im gonna kill you" animation.
Definition: game_types.hpp:59
S2C a player took a flag.
Definition: game_types.hpp:127
C2S|S2C private/personal message.
Definition: game_types.hpp:138
C2S|S2C a player edited MATERIAL (requires editmode)
Definition: game_types.hpp:84
S2C send a list of demos available for download.
Definition: game_types.hpp:118
C2S send chat message to global game chat.
Definition: game_types.hpp:43
S2C a client has dropped the flag.
Definition: game_types.hpp:132
C2S|S2C a client started a new map (requires editmode)
Definition: game_types.hpp:95
C2S kick a specific player.
Definition: game_types.hpp:101
S2C server sent information about who is the current game master.
Definition: game_types.hpp:103
C2S|S2C a player flipped the current selection (requires editmode)
Definition: game_types.hpp:85
S2C item pickup was acknowledged for a client (item is occupied/despawned. wait for spawn) ...
Definition: game_types.hpp:66
C2S|S2C team chat.
Definition: game_types.hpp:108
-S- remove a bot from the current game
Definition: game_types.hpp:147
Definition: game_types.hpp:165
C2S|S2C a player wants to delete a selection (requires editmode)
Definition: game_types.hpp:90
Definition: game_types.hpp:163
S2C a player got killed (or suicided)
Definition: game_types.hpp:49

size incuding message token, 0 for variable or not-checked sizes

Referenced by msgsizelookup().