-
Notifications
You must be signed in to change notification settings - Fork 10
/
quake_common.h
125 lines (102 loc) · 4.66 KB
/
quake_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
minqlbot - A Quake Live server administrator bot.
Copyright (C) 2015 Mino <mino@minomino.org>
This file is part of minqlbot.
minqlbot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
minqlbot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with minqlbot. If not, see <http://www.gnu.org/licenses/>.
*/
namespace quake {
typedef int qboolean;
#define qtrue 1
#define qfalse 2
typedef struct cvar_s {
char *name;
char *string;
char *resetString; // cvar_restart will reset to this value
char *latchedString; // for CVAR_LATCH vars
int flags;
qboolean modified; // set each time the cvar is changed
int modificationCount; // incremented each time the cvar is changed
float value; // atof( string )
int integer; // atoi( string )
struct cvar_s *next;
struct cvar_s *hashNext;
} cvar_t;
typedef enum {
NA_BOT,
NA_BAD, // an address lookup failed
NA_LOOPBACK,
NA_BROADCAST,
NA_IP,
NA_IPX,
NA_BROADCAST_IPX
} netadrtype_t;
typedef enum {
NS_CLIENT,
NS_SERVER
} netsrc_t;
typedef struct {
netadrtype_t type;
char ip[4];
char ipx[10];
unsigned short port;
} netadr_t;
typedef struct {
//int clientNum;
//int lastPacketSentTime; // for retransmits during connection
//int lastPacketTime; // for timeouts
//netadr_t serverAddress;
//int connectTime; // for connection retransmits
//int connectPacketCount; // for display on connection dialog
//char serverMessage[MAX_STRING_TOKENS]; // for display on connection dialog
//int challenge; // from the server to use for connecting
//int checksumFeed; // from the server for checksum calculations
// these are our reliable messages that go to the server
int reliableSequence;
int reliableAcknowledge; // the last one the server has executed
char reliableCommands[MAX_RELIABLE_COMMANDS][MAX_STRING_CHARS];
// server message (unreliable) and command (reliable) sequence
// numbers are NOT cleared at level changes, but continue to
// increase as long as the connection is valid
// message sequence is used by both the network layer and the
// delta compression layer
int serverMessageSequence;
// reliable messages received from server
int serverCommandSequence;
int lastExecutedServerCommand; // last server command grabbed or executed with CL_GetServerCommand
char serverCommands[MAX_RELIABLE_COMMANDS][MAX_STRING_CHARS];
//// file transfer from server
//fileHandle_t download;
//char downloadTempName[MAX_OSPATH];
//char downloadName[MAX_OSPATH];
//int downloadNumber;
//int downloadBlock; // block we are waiting for
//int downloadCount; // how many bytes we got
//int downloadSize; // how many bytes we got
//char downloadList[MAX_INFO_STRING]; // list of paks we need to download
//qboolean downloadRestart; // if true, we need to do another FS_Restart because we downloaded a pak
//// demo information
//char demoName[MAX_QPATH];
//qboolean spDemoRecording;
//qboolean demorecording;
//qboolean demoplaying;
//qboolean demowaiting; // don't record until a non-delta message is received
//qboolean firstDemoFrameSkipped;
//fileHandle_t demofile;
//int timeDemoFrames; // counter of rendered frames
//int timeDemoStart; // cls.realtime before first frame
//int timeDemoBaseTime; // each frame will be at this time + frameNum * 50
//// big stuff at end of structure so most offsets are 15 bits or less
//netchan_t netchan;
} clientConnection_t;
// CLC
extern clientConnection_t * clc;
}