1 // the interface the engine uses to run the gameplay module
5 virtual ~icliententities() {}
7 virtual void editent(int i
) = 0;
8 virtual const char *entnameinfo(entity
&e
) = 0;
9 virtual const char *entname(int i
) = 0;
10 virtual int extraentinfosize() = 0;
11 virtual void writeent(entity
&e
, char *buf
) = 0;
12 virtual void readent(entity
&e
, char *buf
) = 0;
13 virtual float dropheight(entity
&e
) = 0;
14 virtual void rumble(const extentity
&e
) = 0;
15 virtual void trigger(extentity
&e
) = 0;
16 virtual void fixentity(extentity
&e
) = 0;
17 virtual void entradius(extentity
&e
, float &radius
, float &angle
, vec
&dir
) {}
18 virtual bool mayattach(extentity
&e
) { return false; }
19 virtual bool attachent(extentity
&e
, extentity
&a
) { return false; }
20 virtual extentity
*newentity() = 0;
21 virtual vector
<extentity
*> &getents() = 0;
26 virtual ~iclientcom() {}
28 virtual void gamedisconnect() = 0;
29 virtual void parsepacketclient(int chan
, ucharbuf
&p
) = 0;
30 virtual int sendpacketclient(ucharbuf
&p
, bool &reliable
, dynent
*d
) = 0;
31 virtual void gameconnect(bool _remote
) = 0;
32 virtual bool allowedittoggle() = 0;
33 virtual void edittoggled(bool on
) {}
34 virtual void writeclientinfo(FILE *f
) = 0;
35 virtual void toserver(char *text
) = 0;
36 virtual void changemap(const char *name
) = 0;
37 virtual int numchannels() { return 1; }
42 virtual ~igameclient() {}
44 virtual const char *gameident() = 0;
45 virtual const char *defaultmap() = 0;
46 virtual const char *savedconfig() = 0;
47 virtual const char *defaultconfig() = 0;
48 virtual const char *autoexec() = 0;
49 virtual const char *savedservers() { return NULL
; }
51 virtual icliententities
*getents() = 0;
52 virtual iclientcom
*getcom() = 0;
54 virtual bool clientoption(char *arg
) { return false; }
55 virtual void updateworld(vec
&pos
, int curtime
, int lm
) = 0;
56 virtual void initclient() = 0;
57 virtual void physicstrigger(physent
*d
, bool local
, int floorlevel
, int waterlevel
, int material
= 0) = 0;
58 virtual void edittrigger(const selinfo
&sel
, int op
, int arg1
= 0, int arg2
= 0, int arg3
= 0) = 0;
59 virtual char *getclientmap() = 0;
60 virtual void resetgamestate() = 0;
61 virtual void suicide(physent
*d
) = 0;
62 virtual void newmap(int size
) = 0;
63 virtual void startmap(const char *name
) = 0;
64 virtual void preload() {}
65 virtual float abovegameplayhud() { return 1.0f
; }
66 virtual void gameplayhud(int w
, int h
) = 0;
67 virtual void drawhudgun() = 0;
68 virtual bool canjump() = 0;
69 virtual bool allowmove(physent
*d
) { return true; }
70 virtual void doattack(bool on
) = 0;
71 virtual dynent
*iterdynents(int i
) = 0;
72 virtual int numdynents() = 0;
73 virtual void rendergame() = 0;
74 virtual void writegamedata(vector
<char> &extras
) = 0;
75 virtual void readgamedata(vector
<char> &extras
) = 0;
76 virtual void g3d_gamemenus() = 0;
77 virtual const char *defaultcrosshair(int index
) { return NULL
; }
78 virtual int selectcrosshair(float &r
, float &g
, float &b
) { return 0; }
79 virtual void lighteffects(dynent
*d
, vec
&color
, vec
&dir
) {}
80 virtual void setupcamera() {}
81 virtual bool detachcamera() { return false; }
82 virtual void adddynlights() {}
83 virtual void particletrack(physent
*owner
, vec
&o
, vec
&d
) {}
84 virtual bool serverinfostartcolumn(g3d_gui
*g
, int i
) { return false; }
85 virtual void serverinfoendcolumn(g3d_gui
*g
, int i
) {}
86 virtual bool serverinfoentry(g3d_gui
*g
, int i
, const char *name
, const char *desc
, const char *map
, int ping
, const vector
<int> &attr
, int np
) { return false; };
91 virtual ~igameserver() {}
93 virtual bool serveroption(char *arg
) { return false; }
94 virtual void *newinfo() = 0;
95 virtual void deleteinfo(void *ci
) = 0;
96 virtual void serverinit() = 0;
97 virtual void clientdisconnect(int n
) = 0;
98 virtual int clientconnect(int n
, uint ip
) = 0;
99 virtual void localdisconnect(int n
) = 0;
100 virtual void localconnect(int n
) = 0;
101 virtual const char *servername() = 0;
102 virtual void recordpacket(int chan
, void *data
, int len
) {}
103 virtual void parsepacket(int sender
, int chan
, bool reliable
, ucharbuf
&p
) = 0;
104 virtual bool sendpackets() = 0;
105 virtual int welcomepacket(ucharbuf
&p
, int n
, ENetPacket
*packet
) = 0;
106 virtual void serverinforeply(ucharbuf
&req
, ucharbuf
&p
) = 0;
107 virtual void serverupdate(int lastmillis
, int totalmillis
) = 0;
108 virtual bool servercompatible(char *name
, char *sdec
, char *map
, int ping
, const vector
<int> &attr
, int np
) = 0;
109 virtual int serverinfoport() = 0;
110 virtual int serverport() = 0;
111 virtual const char *getdefaultmaster() = 0;
112 virtual void sendservmsg(const char *s
) = 0;
119 virtual igameclient
*newclient() = 0;
120 virtual igameserver
*newserver() = 0;