|
darope@0
|
1 |
<!-- vi: set ts=4 sw=4 : --> |
|
darope@0
|
2 |
<!-- vim: set tw=75 : --> |
|
darope@0
|
3 |
|
|
darope@0
|
4 |
<HTML> |
|
darope@0
|
5 |
<head> |
|
darope@0
|
6 |
<title>HLSDK DLLAPI Notes</title> |
|
darope@0
|
7 |
</head> |
|
darope@0
|
8 |
<body> |
|
darope@0
|
9 |
|
|
darope@0
|
10 |
<h1>HLSDK DLLAPI Notes |
|
darope@0
|
11 |
</h1> |
|
darope@0
|
12 |
|
|
darope@0
|
13 |
<hr> |
|
darope@0
|
14 |
<ul> |
|
darope@0
|
15 |
<li><a href=#GameDLLInit>GameDLLInit</a> |
|
darope@0
|
16 |
<li><a href=#DispatchSpawn>DispatchSpawn</a> |
|
darope@0
|
17 |
<li><a href=#DispatchThink>DispatchThink</a> |
|
darope@0
|
18 |
<li><a href=#DispatchUse>DispatchUse</a> |
|
darope@0
|
19 |
<li><a href=#DispatchTouch>DispatchTouch</a> |
|
darope@0
|
20 |
<li><a href=#DispatchBlocked>DispatchBlocked</a> |
|
darope@0
|
21 |
<li><a href=#DispatchKeyValue>DispatchKeyValue</a> |
|
darope@0
|
22 |
<li><a href=#DispatchSave>DispatchSave</a> |
|
darope@0
|
23 |
<li><a href=#DispatchRestore>DispatchRestore</a> |
|
darope@0
|
24 |
<li><a href=#DispatchObjectCollsionBox>DispatchObjectCollsionBox</a> |
|
darope@0
|
25 |
<li><a href=#SaveWriteFields>SaveWriteFields</a> |
|
darope@0
|
26 |
<li><a href=#SaveReadFields>SaveReadFields</a> |
|
darope@0
|
27 |
<li><a href=#SaveGlobalState>SaveGlobalState</a> |
|
darope@0
|
28 |
<li><a href=#RestoreGlobalState>RestoreGlobalState</a> |
|
darope@0
|
29 |
<li><a href=#ResetGlobalState>ResetGlobalState</a> |
|
darope@0
|
30 |
<li><a href=#ClientConnect>ClientConnect</a> |
|
darope@0
|
31 |
<li><a href=#ClientDisconnect>ClientDisconnect</a> |
|
darope@0
|
32 |
<li><a href=#ClientKill>ClientKill</a> |
|
darope@0
|
33 |
<li><a href=#ClientPutInServer>ClientPutInServer</a> |
|
darope@0
|
34 |
<li><a href=#ClientCommand>ClientCommand</a> |
|
darope@0
|
35 |
<li><a href=#ClientUserInfoChanged>ClientUserInfoChanged</a> |
|
darope@0
|
36 |
<li><a href=#ServerActivate>ServerActivate</a> |
|
darope@0
|
37 |
<li><a href=#ServerDeactivate>ServerDeactivate</a> |
|
darope@0
|
38 |
<li><a href=#PlayerPreThink>PlayerPreThink</a> |
|
darope@0
|
39 |
<li><a href=#PlayerPostThink>PlayerPostThink</a> |
|
darope@0
|
40 |
<li><a href=#StartFrame>StartFrame</a> |
|
darope@0
|
41 |
<li><a href=#ParmsNewLevel>ParmsNewLevel</a> |
|
darope@0
|
42 |
<li><a href=#ParmsChangeLevel>ParmsChangeLevel</a> |
|
darope@0
|
43 |
<li><a href=#GetGameDescription>GetGameDescription</a> |
|
darope@0
|
44 |
<li><a href=#PlayerCustomization>PlayerCustomization</a> |
|
darope@0
|
45 |
<li><a href=#SpectatorConnect>SpectatorConnect</a> |
|
darope@0
|
46 |
<li><a href=#SpectatorDisconnect>SpectatorDisconnect</a> |
|
darope@0
|
47 |
<li><a href=#SpectatorThink>SpectatorThink</a> |
|
darope@0
|
48 |
<li><a href=#Sys_Error>Sys_Error</a> |
|
darope@0
|
49 |
<li><a href=#PM_Move>PM_Move</a> |
|
darope@0
|
50 |
<li><a href=#PM_Init>PM_Init</a> |
|
darope@0
|
51 |
<li><a href=#PM_FindTextureType>PM_FindTextureType</a> |
|
darope@0
|
52 |
<li><a href=#SetupVisibility>SetupVisibility</a> |
|
darope@0
|
53 |
<li><a href=#UpdateClientData>UpdateClientData</a> |
|
darope@0
|
54 |
<li><a href=#AddToFullPack>AddToFullPack</a> |
|
darope@0
|
55 |
<li><a href=#CreateBaseline>CreateBaseline</a> |
|
darope@0
|
56 |
<li><a href=#RegisterEncoders>RegisterEncoders</a> |
|
darope@0
|
57 |
<li><a href=#GetWeaponData>GetWeaponData</a> |
|
darope@0
|
58 |
<li><a href=#CmdStart>CmdStart</a> |
|
darope@0
|
59 |
<li><a href=#CmdEnd>CmdEnd</a> |
|
darope@0
|
60 |
<li><a href=#ConnectionlessPacket>ConnectionlessPacket</a> |
|
darope@0
|
61 |
<li><a href=#GetHullBounds>GetHullBounds</a> |
|
darope@0
|
62 |
<li><a href=#CreateInstancedBaselines>CreateInstancedBaselines</a> |
|
darope@0
|
63 |
<li><a href=#InconsistentFile>InconsistentFile</a> |
|
darope@0
|
64 |
<li><a href=#AllowLagCompensation>AllowLagCompensation</a> |
|
darope@0
|
65 |
</ul> |
|
darope@0
|
66 |
|
|
darope@0
|
67 |
<hr><h3><tt><a name="GameDLLInit">GameDLLInit</a></tt></h3> |
|
darope@0
|
68 |
<i>from dlls/game.cpp:</i><br> |
|
darope@0
|
69 |
<dd><tt>void GameDLLInit(void);</tt><p> |
|
darope@0
|
70 |
<blockquote><tt> |
|
darope@0
|
71 |
Register your console variables here.<br> |
|
darope@0
|
72 |
This gets called one time when the game is initialied.<br> |
|
darope@0
|
73 |
Initialize the game (one-time call after loading of game .dll)<br> |
|
darope@0
|
74 |
</tt></blockquote> |
|
darope@0
|
75 |
<p><i>comments:</i><br> |
|
darope@0
|
76 |
<blockquote> |
|
darope@0
|
77 |
Called just after hlds reports "Dll loaded for mod Half-Life". |
|
darope@0
|
78 |
</blockquote> |
|
darope@0
|
79 |
|
|
darope@0
|
80 |
<hr><h3><tt><a name="DispatchSpawn">DispatchSpawn</a></tt></h3> |
|
darope@0
|
81 |
<i>from dlls/cbase.cpp</I> |
|
darope@0
|
82 |
<dd><tt>int DispatchSpawn(edict_t *pent);</tt><p> |
|
darope@0
|
83 |
<p><i>comments:</i><br> |
|
darope@0
|
84 |
<blockquote> |
|
darope@0
|
85 |
0==Success, -1==Failure ? |
|
darope@0
|
86 |
</blockquote> |
|
darope@0
|
87 |
|
|
darope@0
|
88 |
<hr><h3><tt><a name="DispatchThink">DispatchThink</a></tt></h3> |
|
darope@0
|
89 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
90 |
<dd><tt>void DispatchThink(edict_t *pent);</tt><p> |
|
darope@0
|
91 |
|
|
darope@0
|
92 |
<hr><h3><tt><a name="DispatchUse">DispatchUse</a></tt></h3> |
|
darope@0
|
93 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
94 |
<dd><tt>void DispatchUse(edict_t *pentUsed, edict_t *pentOther);</tt><p> |
|
darope@0
|
95 |
|
|
darope@0
|
96 |
<hr><h3><tt><a name="DispatchTouch">DispatchTouch</a></tt></h3> |
|
darope@0
|
97 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
98 |
<dd><tt>void DispatchTouch(edict_t *pentTouched, edict_t *pentOther);</tt><p> |
|
darope@0
|
99 |
|
|
darope@0
|
100 |
<hr><h3><tt><a name="DispatchBlocked">DispatchBlocked</a></tt></h3> |
|
darope@0
|
101 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
102 |
<dd><tt>void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);</tt><p> |
|
darope@0
|
103 |
|
|
darope@0
|
104 |
<hr><h3><tt><a name="DispatchKeyValue">DispatchKeyValue</a></tt></h3> |
|
darope@0
|
105 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
106 |
<dd><tt>void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);</tt><p> |
|
darope@0
|
107 |
|
|
darope@0
|
108 |
<hr><h3><tt><a name="DispatchSave">DispatchSave</a></tt></h3> |
|
darope@0
|
109 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
110 |
<dd><tt>void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);</tt><p> |
|
darope@0
|
111 |
|
|
darope@0
|
112 |
<hr><h3><tt><a name="DispatchRestore">DispatchRestore</a></tt></h3> |
|
darope@0
|
113 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
114 |
<dd><tt>int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);</tt><p> |
|
darope@0
|
115 |
<p><i>comments:</i><br> |
|
darope@0
|
116 |
<blockquote> |
|
darope@0
|
117 |
0==Success, -1==Failure ? |
|
darope@0
|
118 |
</blockquote> |
|
darope@0
|
119 |
|
|
darope@0
|
120 |
<hr><h3><tt><a name="DispatchObjectCollsionBox">DispatchObjectCollsionBox</a></tt></h3> |
|
darope@0
|
121 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
122 |
<dd><tt>void DispatchObjectCollsionBox(edict_t *pent);</tt><p> |
|
darope@0
|
123 |
|
|
darope@0
|
124 |
<hr><h3><tt><a name="SaveWriteFields">SaveWriteFields</a></tt></h3> |
|
darope@0
|
125 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
126 |
<dd><tt>void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p> |
|
darope@0
|
127 |
|
|
darope@0
|
128 |
<hr><h3><tt><a name="SaveReadFields">SaveReadFields</a></tt></h3> |
|
darope@0
|
129 |
<i>from dlls/cbase.cpp</i><br> |
|
darope@0
|
130 |
<dd><tt>void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p> |
|
darope@0
|
131 |
|
|
darope@0
|
132 |
<hr><h3><tt><a name="SaveGlobalState">SaveGlobalState</a></tt></h3> |
|
darope@0
|
133 |
<i>from dlls/world.cpp</i><br> |
|
darope@0
|
134 |
<dd><tt>void SaveGlobalState(SAVERESTOREDATA *pSaveData);</tt><p> |
|
darope@0
|
135 |
|
|
darope@0
|
136 |
<hr><h3><tt><a name="RestoreGlobalState">RestoreGlobalState</a></tt></h3> |
|
darope@0
|
137 |
<i>from dlls/world.cpp</i><br> |
|
darope@0
|
138 |
<dd><tt>void RestoreGlobalState(SAVERESTOREDATA *pSaveData);</tt><p> |
|
darope@0
|
139 |
|
|
darope@0
|
140 |
<hr><h3><tt><a name="ResetGlobalState">ResetGlobalState</a></tt></h3> |
|
darope@0
|
141 |
<i>from dlls/world.cpp</i><br> |
|
darope@0
|
142 |
<dd><tt>void ResetGlobalState(void);</tt><p> |
|
darope@0
|
143 |
|
|
darope@0
|
144 |
<hr><h3><tt><a name="ClientConnect">ClientConnect</a></tt></h3> |
|
darope@0
|
145 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
146 |
<dd><tt>BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);</tt><p> |
|
darope@0
|
147 |
<blockquote><tt> |
|
darope@0
|
148 |
Called when a player connects to a server. |
|
darope@0
|
149 |
</tt></blockquote> |
|
darope@0
|
150 |
<p><i>comments:</i><br> |
|
darope@0
|
151 |
<blockquote> |
|
darope@0
|
152 |
Called on initial connect, just after hlds reports "connected", ie: |
|
darope@0
|
153 |
<pre> <tt>"John<1><WON:9856723>" connected, address "127.0.0.1:27005"</tt></pre> |
|
darope@0
|
154 |
This is before the user begins downloading, or anything else. |
|
darope@0
|
155 |
</blockquote> |
|
darope@0
|
156 |
|
|
darope@0
|
157 |
<hr><h3><tt><a name="ClientDisconnect">ClientDisconnect</a></tt></h3> |
|
darope@0
|
158 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
159 |
<dd><tt>void ClientDisconnect(edict_t *pEntity);</tt><p> |
|
darope@0
|
160 |
<blockquote><tt> |
|
darope@0
|
161 |
Called when a player disconnects from a server.<br> |
|
darope@0
|
162 |
GLOBALS ASSUMED SET: g_fGameOver |
|
darope@0
|
163 |
</tt></blockquote> |
|
darope@0
|
164 |
<p><i>comments:</i><br> |
|
darope@0
|
165 |
<blockquote> |
|
darope@0
|
166 |
This is not the opposite of <tt><b>ClientConnect</b></tt>, despite the similar name. |
|
darope@0
|
167 |
It appears to only be called if the client was <tt><b>PutInServer</b></tt> first. If |
|
darope@0
|
168 |
the client disconnects before being <tt><b>PutInServer</b></tt>, no API routine is |
|
darope@0
|
169 |
called. This would be more appropriately named <tt><i><b>ClientRemoveFromServer</i></b></tt>. |
|
darope@0
|
170 |
</blockquote> |
|
darope@0
|
171 |
|
|
darope@0
|
172 |
<hr><h3><tt><a name="ClientKill">ClientKill</a></tt></h3> |
|
darope@0
|
173 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
174 |
<dd><tt>void ClientKill(edict_t *pEntity);</tt><p> |
|
darope@0
|
175 |
<blockquote><tt> |
|
darope@0
|
176 |
Player entered the suicide command.<br> |
|
darope@0
|
177 |
GLOBALS ASSUMED SET: g_ulModelIndexPlayer |
|
darope@0
|
178 |
</tt></blockquote> |
|
darope@0
|
179 |
<p><i>comments:</i><br> |
|
darope@0
|
180 |
<blockquote> |
|
darope@0
|
181 |
When the client typed "kill" in the console? |
|
darope@0
|
182 |
</blockquote> |
|
darope@0
|
183 |
|
|
darope@0
|
184 |
<hr><h3><tt><a name="ClientPutInServer">ClientPutInServer</a></tt></h3> |
|
darope@0
|
185 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
186 |
<dd><tt>void ClientPutInServer(edict_t *pEntity);</tt><p> |
|
darope@0
|
187 |
<blockquote><tt> |
|
darope@0
|
188 |
Called each time a player is spawned. |
|
darope@0
|
189 |
</tt></blockquote> |
|
darope@0
|
190 |
<p><i>comments:</i><br> |
|
darope@0
|
191 |
<blockquote> |
|
darope@0
|
192 |
Called after the client has uploaded/download all necessary resources, |
|
darope@0
|
193 |
just after hlds reports "entered the game", ie: |
|
darope@0
|
194 |
<pre> "John<1>" has entered the game</pre> |
|
darope@0
|
195 |
</blockquote> |
|
darope@0
|
196 |
|
|
darope@0
|
197 |
<hr><h3><tt><a name="ClientCommand">ClientCommand</a></tt></h3> |
|
darope@0
|
198 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
199 |
<dd><tt>void ClientCommand(edict_t *pEntity);</tt><p> |
|
darope@0
|
200 |
<blockquote><tt> |
|
darope@0
|
201 |
Called each time a player uses a "cmd" command. |
|
darope@0
|
202 |
Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character |
|
darope@0
|
203 |
string command. |
|
darope@0
|
204 |
</tt></blockquote> |
|
darope@0
|
205 |
|
|
darope@0
|
206 |
<hr><h3><tt><a name="ClientUserInfoChanged">ClientUserInfoChanged</a></tt></h3> |
|
darope@0
|
207 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
208 |
<dd><tt>void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);</tt><p> |
|
darope@0
|
209 |
<blockquote><tt> |
|
darope@0
|
210 |
Called after the player changes userinfo - gives dll a chance to modify |
|
darope@0
|
211 |
it before it gets sent into the rest of the engine. |
|
darope@0
|
212 |
</tt></blockquote> |
|
darope@0
|
213 |
<p><i>comments:</i><br> |
|
darope@0
|
214 |
<blockquote> |
|
darope@0
|
215 |
Called when user issues <tt>"<b>setinfo</b>"</tt> from the console. Also appears to be |
|
darope@0
|
216 |
called whenever the user returns to the game from the ESC menu. |
|
darope@0
|
217 |
</blockquote> |
|
darope@0
|
218 |
|
|
darope@0
|
219 |
<hr><h3><tt><a name="ServerActivate">ServerActivate</a></tt></h3> |
|
darope@0
|
220 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
221 |
<dd><tt>void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);</tt><p> |
|
darope@0
|
222 |
<blockquote><tt> |
|
darope@0
|
223 |
Every call to ServerActivate should be matched by a call to |
|
darope@0
|
224 |
ServerDeactivate. |
|
darope@0
|
225 |
</tt></blockquote> |
|
darope@0
|
226 |
<p><i>comments:</i><br> |
|
darope@0
|
227 |
<blockquote> |
|
darope@0
|
228 |
Added in SDK 2.0. |
|
darope@0
|
229 |
Apparently called when the server has loaded the map, but before it |
|
darope@0
|
230 |
precaches from the <tt><b>.res</b></tt> file. |
|
darope@0
|
231 |
</blockquote> |
|
darope@0
|
232 |
|
|
darope@0
|
233 |
<hr><h3><tt><a name="ServerDeactivate">ServerDeactivate</a></tt></h3> |
|
darope@0
|
234 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
235 |
<dd><tt>void ServerDeactivate(void);</tt><p> |
|
darope@0
|
236 |
<blockquote><tt> |
|
darope@0
|
237 |
Peform any shutdown operations here.<br> |
|
darope@0
|
238 |
It's possible that the engine will call this function more times than |
|
darope@0
|
239 |
is necessary. Therefore, only run it one time for each call to |
|
darope@0
|
240 |
ServerActivate.<br> |
|
darope@0
|
241 |
</tt></blockquote> |
|
darope@0
|
242 |
<p><i>comments:</i><br> |
|
darope@0
|
243 |
<blockquote> |
|
darope@0
|
244 |
Called upon <tt>"<b>quit</b>"</tt> or <tt>"<b>changelevel</b>"</tt> . |
|
darope@0
|
245 |
</blockquote> |
|
darope@0
|
246 |
|
|
darope@0
|
247 |
<hr><h3><tt><a name="PlayerPreThink">PlayerPreThink</a></tt></h3> |
|
darope@0
|
248 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
249 |
<dd><tt>void PlayerPreThink(edict_t *pEntity);</tt><p> |
|
darope@0
|
250 |
<blockquote><tt> |
|
darope@0
|
251 |
Called every frame before physics are run. |
|
darope@0
|
252 |
</tt></blockquote> |
|
darope@0
|
253 |
|
|
darope@0
|
254 |
<hr><h3><tt><a name="PlayerPostThink">PlayerPostThink</a></tt></h3> |
|
darope@0
|
255 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
256 |
<dd><tt>void PlayerPostThink(edict_t *pEntity);</tt><p> |
|
darope@0
|
257 |
<blockquote><tt> |
|
darope@0
|
258 |
Called every frame after physics are run. |
|
darope@0
|
259 |
</tt></blockquote> |
|
darope@0
|
260 |
|
|
darope@0
|
261 |
<hr><h3><tt><a name="StartFrame">StartFrame</a></tt></h3> |
|
darope@0
|
262 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
263 |
<dd><tt>void StartFrame(void);</tt><p> |
|
darope@0
|
264 |
<blockquote><tt> |
|
darope@0
|
265 |
GLOBALS ASSUMED SET: g_ulFrameCount |
|
darope@0
|
266 |
</tt></blockquote> |
|
darope@0
|
267 |
|
|
darope@0
|
268 |
<hr><h3><tt><a name="ParmsNewLevel">ParmsNewLevel</a></tt></h3> |
|
darope@0
|
269 |
<i>from dlls/client.cpp</i><br> |
|
darope@0
|
270 |
<dd><tt>void ParmsNewLevel(void);</tt><p> |
|
darope@0
|
271 |
|
|
darope@0
|
272 |
<hr><h3><tt><a name="ParmsChangeLevel">ParmsChangeLevel</a></tt></h3> |
|
darope@0
|
273 |
<i>from dlls/client.cpp</i><br> |
|
darope@0
|
274 |
<dd><tt>void ParmsChangeLevel(void);</tt><p> |
|
darope@0
|
275 |
|
|
darope@0
|
276 |
<hr><h3><tt><a name="GetGameDescription">GetGameDescription</a></tt></h3> |
|
darope@0
|
277 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
278 |
<dd><tt>const char *GetGameDescription(void);</tt><p> |
|
darope@0
|
279 |
<blockquote><tt> |
|
darope@0
|
280 |
Returns string describing current .dll game.<br> |
|
darope@0
|
281 |
Returns the descriptive name of this .dll. E.g., Half-Life, or Team |
|
darope@0
|
282 |
Fortress 2.<br> |
|
darope@0
|
283 |
This function might be called before the world has spawned, and the game |
|
darope@0
|
284 |
rules initialized.<br> |
|
darope@0
|
285 |
</tt></blockquote> |
|
darope@0
|
286 |
|
|
darope@0
|
287 |
<hr><h3><tt><a name="PlayerCustomization">PlayerCustomization</a></tt></h3> |
|
darope@0
|
288 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
289 |
<dd><tt>void PlayerCustomization(edict_t *pEntity, customization_t *pCust);</tt><p> |
|
darope@0
|
290 |
<blockquote><tt> |
|
darope@0
|
291 |
Notifies .dll of new customization for player.<br> |
|
darope@0
|
292 |
A new player customization has been registered on the server. |
|
darope@0
|
293 |
UNDONE: This only sets the # of frames of the spray can logo animation |
|
darope@0
|
294 |
right now.<br> |
|
darope@0
|
295 |
</tt></blockquote> |
|
darope@0
|
296 |
|
|
darope@0
|
297 |
<hr><h3><tt><a name="SpectatorConnect">SpectatorConnect</a></tt></h3> |
|
darope@0
|
298 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
299 |
<dd><tt>void SpectatorConnect(edict_t *pEntity);</tt><p> |
|
darope@0
|
300 |
<blockquote><tt> |
|
darope@0
|
301 |
Called when spectator joins server.<br> |
|
darope@0
|
302 |
A spectator has joined the game.<br> |
|
darope@0
|
303 |
</tt></blockquote> |
|
darope@0
|
304 |
|
|
darope@0
|
305 |
<hr><h3><tt><a name="SpectatorDisconnect">SpectatorDisconnect</a></tt></h3> |
|
darope@0
|
306 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
307 |
<dd><tt>void SpectatorDisconnect(edict_t *pEntity);</tt><p> |
|
darope@0
|
308 |
<blockquote><tt> |
|
darope@0
|
309 |
Called when spectator leaves the server.<br> |
|
darope@0
|
310 |
A spectator has left the game.<br> |
|
darope@0
|
311 |
</tt></blockquote> |
|
darope@0
|
312 |
|
|
darope@0
|
313 |
<hr><h3><tt><a name="SpectatorThink">SpectatorThink</a></tt></h3> |
|
darope@0
|
314 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
315 |
<dd><tt>void SpectatorThink(edict_t *pEntity);</tt><p> |
|
darope@0
|
316 |
<blockquote><tt> |
|
darope@0
|
317 |
Called when spectator sends a command packet (usercmd_t).<br> |
|
darope@0
|
318 |
A spectator has sent a usercmd.<br> |
|
darope@0
|
319 |
</tt></blockquote> |
|
darope@0
|
320 |
|
|
darope@0
|
321 |
<hr><h3><tt><a name="Sys_Error">Sys_Error</a></tt></h3> |
|
darope@0
|
322 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
323 |
<dd><tt>void Sys_Error(const char *error_string);</tt><p> |
|
darope@0
|
324 |
<blockquote><tt> |
|
darope@0
|
325 |
Called when engine has encountered an error.<br> |
|
darope@0
|
326 |
Notify game .dll that engine is going to shut down.<br> |
|
darope@0
|
327 |
Engine is going to shut down, allows setting a breakpoint in game dll |
|
darope@0
|
328 |
to catch that occasion.<br> |
|
darope@0
|
329 |
Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for |
|
darope@0
|
330 |
debugging your game .dlls.<br> |
|
darope@0
|
331 |
</tt></blockquote> |
|
darope@0
|
332 |
<p><i>comments:</i><br> |
|
darope@0
|
333 |
<blockquote> |
|
darope@0
|
334 |
Added in SDK 2.0. |
|
darope@0
|
335 |
</blockquote> |
|
darope@0
|
336 |
|
|
darope@0
|
337 |
<hr><h3><tt><a name="PM_Move">PM_Move</a></tt></h3> |
|
darope@0
|
338 |
<i>from pm_shared/pm_shared.c:</i><br> |
|
darope@0
|
339 |
<dd><tt>void PM_Move(struct playermove_s *ppmove, int server);</tt><p> |
|
darope@0
|
340 |
<blockquote><tt> |
|
darope@0
|
341 |
This modume implements the shared player physics code between |
|
darope@0
|
342 |
any particular game and the engine. The same PM_Move routine is built |
|
darope@0
|
343 |
into the game .dll and the client .dll and is invoked by each side as |
|
darope@0
|
344 |
appropriate. There should be no distinction, internally, between server |
|
darope@0
|
345 |
and client. This will ensure that prediction behaves appropriately. |
|
darope@0
|
346 |
</tt></blockquote> |
|
darope@0
|
347 |
<p><i>comments:</i><br> |
|
darope@0
|
348 |
<blockquote> |
|
darope@0
|
349 |
Added in SDK 2.0. |
|
darope@0
|
350 |
</blockquote> |
|
darope@0
|
351 |
|
|
darope@0
|
352 |
<hr><h3><tt><a name="PM_Init">PM_Init</a></tt></h3> |
|
darope@0
|
353 |
<i>from pm_shared/pm_shared.c:</i> |
|
darope@0
|
354 |
<dd><tt>void PM_Init(struct playermove_s *ppmove);</tt><p> |
|
darope@0
|
355 |
<blockquote><tt> |
|
darope@0
|
356 |
Server version of player movement initialization. |
|
darope@0
|
357 |
</tt></blockquote> |
|
darope@0
|
358 |
<p><i>comments:</i><br> |
|
darope@0
|
359 |
<blockquote> |
|
darope@0
|
360 |
Added in SDK 2.0. |
|
darope@0
|
361 |
</blockquote> |
|
darope@0
|
362 |
|
|
darope@0
|
363 |
<hr><h3><tt><a name="PM_FindTextureType">PM_FindTextureType</a></tt></h3> |
|
darope@0
|
364 |
<i>from pm_shared/pm_shared.c</i><br> |
|
darope@0
|
365 |
<dd><tt>char PM_FindTextureType(char *name);</tt><p> |
|
darope@0
|
366 |
<p><i>comments:</i><br> |
|
darope@0
|
367 |
<blockquote> |
|
darope@0
|
368 |
Added in SDK 2.0. |
|
darope@0
|
369 |
</blockquote> |
|
darope@0
|
370 |
|
|
darope@0
|
371 |
<hr><h3><tt><a name="SetupVisibility">SetupVisibility</a></tt></h3> |
|
darope@0
|
372 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
373 |
<dd><tt>void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);</tt><p> |
|
darope@0
|
374 |
<i>from dlls/client.cpp:</i> |
|
darope@0
|
375 |
<blockquote><tt> |
|
darope@0
|
376 |
Set up PVS and PAS for networking for this client. |
|
darope@0
|
377 |
<p> |
|
darope@0
|
378 |
A client can have a separate "view entity" indicating |
|
darope@0
|
379 |
that his/her view should depend on the origin of that view entity. If |
|
darope@0
|
380 |
that's the case, then pViewEntity will be non-NULL and will be used. |
|
darope@0
|
381 |
Otherwise, the current entity's origin is used. Either is offset by the |
|
darope@0
|
382 |
view_ofs to get the eye position. |
|
darope@0
|
383 |
<p> |
|
darope@0
|
384 |
From the eye position, we set up the PAS and PVS to use for filtering |
|
darope@0
|
385 |
network messages to the client. At this point, we could override the |
|
darope@0
|
386 |
actual PAS or PVS values, or use a different origin. |
|
darope@0
|
387 |
<p> |
|
darope@0
|
388 |
NOTE: Do not cache the values of pas and pvs, as they depend on |
|
darope@0
|
389 |
reusable memory in the engine, they are only good for this one frame |
|
darope@0
|
390 |
</tt></blockquote> |
|
darope@0
|
391 |
<p><i>comments:</i><br> |
|
darope@0
|
392 |
<blockquote> |
|
darope@0
|
393 |
Added in SDK 2.0. |
|
darope@0
|
394 |
</blockquote> |
|
darope@0
|
395 |
|
|
darope@0
|
396 |
<hr><h3><tt><a name="UpdateClientData">UpdateClientData</a></tt></h3> |
|
darope@0
|
397 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
398 |
<dd><tt>void UpdateClientData (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);</tt><p> |
|
darope@0
|
399 |
<blockquote><tt> |
|
darope@0
|
400 |
Set up data sent only to specific client.<br> |
|
darope@0
|
401 |
Data sent to current client only.<br> |
|
darope@0
|
402 |
Engine sets argument 'cd' to 0 before calling.<br> |
|
darope@0
|
403 |
</tt></blockquote> |
|
darope@0
|
404 |
<p><i>comments:</i><br> |
|
darope@0
|
405 |
<blockquote> |
|
darope@0
|
406 |
Added in SDK 2.0. |
|
darope@0
|
407 |
</blockquote> |
|
darope@0
|
408 |
|
|
darope@0
|
409 |
<hr><h3><tt><a name="AddToFullPack">AddToFullPack</a></tt></h3> |
|
darope@0
|
410 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
411 |
<dd><tt>int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet);</tt><p> |
|
darope@0
|
412 |
<blockquote><tt> |
|
darope@0
|
413 |
Return 1 if the entity state has been filled in for the ent and the |
|
darope@0
|
414 |
entity will be propagated to the client, 0 otherwise. |
|
darope@0
|
415 |
<p> |
|
darope@0
|
416 |
State is the server maintained copy of the state info that is |
|
darope@0
|
417 |
transmitted to the client. A MOD could alter values copied into state |
|
darope@0
|
418 |
to send the "host" a different look for a particular entity update, |
|
darope@0
|
419 |
etc. |
|
darope@0
|
420 |
<p> |
|
darope@0
|
421 |
Arguments 'e' and 'ent' are the entity that is being added to the |
|
darope@0
|
422 |
update, if 1 is returneds. Host is the player's edict of the player |
|
darope@0
|
423 |
whom we are sending the update to. Player is 1 if the ent/e is a |
|
darope@0
|
424 |
player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that |
|
darope@0
|
425 |
we previous set up. We can use it to ask the engine to filter the |
|
darope@0
|
426 |
entity against the PAS or PVS. |
|
darope@0
|
427 |
<p> |
|
darope@0
|
428 |
We could also use the pas/ pvs that we set in SetupVisibility, if we |
|
darope@0
|
429 |
wanted to. Caching the value is valid in that case, but still only for |
|
darope@0
|
430 |
the current frame. |
|
darope@0
|
431 |
</tt></blockquote> |
|
darope@0
|
432 |
<p><i>comments:</i><br> |
|
darope@0
|
433 |
<blockquote> |
|
darope@0
|
434 |
Added in SDK 2.0. |
|
darope@0
|
435 |
</blockquote> |
|
darope@0
|
436 |
|
|
darope@0
|
437 |
<hr><h3><tt><a name="CreateBaseline">CreateBaseline</a></tt></h3> |
|
darope@0
|
438 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
439 |
<dd><tt>void CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs);</tt><p> |
|
darope@0
|
440 |
<blockquote><tt> |
|
darope@0
|
441 |
Tweak entity baseline for network encoding, allows setup of player |
|
darope@0
|
442 |
baselines, too.<br> |
|
darope@0
|
443 |
Creates baselines used for network encoding, especially for player data |
|
darope@0
|
444 |
since players are not spawned until connect time.<br> |
|
darope@0
|
445 |
</tt></blockquote> |
|
darope@0
|
446 |
<p><i>comments:</i><br> |
|
darope@0
|
447 |
<blockquote> |
|
darope@0
|
448 |
Added in SDK 2.0. |
|
darope@0
|
449 |
</blockquote> |
|
darope@0
|
450 |
|
|
darope@0
|
451 |
<hr><h3><tt><a name="RegisterEncoders">RegisterEncoders</a></tt></h3> |
|
darope@0
|
452 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
453 |
<dd><tt>void RegisterEncoders(void);</tt><p> |
|
darope@0
|
454 |
<blockquote><tt> |
|
darope@0
|
455 |
Callbacks for network encoding.<br> |
|
darope@0
|
456 |
Allows game .dll to override network encoding of certain types of |
|
darope@0
|
457 |
entities and tweak values, etc.<br> |
|
darope@0
|
458 |
</tt></blockquote> |
|
darope@0
|
459 |
<p><i>comments:</i><br> |
|
darope@0
|
460 |
<blockquote> |
|
darope@0
|
461 |
Added in SDK 2.0. |
|
darope@0
|
462 |
</blockquote> |
|
darope@0
|
463 |
|
|
darope@0
|
464 |
<hr><h3><tt><a name="GetWeaponData">GetWeaponData</a></tt></h3> |
|
darope@0
|
465 |
<i>from dlls/client.cpp</i><br> |
|
darope@0
|
466 |
<dd><tt>int GetWeaponData(struct edict_s *player, struct weapon_data_s *info);</tt><p> |
|
darope@0
|
467 |
<p><i>comments:</i><br> |
|
darope@0
|
468 |
<blockquote> |
|
darope@0
|
469 |
Added in SDK 2.0. |
|
darope@0
|
470 |
</blockquote> |
|
darope@0
|
471 |
|
|
darope@0
|
472 |
<hr><h3><tt><a name="CmdStart">CmdStart</a></tt></h3> |
|
darope@0
|
473 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
474 |
<dd><tt>void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);</tt><p> |
|
darope@0
|
475 |
<blockquote><tt> |
|
darope@0
|
476 |
We're about to run this usercmd for the specified player. We can set |
|
darope@0
|
477 |
up groupinfo and masking here, etc. This is the time to examine the |
|
darope@0
|
478 |
usercmd for anything extra. This call happens even if think does not. |
|
darope@0
|
479 |
</tt></blockquote> |
|
darope@0
|
480 |
<p><i>comments:</i><br> |
|
darope@0
|
481 |
<blockquote> |
|
darope@0
|
482 |
Added in SDK 2.0. |
|
darope@0
|
483 |
</blockquote> |
|
darope@0
|
484 |
|
|
darope@0
|
485 |
<hr><h3><tt><a name="CmdEnd">CmdEnd</a></tt></h3> |
|
darope@0
|
486 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
487 |
<dd><tt>void CmdEnd (const edict_t *player);</tt><p> |
|
darope@0
|
488 |
<blockquote><tt> |
|
darope@0
|
489 |
Each cmdstart is exactly matched with a cmd end, clean up any |
|
darope@0
|
490 |
group trace flags, etc. here. |
|
darope@0
|
491 |
</tt></blockquote> |
|
darope@0
|
492 |
<p><i>comments:</i><br> |
|
darope@0
|
493 |
<blockquote> |
|
darope@0
|
494 |
Added in SDK 2.0. |
|
darope@0
|
495 |
</blockquote> |
|
darope@0
|
496 |
|
|
darope@0
|
497 |
<hr><h3><tt><a name="ConnectionlessPacket">ConnectionlessPacket</a></tt></h3> |
|
darope@0
|
498 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
499 |
<dd><tt>int ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);</tt> |
|
darope@0
|
500 |
<blockquote><tt> |
|
darope@0
|
501 |
Return 1 if the packet is valid. Set response_buffer_size if you want |
|
darope@0
|
502 |
to send a response packet. Incoming, it holds the max size of the |
|
darope@0
|
503 |
response_buffer, so you must zero it out if you choose not to respond. |
|
darope@0
|
504 |
</tt></blockquote> |
|
darope@0
|
505 |
<p><i>comments:</i><br> |
|
darope@0
|
506 |
<blockquote> |
|
darope@0
|
507 |
Added in SDK 2.0. |
|
darope@0
|
508 |
</blockquote> |
|
darope@0
|
509 |
|
|
darope@0
|
510 |
<hr><h3><tt><a name="GetHullBounds">GetHullBounds</a></tt></h3> |
|
darope@0
|
511 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
512 |
<dd><tt>int GetHullBounds(int hullnumber, float *mins, float *maxs);</tt><p> |
|
darope@0
|
513 |
<blockquote><tt> |
|
darope@0
|
514 |
Engine calls this to enumerate player collision hulls, |
|
darope@0
|
515 |
for prediction. Return 0 if the hullnumber doesn't exist. |
|
darope@0
|
516 |
</tt></blockquote> |
|
darope@0
|
517 |
<p><i>comments:</i><br> |
|
darope@0
|
518 |
<blockquote> |
|
darope@0
|
519 |
Added in SDK 2.0. |
|
darope@0
|
520 |
</blockquote> |
|
darope@0
|
521 |
|
|
darope@0
|
522 |
<hr><h3><tt><a name="CreateInstancedBaselines">CreateInstancedBaselines</a></tt></h3> |
|
darope@0
|
523 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
524 |
<dd><tt>void CreateInstancedBaselines (void);</tt><p> |
|
darope@0
|
525 |
<blockquote><tt> |
|
darope@0
|
526 |
Tweak entity baseline for network encoding, allows setup of player baselines, too.<br> |
|
darope@0
|
527 |
Create pseudo-baselines for items that aren't placed in the map at |
|
darope@0
|
528 |
spawn time, but which are likely to be created during play (e.g., |
|
darope@0
|
529 |
grenades, ammo packs, projectiles, corpses, etc.).<br> |
|
darope@0
|
530 |
</tt></blockquote> |
|
darope@0
|
531 |
<p><i>comments:</i><br> |
|
darope@0
|
532 |
<blockquote> |
|
darope@0
|
533 |
Added in SDK 2.0. |
|
darope@0
|
534 |
</blockquote> |
|
darope@0
|
535 |
|
|
darope@0
|
536 |
<hr><h3><tt><a name="InconsistentFile">InconsistentFile</a></tt></h3> |
|
darope@0
|
537 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
538 |
<dd><tt>int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message);</tt> |
|
darope@0
|
539 |
<blockquote><tt> |
|
darope@0
|
540 |
One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check |
|
darope@0
|
541 |
for the specified player Return 0 to allow the client to continue, 1 to |
|
darope@0
|
542 |
force immediate disconnection (with an optional disconnect message of |
|
darope@0
|
543 |
up to 256 characters). |
|
darope@0
|
544 |
</tt></blockquote> |
|
darope@0
|
545 |
<p><i>comments:</i><br> |
|
darope@0
|
546 |
<blockquote> |
|
darope@0
|
547 |
Added in SDK 2.0. |
|
darope@0
|
548 |
</blockquote> |
|
darope@0
|
549 |
|
|
darope@0
|
550 |
<hr><h3><tt><a name="AllowLagCompensation">AllowLagCompensation</a></tt></h3> |
|
darope@0
|
551 |
<i>from dlls/client.cpp:</i><br> |
|
darope@0
|
552 |
<dd><tt>int AllowLagCompensation(void);</tt><p> |
|
darope@0
|
553 |
<blockquote><tt> |
|
darope@0
|
554 |
The game .dll should return 1 if lag compensation should be allowed |
|
darope@0
|
555 |
(could also just set the sv_unlag cvar. Most games right now should |
|
darope@0
|
556 |
return 0, until client-side weapon prediction code is written and |
|
darope@0
|
557 |
tested for them (note you can predict weapons, but not do lag |
|
darope@0
|
558 |
compensation, too, if you want. |
|
darope@0
|
559 |
</tt></blockquote> |
|
darope@0
|
560 |
<p><i>comments:</i><br> |
|
darope@0
|
561 |
<blockquote> |
|
darope@0
|
562 |
Added in SDK 2.0. |
|
darope@0
|
563 |
</blockquote> |
|
darope@0
|
564 |
|
|
darope@0
|
565 |
<p> |
|
darope@0
|
566 |
<hr> |
|
darope@0
|
567 |
|
|
darope@0
|
568 |
</body> |
|
darope@0
|
569 |
</HTML> |