1 /*
2 	OpenLieroX
3 
4 	some constants
5 
6 	created 2008-10-03
7 	code under LGPL
8 */
9 
10 #ifndef __OLX_CONSTS_H__
11 #define __OLX_CONSTS_H__
12 
13 
14 // Net status
15 enum ClientNetState {
16 	NET_DISCONNECTED=0,
17 	NET_CONNECTING,			// Server doesn't use this state, only client side
18 	NET_CONNECTED,			// Server usage: when client connected or playing, client usage: only when in server lobby
19 	NET_PLAYING,			// Server doesn't use this state, only client side
20 	NET_ZOMBIE				// Server side only state - server won't accept any client packets and will send disconnect packets to client
21 };
22 
NetStateString(ClientNetState state)23 inline const char* NetStateString(ClientNetState state) {
24 	switch (state) {
25 		case NET_DISCONNECTED: return "NET_DISCONNECTED";
26 		case NET_CONNECTING: return "NET_CONNECTING";
27 		case NET_CONNECTED: return "NET_CONNECTED";
28 		case NET_PLAYING: return "NET_PLAYING";
29 		case NET_ZOMBIE: return "NET_ZOMBIE";
30 	}
31 	return "INVALID NETSTATE";
32 }
33 
34 // Misc constants
35 enum {
36 	LX_PORT = 23400,
37 	SPAWN_HOLESIZE = 4,
38 	MAX_WORMS = 32,
39 	MAX_CLIENTS = 32,
40 	MAX_PLAYERS	= 32,
41 	MAX_CHATLINES = 8,
42 	NUM_VIEWPORTS = 3,
43 	GAMEOVER_WAIT = 3
44 };
45 
46 static const float LX_ENDWAIT = 9.0f;
47 
48 // Game modes
49 enum GameModeIndex {
50 	GM_DEATHMATCH = 0,
51 	GM_TEAMDEATH,
52 	GM_TAG,
53 	GM_DEMOLITIONS,
54 	GM_HIDEANDSEEK,
55 	GM_CTF,
56 	GM_RACE,
57 	GM_TEAMRACE,
58 };
59 
60 // Game mode types
61 // HINT: do not change the order, this is used over the network
62 enum {
63 	GMT_NORMAL = 0,  // Worms appear as normal
64 	GMT_TEAMS,   // Worms appear in teams
65 	GMT_TIME,    // One worm appears special, worms have a time attribute
66 	GMT_DIRT,     // There is a dirt counter
67 	GMT_MAX = GMT_DIRT
68 };
69 
70 enum AFK_TYPE {
71 	AFK_BACK_ONLINE = 0,
72 	AFK_TYPING_CHAT,
73 	AFK_AWAY,
74 	AFK_SELECTING_WPNS,
75 	AFK_CONSOLE,
76 	AFK_MENU,
77 };
78 
79 
80 #endif
81 
82