… | |
… | |
198 | cp = getenv ("CROSSFIRE_TMPDIR"); |
198 | cp = getenv ("CROSSFIRE_TMPDIR"); |
199 | if (cp) |
199 | if (cp) |
200 | settings.tmpdir = cp; |
200 | settings.tmpdir = cp; |
201 | } |
201 | } |
202 | |
202 | |
203 | |
|
|
204 | /* |
203 | /* |
205 | * Initialises all global variables. |
204 | * Initialises all global variables. |
206 | * Might use environment-variables as default for some of them. |
205 | * Might use environment-variables as default for some of them. |
207 | */ |
206 | */ |
208 | |
|
|
209 | void |
207 | void |
210 | init_globals (void) |
208 | init_globals (void) |
211 | { |
209 | { |
212 | if (settings.logfilename[0] == 0) |
210 | if (settings.logfilename[0] == 0) |
213 | logfile = stderr; |
211 | logfile = stderr; |
… | |
… | |
250 | |
248 | |
251 | /* |
249 | /* |
252 | * Write out the current time to the file so time does not |
250 | * Write out the current time to the file so time does not |
253 | * reset every time the server reboots. |
251 | * reset every time the server reboots. |
254 | */ |
252 | */ |
255 | |
|
|
256 | void |
253 | void |
257 | write_todclock (void) |
254 | write_todclock (void) |
258 | { |
255 | { |
259 | char filename[MAX_BUF]; |
256 | char filename[MAX_BUF]; |
260 | FILE *fp; |
257 | FILE *fp; |
… | |
… | |
271 | |
268 | |
272 | /* |
269 | /* |
273 | * initialises the gametime and TOD counters |
270 | * initialises the gametime and TOD counters |
274 | * Called by init_library(). |
271 | * Called by init_library(). |
275 | */ |
272 | */ |
276 | |
|
|
277 | void |
273 | void |
278 | init_clocks (void) |
274 | init_clocks (void) |
279 | { |
275 | { |
280 | char filename[MAX_BUF]; |
276 | char filename[MAX_BUF]; |
281 | FILE *fp; |
277 | FILE *fp; |
… | |
… | |
293 | LOG (llevError, "Can't open %s.\n", filename); |
289 | LOG (llevError, "Can't open %s.\n", filename); |
294 | todtick = 0; |
290 | todtick = 0; |
295 | write_todclock (); |
291 | write_todclock (); |
296 | return; |
292 | return; |
297 | } |
293 | } |
|
|
294 | |
298 | fscanf (fp, "%lu", &todtick); |
295 | fscanf (fp, "%lu", &todtick); |
299 | LOG (llevDebug, "todtick=%lu\n", todtick); |
296 | LOG (llevDebug, "todtick=%lu\n", todtick); |
300 | fclose (fp); |
297 | fclose (fp); |
301 | } |
298 | } |
302 | |
299 | |