Debian Codegraph @

src/bnetd/prefs.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 1998,1999,2000,2001 Ross Combs ([email protected])
3 * Copyright (C) 1999 Rob Crittenden ([email protected])
4 * Copyright (C) 1999 Mark Baysinger ([email protected])
5 * Copyright (C) 2004,2005 Dizzy
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21 #include "common/setup_before.h"
22 #define PREFS_INTERNAL_ACCESS
23 #include "prefs.h"
24
25 #include <cstdio>
26
27 #include "common/conf.h"
28 #include "common/eventlog.h"
29 #include "common/setup_after.h"
30
31 #define NONE 0
32
33 namespace pvpgn
34 {
35
36 namespace bnetd
37 {
38
39 static struct {
40 /* files and paths */
41 char const * filedir;
42 char const * i18ndir;
43 char const * storage_path;
44 char const * logfile;
45 char const * loglevels;
46 char const * localizefile;
47 char const * motdfile;
48 char const * motdw3file;
49 char const * newsfile;
50 char const * channelfile;
51 char const * pidfile;
52 char const * adfile;
53 char const * topicfile;
54 char const * DBlayoutfile;
55
56 unsigned int usersync;
57 unsigned int userflush;
58 unsigned int userflush_connected;
59 unsigned int userstep;
60
61 char const * servername;
62 char const * hostname;
63
64 unsigned int track;
65 char const * location;
66 char const * description;
67 char const * url;
68 char const * contact_name;
69 char const * contact_email;
70 unsigned int latency;
71 unsigned int irc_latency;
72 unsigned int shutdown_delay;
73 unsigned int shutdown_decr;
74 unsigned int new_accounts;
75 unsigned int max_accounts;
76 unsigned int kick_old_login;
77 unsigned int ask_new_channel;
78 unsigned int hide_pass_games;
79 unsigned int hide_started_games;
80 unsigned int hide_temp_channels;
81 unsigned int hide_addr;
82 unsigned int enable_conn_all;
83 char const * reportdir;
84 unsigned int report_all_games;
85 unsigned int report_diablo_games;
86 char const * iconfile;
87 char const * war3_iconfile;
88 char const * star_iconfile;
89 char const * tosfile;
90 char const * mpqfile;
91 char const * trackaddrs;
92 char const * servaddrs;
93 char const * w3routeaddr;
94 char const * ircaddrs;
95 unsigned int use_keepalive;
96 unsigned int udptest_port;
97 char const * ipbanfile;
98 unsigned int disc_is_loss;
99 char const * helpfile;
100 char const * transfile;
101 unsigned int chanlog;
102 char const * chanlogdir;
103 char const * userlogdir;
104 unsigned int quota;
105 unsigned int quota_lines;
106 unsigned int quota_time;
107 unsigned int quota_wrapline;
108 unsigned int quota_maxline;
109 unsigned int ladder_init_rating;
110 unsigned int quota_dobae;
111 char const * realmfile;
112 char const * issuefile;
113 char const * effective_user;
114 char const * effective_group;
115 unsigned int nullmsg;
116 unsigned int mail_support;
117 unsigned int mail_quota;
118 char const * maildir;
119 char const * log_notice;
120 unsigned int savebyname;
121 unsigned int allow_bad_version;
122 unsigned int allow_unknown_version;
123 char const * versioncheck_file;
124 unsigned int d2cs_version;
125 unsigned int allow_d2cs_setname;
126 unsigned int hashtable_size;
127 char const * telnetaddrs;
128 unsigned int ipban_check_int;
129 char const * version_exeinfo_match;
130 unsigned int version_exeinfo_maxdiff;
131 unsigned int max_concurrent_logins;
132 char const * mapsfile;
133 char const * xplevelfile;
134 char const * xpcalcfile;
135 unsigned int initkill_timer;
136 unsigned int war3_ladder_update_secs;
137 unsigned int output_update_secs;
138 char const * ladderdir;
139 char const * statusdir;
140 unsigned int XML_output_ladder;
141 unsigned int XML_status_output;
142 char const * account_allowed_symbols;
143 unsigned int account_force_username;
144 char const * command_groups_file;
145 char const * tournament_file;
146 char const * customicons_file;
147 char const * scriptdir;
148 char const * aliasfile;
149 char const * anongame_infos_file;
150 unsigned int max_conns_per_IP;
151 unsigned int max_friends;
152 unsigned int clan_newer_time;
153 unsigned int clan_max_members;
154 unsigned int clan_channel_default_private;
155 unsigned int clan_min_invites;
156 unsigned int passfail_count;
157 unsigned int passfail_bantime;
158 unsigned int maxusers_per_channel;
159 char const * supportfile;
160 char const * allowed_clients;
161 char const * ladder_games;
162 char const * ladder_prefix;
163 unsigned int max_connections;
164 unsigned int packet_limit;
165 unsigned int sync_on_logoff;
166 char const * irc_network_name;
167 unsigned int localize_by_country;
168 unsigned int log_commands;
169 char const * log_command_groups;
170 char const * log_command_list;
171
172 char const * apiregaddrs;
173 char const * wolv1addrs;
174 char const * wolv2addrs;
175 char const * wgameresaddrs;
176 char const * woltimezone;
177 char const * wollongitude;
178 char const * wollatitude;
179 char const * wol_autoupdate_serverhost;
180 char const * wol_autoupdate_username;
181 char const * wol_autoupdate_password;
182 } prefs_runtime_config;
183
184 static int conf_set_filedir(const char *valstr);
185 static const char *conf_get_filedir(void);
186 static int conf_setdef_filedir(void);
187
188 static int conf_set_i18ndir(const char *valstr);
189 static const char *conf_get_i18ndir(void);
190 static int conf_setdef_i18ndir(void);
191
192 static int conf_set_storage_path(const char *valstr);
193 static const char *conf_get_storage_path(void);
194 static int conf_setdef_storage_path(void);
195
196 static int conf_set_logfile(const char *valstr);
197 static const char *conf_get_logfile(void);
198 static int conf_setdef_logfile(void);
199
200 static int conf_set_loglevels(const char *valstr);
201 static const char *conf_get_loglevels(void);
202 static int conf_setdef_loglevels(void);
203
204 static int conf_set_localizefile(const char *valstr);
205 static const char *conf_get_localizefile(void);
206 static int conf_setdef_localizefile(void);
207
208 static int conf_set_motdfile(const char *valstr);
209 static const char *conf_get_motdfile(void);
210 static int conf_setdef_motdfile(void);
211
212 static int conf_set_motdw3file(const char *valstr);
213 static const char *conf_get_motdw3file(void);
214 static int conf_setdef_motdw3file(void);
215
216 static int conf_set_newsfile(const char *valstr);
217 static const char *conf_get_newsfile(void);
218 static int conf_setdef_newsfile(void);
219
220 static int conf_set_channelfile(const char *valstr);
221 static const char *conf_get_channelfile(void);
222 static int conf_setdef_channelfile(void);
223
224 static int conf_set_pidfile(const char *valstr);
225 static const char *conf_get_pidfile(void);
226 static int conf_setdef_pidfile(void);
227
228 static int conf_set_adfile(const char *valstr);
229 static const char *conf_get_adfile(void);
230 static int conf_setdef_adfile(void);
231
232 static int conf_set_topicfile(const char *valstr);
233 static const char *conf_get_topicfile(void);
234 static int conf_setdef_topicfile(void);
235
236 static int conf_set_DBlayoutfile(const char *valstr);
237 static const char *conf_get_DBlayoutfile(void);
238 static int conf_setdef_DBlayoutfile(void);
239
240 static int conf_set_supportfile(const char *valstr);
241 static const char *conf_get_supportfile(void);
242 static int conf_setdef_supportfile(void);
243
244 static int conf_set_usersync(const char *valstr);
245 static const char *conf_get_usersync(void);
246 static int conf_setdef_usersync(void);
247
248 static int conf_set_userflush(const char *valstr);
249 static const char *conf_get_userflush(void);
250 static int conf_setdef_userflush(void);
251
252 static int conf_set_userflush_connected(const char *valstr);
253 static const char *conf_get_userflush_connected(void);
254 static int conf_setdef_userflush_connected(void);
255
256 static int conf_set_userstep(const char *valstr);
257 static const char *conf_get_userstep(void);
258 static int conf_setdef_userstep(void);
259
260 static int conf_set_servername(const char *valstr);
261 static const char *conf_get_servername(void);
262 static int conf_setdef_servername(void);
263
264 static int conf_set_hostname(const char *valstr);
265 static const char *conf_get_hostname(void);
266 static int conf_setdef_hostname(void);
267
268 static int conf_set_track(const char *valstr);
269 static const char *conf_get_track(void);
270 static int conf_setdef_track(void);
271
272 static int conf_set_location(const char *valstr);
273 static const char *conf_get_location(void);
274 static int conf_setdef_location(void);
275
276 static int conf_set_description(const char *valstr);
277 static const char *conf_get_description(void);
278 static int conf_setdef_description(void);
279
280 static int conf_set_url(const char *valstr);
281 static const char *conf_get_url(void);
282 static int conf_setdef_url(void);
283
284 static int conf_set_contact_name(const char *valstr);
285 static const char *conf_get_contact_name(void);
286 static int conf_setdef_contact_name(void);
287
288 static int conf_set_contact_email(const char *valstr);
289 static const char *conf_get_contact_email(void);
290 static int conf_setdef_contact_email(void);
291
292 static int conf_set_latency(const char *valstr);
293 static const char *conf_get_latency(void);
294 static int conf_setdef_latency(void);
295
296 static int conf_set_irc_latency(const char *valstr);
297 static const char *conf_get_irc_latency(void);
298 static int conf_setdef_irc_latency(void);
299
300 static int conf_set_shutdown_delay(const char *valstr);
301 static const char *conf_get_shutdown_delay(void);
302 static int conf_setdef_shutdown_delay(void);
303
304 static int conf_set_shutdown_decr(const char *valstr);
305 static const char *conf_get_shutdown_decr(void);
306 static int conf_setdef_shutdown_decr(void);
307
308 static int conf_set_new_accounts(const char *valstr);
309 static const char *conf_get_new_accounts(void);
310 static int conf_setdef_new_accounts(void);
311
312 static int conf_set_max_accounts(const char *valstr);
313 static const char *conf_get_max_accounts(void);
314 static int conf_setdef_max_accounts(void);
315
316 static int conf_set_kick_old_login(const char *valstr);
317 static const char *conf_get_kick_old_login(void);
318 static int conf_setdef_kick_old_login(void);
319
320 static int conf_set_ask_new_channel(const char *valstr);
321 static const char *conf_get_ask_new_channel(void);
322 static int conf_setdef_ask_new_channel(void);
323
324 static int conf_set_hide_pass_games(const char *valstr);
325 static const char *conf_get_hide_pass_games(void);
326 static int conf_setdef_hide_pass_games(void);
327
328 static int conf_set_hide_started_games(const char *valstr);
329 static const char *conf_get_hide_started_games(void);
330 static int conf_setdef_hide_started_games(void);
331
332 static int conf_set_hide_temp_channels(const char *valstr);
333 static const char *conf_get_hide_temp_channels(void);
334 static int conf_setdef_hide_temp_channels(void);
335
336 static int conf_set_hide_addr(const char *valstr);
337 static const char *conf_get_hide_addr(void);
338 static int conf_setdef_hide_addr(void);
339
340 static int conf_set_enable_conn_all(const char *valstr);
341 static const char *conf_get_enable_conn_all(void);
342 static int conf_setdef_enable_conn_all(void);
343
344 static int conf_set_reportdir(const char *valstr);
345 static const char *conf_get_reportdir(void);
346 static int conf_setdef_reportdir(void);
347
348 static int conf_set_report_all_games(const char *valstr);
349 static const char *conf_get_report_all_games(void);
350 static int conf_setdef_report_all_games(void);
351
352 static int conf_set_report_diablo_games(const char *valstr);
353 static const char *conf_get_report_diablo_games(void);
354 static int conf_setdef_report_diablo_games(void);
355
356 static int conf_set_iconfile(const char *valstr);
357 static const char *conf_get_iconfile(void);
358 static int conf_setdef_iconfile(void);
359
360 static int conf_set_war3_iconfile(const char *valstr);
361 static const char *conf_get_war3_iconfile(void);
362 static int conf_setdef_war3_iconfile(void);
363
364 static int conf_set_star_iconfile(const char *valstr);
365 static const char *conf_get_star_iconfile(void);
366 static int conf_setdef_star_iconfile(void);
367
368 static int conf_set_tosfile(const char *valstr);
369 static const char *conf_get_tosfile(void);
370 static int conf_setdef_tosfile(void);
371
372 static int conf_set_mpqfile(const char *valstr);
373 static const char *conf_get_mpqfile(void);
374 static int conf_setdef_mpqfile(void);
375
376 static int conf_set_trackaddrs(const char *valstr);
377 static const char *conf_get_trackaddrs(void);
378 static int conf_setdef_trackaddrs(void);
379
380 static int conf_set_servaddrs(const char *valstr);
381 static const char *conf_get_servaddrs(void);
382 static int conf_setdef_servaddrs(void);
383
384 static int conf_set_w3routeaddr(const char *valstr);
385 static const char *conf_get_w3routeaddr(void);
386 static int conf_setdef_w3routeaddr(void);
387
388 static int conf_set_ircaddrs(const char *valstr);
389 static const char *conf_get_ircaddrs(void);
390 static int conf_setdef_ircaddrs(void);
391
392 static int conf_set_use_keepalive(const char *valstr);
393 static const char *conf_get_use_keepalive(void);
394 static int conf_setdef_use_keepalive(void);
395
396 static int conf_set_udptest_port(const char *valstr);
397 static const char *conf_get_udptest_port(void);
398 static int conf_setdef_udptest_port(void);
399
400 static int conf_set_ipbanfile(const char *valstr);
401 static const char *conf_get_ipbanfile(void);
402 static int conf_setdef_ipbanfile(void);
403
404 static int conf_set_disc_is_loss(const char *valstr);
405 static const char *conf_get_disc_is_loss(void);
406 static int conf_setdef_disc_is_loss(void);
407
408 static int conf_set_helpfile(const char *valstr);
409 static const char *conf_get_helpfile(void);
410 static int conf_setdef_helpfile(void);
411
412 static int conf_set_transfile(const char *valstr);
413 static const char *conf_get_transfile(void);
414 static int conf_setdef_transfile(void);
415
416 static int conf_set_chanlog(const char *valstr);
417 static const char *conf_get_chanlog(void);
418 static int conf_setdef_chanlog(void);
419
420 static int conf_set_chanlogdir(const char *valstr);
421 static const char *conf_get_chanlogdir(void);
422 static int conf_setdef_chanlogdir(void);
423
424 static int conf_set_userlogdir(const char *valstr);
425 static const char *conf_get_userlogdir(void);
426 static int conf_setdef_userlogdir(void);
427
428 static int conf_set_quota(const char *valstr);
429 static const char *conf_get_quota(void);
430 static int conf_setdef_quota(void);
431
432 static int conf_set_quota_lines(const char *valstr);
433 static const char *conf_get_quota_lines(void);
434 static int conf_setdef_quota_lines(void);
435
436 static int conf_set_quota_time(const char *valstr);
437 static const char *conf_get_quota_time(void);
438 static int conf_setdef_quota_time(void);
439
440 static int conf_set_quota_wrapline(const char *valstr);
441 static const char *conf_get_quota_wrapline(void);
442 static int conf_setdef_quota_wrapline(void);
443
444 static int conf_set_quota_maxline(const char *valstr);
445 static const char *conf_get_quota_maxline(void);
446 static int conf_setdef_quota_maxline(void);
447
448 static int conf_set_ladder_init_rating(const char *valstr);
449 static const char *conf_get_ladder_init_rating(void);
450 static int conf_setdef_ladder_init_rating(void);
451
452 static int conf_set_quota_dobae(const char *valstr);
453 static const char *conf_get_quota_dobae(void);
454 static int conf_setdef_quota_dobae(void);
455
456 static int conf_set_realmfile(const char *valstr);
457 static const char *conf_get_realmfile(void);
458 static int conf_setdef_realmfile(void);
459
460 static int conf_set_issuefile(const char *valstr);
461 static const char *conf_get_issuefile(void);
462 static int conf_setdef_issuefile(void);
463
464 static int conf_set_effective_user(const char *valstr);
465 static const char *conf_get_effective_user(void);
466 static int conf_setdef_effective_user(void);
467
468 static int conf_set_effective_group(const char *valstr);
469 static const char *conf_get_effective_group(void);
470 static int conf_setdef_effective_group(void);
471
472 static int conf_set_nullmsg(const char *valstr);
473 static const char *conf_get_nullmsg(void);
474 static int conf_setdef_nullmsg(void);
475
476 static int conf_set_mail_support(const char *valstr);
477 static const char *conf_get_mail_support(void);
478 static int conf_setdef_mail_support(void);
479
480 static int conf_set_mail_quota(const char *valstr);
481 static const char *conf_get_mail_quota(void);
482 static int conf_setdef_mail_quota(void);
483
484 static int conf_set_maildir(const char *valstr);
485 static const char *conf_get_maildir(void);
486 static int conf_setdef_maildir(void);
487
488 static int conf_set_log_notice(const char *valstr);
489 static const char *conf_get_log_notice(void);
490 static int conf_setdef_log_notice(void);
491
492 static int conf_set_savebyname(const char *valstr);
493 static const char *conf_get_savebyname(void);
494 static int conf_setdef_savebyname(void);
495
496 static int conf_set_allow_bad_version(const char *valstr);
497 static const char *conf_get_allow_bad_version(void);
498 static int conf_setdef_allow_bad_version(void);
499
500 static int conf_set_allow_unknown_version(const char *valstr);
501 static const char *conf_get_allow_unknown_version(void);
502 static int conf_setdef_allow_unknown_version(void);
503
504 static int conf_set_versioncheck_file(const char *valstr);
505 static const char *conf_get_versioncheck_file(void);
506 static int conf_setdef_versioncheck_file(void);
507
508 static int conf_set_d2cs_version(const char *valstr);
509 static const char *conf_get_d2cs_version(void);
510 static int conf_setdef_d2cs_version(void);
511
512 static int conf_set_allow_d2cs_setname(const char *valstr);
513 static const char *conf_get_allow_d2cs_setname(void);
514 static int conf_setdef_allow_d2cs_setname(void);
515
516 static int conf_set_hashtable_size(const char *valstr);
517 static const char *conf_get_hashtable_size(void);
518 static int conf_setdef_hashtable_size(void);
519
520 static int conf_set_telnetaddrs(const char *valstr);
521 static const char *conf_get_telnetaddrs(void);
522 static int conf_setdef_telnetaddrs(void);
523
524 static int conf_set_ipban_check_int(const char *valstr);
525 static const char *conf_get_ipban_check_int(void);
526 static int conf_setdef_ipban_check_int(void);
527
528 static int conf_set_max_concurrent_logins(const char *valstr);
529 static const char *conf_get_max_concurrent_logins(void);
530 static int conf_setdef_max_concurrent_logins(void);
531
532 static int conf_set_mapsfile(const char *valstr);
533 static const char *conf_get_mapsfile(void);
534 static int conf_setdef_mapsfile(void);
535
536 static int conf_set_xplevelfile(const char *valstr);
537 static const char *conf_get_xplevelfile(void);
538 static int conf_setdef_xplevelfile(void);
539
540 static int conf_set_xpcalcfile(const char *valstr);
541 static const char *conf_get_xpcalcfile(void);
542 static int conf_setdef_xpcalcfile(void);
543
544 static int conf_set_initkill_timer(const char *valstr);
545 static const char *conf_get_initkill_timer(void);
546 static int conf_setdef_initkill_timer(void);
547
548 static int conf_set_war3_ladder_update_secs(const char *valstr);
549 static const char *conf_get_war3_ladder_update_secs(void);
550 static int conf_setdef_war3_ladder_update_secs(void);
551
552 static int conf_set_output_update_secs(const char *valstr);
553 static const char *conf_get_output_update_secs(void);
554 static int conf_setdef_output_update_secs(void);
555
556 static int conf_set_ladderdir(const char *valstr);
557 static const char *conf_get_ladderdir(void);
558 static int conf_setdef_ladderdir(void);
559
560 static int conf_set_statusdir(const char *valstr);
561 static const char *conf_get_statusdir(void);
562 static int conf_setdef_statusdir(void);
563
564 static int conf_set_XML_output_ladder(const char *valstr);
565 static const char *conf_get_XML_output_ladder(void);
566 static int conf_setdef_XML_output_ladder(void);
567
568 static int conf_set_XML_status_output(const char *valstr);
569 static const char *conf_get_XML_status_output(void);
570 static int conf_setdef_XML_status_output(void);
571
572 static int conf_set_account_allowed_symbols(const char *valstr);
573 static const char *conf_get_account_allowed_symbols(void);
574 static int conf_setdef_account_allowed_symbols(void);
575
576 static int conf_set_account_force_username(const char *valstr);
577 static const char *conf_get_account_force_username(void);
578 static int conf_setdef_account_force_username(void);
579
580 static int conf_set_command_groups_file(const char *valstr);
581 static const char *conf_get_command_groups_file(void);
582 static int conf_setdef_command_groups_file(void);
583
584 static int conf_set_tournament_file(const char *valstr);
585 static const char *conf_get_tournament_file(void);
586 static int conf_setdef_tournament_file(void);
587
588 static int conf_set_customicons_file(const char *valstr);
589 static const char *conf_get_customicons_file(void);
590 static int conf_setdef_customicons_file(void);
591
592 static int conf_set_scriptdir(const char *valstr);
593 static const char *conf_get_scriptdir(void);
594 static int conf_setdef_scriptdir(void);
595
596 static int conf_set_aliasfile(const char *valstr);
597 static const char *conf_get_aliasfile(void);
598 static int conf_setdef_aliasfile(void);
599
600 static int conf_set_anongame_infos_file(const char *valstr);
601 static const char *conf_get_anongame_infos_file(void);
602 static int conf_setdef_anongame_infos_file(void);
603
604 static int conf_set_max_conns_per_IP(const char *valstr);
605 static const char *conf_get_max_conns_per_IP(void);
606 static int conf_setdef_max_conns_per_IP(void);
607
608 static int conf_set_max_friends(const char *valstr);
609 static const char *conf_get_max_friends(void);
610 static int conf_setdef_max_friends(void);
611
612 static int conf_set_clan_newer_time(const char *valstr);
613 static const char *conf_get_clan_newer_time(void);
614 static int conf_setdef_clan_newer_time(void);
615
616 static int conf_set_clan_max_members(const char *valstr);
617 static const char *conf_get_clan_max_members(void);
618 static int conf_setdef_clan_max_members(void);
619
620 static int conf_set_clan_channel_default_private(const char *valstr);
621 static const char *conf_get_clan_channel_default_private(void);
622 static int conf_setdef_clan_channel_default_private(void);
623
624 static int conf_set_clan_min_invites(const char *valstr);
625 static const char *conf_get_clan_min_invites(void);
626 static int conf_setdef_clan_min_invites(void);
627
628 static int conf_set_passfail_count(const char *valstr);
629 static const char *conf_get_passfail_count(void);
630 static int conf_setdef_passfail_count(void);
631
632 static int conf_set_passfail_bantime(const char *valstr);
633 static const char *conf_get_passfail_bantime(void);
634 static int conf_setdef_passfail_bantime(void);
635
636 static int conf_set_maxusers_per_channel(const char *valstr);
637 static const char *conf_get_maxusers_per_channel(void);
638 static int conf_setdef_maxusers_per_channel(void);
639
640 static int conf_set_allowed_clients(const char *valstr);
641 static const char *conf_get_allowed_clients(void);
642 static int conf_setdef_allowed_clients(void);
643
644 static int conf_set_ladder_games(const char *valstr);
645 static const char *conf_get_ladder_games(void);
646 static int conf_setdef_ladder_games(void);
647
648 static int conf_set_max_connections(const char *valstr);
649 static const char *conf_get_max_connections(void);
650 static int conf_setdef_max_connections(void);
651
652 static int conf_set_packet_limit(const char *valstr);
653 static const char *conf_get_packet_limit(void);
654 static int conf_setdef_packet_limit(void);
655
656 static int conf_set_sync_on_logoff(const char *valstr);
657 static const char *conf_get_sync_on_logoff(void);
658 static int conf_setdef_sync_on_logoff(void);
659
660 static int conf_set_ladder_prefix(const char *valstr);
661 static const char *conf_get_ladder_prefix(void);
662 static int conf_setdef_ladder_prefix(void);
663
664 static int conf_setdef_irc_network_name(void);
665 static int conf_set_irc_network_name(const char *valstr);
666 static const char *conf_get_irc_network_name(void);
667
668 static int conf_set_localize_by_country(const char *valstr);
669 static const char *conf_get_localize_by_country(void);
670 static int conf_setdef_localize_by_country(void);
671
672 static int conf_set_log_commands(const char *valstr);
673 static const char *conf_get_log_commands(void);
674 static int conf_setdef_log_commands(void);
675
676 static int conf_set_log_command_groups(const char *valstr);
677 static const char *conf_get_log_command_groups(void);
678 static int conf_setdef_log_command_groups(void);
679
680 static int conf_set_log_command_list(const char *valstr);
681 static const char *conf_get_log_command_list(void);
682 static int conf_setdef_log_command_list(void);
683
684
685 static int conf_setdef_apireg_addrs(void);
686 static int conf_set_apireg_addrs(const char *valstr);
687 static const char *conf_get_apireg_addrs(void);
688
689 static int conf_setdef_wgameres_addrs(void);
690 static int conf_set_wgameres_addrs(const char *valstr);
691 static const char *conf_get_wgameres_addrs(void);
692
693 static int conf_setdef_wolv1_addrs(void);
694 static int conf_set_wolv1_addrs(const char *valstr);
695 static const char *conf_get_wolv1_addrs(void);
696
697 static int conf_setdef_wolv2_addrs(void);
698 static int conf_set_wolv2_addrs(const char *valstr);
699 static const char *conf_get_wolv2_addrs(void);
700
701 static int conf_set_wol_timezone(const char *valstr);
702 static const char *conf_get_wol_timezone(void);
703 static int conf_setdef_wol_timezone(void);
704
705 static int conf_set_wol_longitude(const char *valstr);
706 static const char *conf_get_wol_longitude(void);
707 static int conf_setdef_wol_longitude(void);
708
709 static int conf_set_wol_latitude(const char *valstr);
710 static const char *conf_get_wol_latitude(void);
711 static int conf_setdef_wol_latitude(void);
712
713 static int conf_set_wol_autoupdate_serverhost(const char *valstr);
714 static const char *conf_get_wol_autoupdate_serverhost(void);
715 static int conf_setdef_wol_autoupdate_serverhost(void);
716
717 static int conf_set_wol_autoupdate_username(const char *valstr);
718 static const char *conf_get_wol_autoupdate_username(void);
719 static int conf_setdef_wol_autoupdate_username(void);
720
721 static int conf_set_wol_autoupdate_password(const char *valstr);
722 static const char *conf_get_wol_autoupdate_password(void);
723 static int conf_setdef_wol_autoupdate_password(void);
724
725 /* directive set method get method */
726 static t_conf_entry conf_table[] =
727 {
728 { "filedir", conf_set_filedir, conf_get_filedir, conf_setdef_filedir },
729 { "i18ndir", conf_set_i18ndir, conf_get_i18ndir, conf_setdef_i18ndir },
730 { "storage_path", conf_set_storage_path, conf_get_storage_path, conf_setdef_storage_path },
731 { "logfile", conf_set_logfile, conf_get_logfile, conf_setdef_logfile },
732 { "loglevels", conf_set_loglevels, conf_get_loglevels, conf_setdef_loglevels },
733 { "localizefile", conf_set_localizefile, conf_get_localizefile, conf_setdef_localizefile },
734 { "motdfile", conf_set_motdfile, conf_get_motdfile, conf_setdef_motdfile },
735 { "motdw3file", conf_set_motdw3file, conf_get_motdw3file, conf_setdef_motdw3file },
736 { "newsfile", conf_set_newsfile, conf_get_newsfile, conf_setdef_newsfile },
737 { "channelfile", conf_set_channelfile, conf_get_channelfile, conf_setdef_channelfile },
738 { "pidfile", conf_set_pidfile, conf_get_pidfile, conf_setdef_pidfile },
739 { "adfile", conf_set_adfile, conf_get_adfile, conf_setdef_adfile },
740 { "topicfile", conf_set_topicfile, conf_get_topicfile, conf_setdef_topicfile },
741 { "DBlayoutfile", conf_set_DBlayoutfile, conf_get_DBlayoutfile, conf_setdef_DBlayoutfile },
742 { "supportfile", conf_set_supportfile, conf_get_supportfile, conf_setdef_supportfile },
743 { "usersync", conf_set_usersync, conf_get_usersync, conf_setdef_usersync },
744 { "userflush", conf_set_userflush, conf_get_userflush, conf_setdef_userflush },
745 { "userflush_connected", conf_set_userflush_connected, conf_get_userflush_connected, conf_setdef_userflush_connected },
746 { "userstep", conf_set_userstep, conf_get_userstep, conf_setdef_userstep },
747 { "servername", conf_set_servername, conf_get_servername, conf_setdef_servername },
748 { "hostname", conf_set_hostname, conf_get_hostname, conf_setdef_hostname },
749 { "track", conf_set_track, conf_get_track, conf_setdef_track },
750 { "location", conf_set_location, conf_get_location, conf_setdef_location },
751 { "description", conf_set_description, conf_get_description, conf_setdef_description },
752 { "url", conf_set_url, conf_get_url, conf_setdef_url },
753 { "contact_name", conf_set_contact_name, conf_get_contact_name, conf_setdef_contact_name },
754 { "contact_email", conf_set_contact_email, conf_get_contact_email, conf_setdef_contact_email },
755 { "latency", conf_set_latency, conf_get_latency, conf_setdef_latency },
756 { "irc_latency", conf_set_irc_latency, conf_get_irc_latency, conf_setdef_irc_latency },
757 { "shutdown_delay", conf_set_shutdown_delay, conf_get_shutdown_delay, conf_setdef_shutdown_delay },
758 { "shutdown_decr", conf_set_shutdown_decr, conf_get_shutdown_decr, conf_setdef_shutdown_decr },
759 { "new_accounts", conf_set_new_accounts, conf_get_new_accounts, conf_setdef_new_accounts },
760 { "max_accounts", conf_set_max_accounts, conf_get_max_accounts, conf_setdef_max_accounts },
761 { "kick_old_login", conf_set_kick_old_login, conf_get_kick_old_login, conf_setdef_kick_old_login },
762 { "ask_new_channel", conf_set_ask_new_channel, conf_get_ask_new_channel, conf_setdef_ask_new_channel },
763 { "hide_pass_games", conf_set_hide_pass_games, conf_get_hide_pass_games, conf_setdef_hide_pass_games },
764 { "hide_started_games", conf_set_hide_started_games, conf_get_hide_started_games, conf_setdef_hide_started_games },
765 { "hide_temp_channels", conf_set_hide_temp_channels, conf_get_hide_temp_channels, conf_setdef_hide_temp_channels },
766 { "hide_addr", conf_set_hide_addr, conf_get_hide_addr, conf_setdef_hide_addr },
767 { "enable_conn_all", conf_set_enable_conn_all, conf_get_enable_conn_all, conf_setdef_enable_conn_all },
768 { "reportdir", conf_set_reportdir, conf_get_reportdir, conf_setdef_reportdir },
769 { "report_all_games", conf_set_report_all_games, conf_get_report_all_games, conf_setdef_report_all_games },
770 { "report_diablo_games", conf_set_report_diablo_games, conf_get_report_diablo_games, conf_setdef_report_diablo_games },
771 { "iconfile", conf_set_iconfile, conf_get_iconfile, conf_setdef_iconfile },
772 { "war3_iconfile", conf_set_war3_iconfile, conf_get_war3_iconfile, conf_setdef_war3_iconfile },
773 { "star_iconfile", conf_set_star_iconfile, conf_get_star_iconfile, conf_setdef_star_iconfile },
774 { "tosfile", conf_set_tosfile, conf_get_tosfile, conf_setdef_tosfile },
775 { "mpqfile", conf_set_mpqfile, conf_get_mpqfile, conf_setdef_mpqfile },
776 { "trackaddrs", conf_set_trackaddrs, conf_get_trackaddrs, conf_setdef_trackaddrs },
777 { "servaddrs", conf_set_servaddrs, conf_get_servaddrs, conf_setdef_servaddrs },
778 { "w3routeaddr", conf_set_w3routeaddr, conf_get_w3routeaddr, conf_setdef_w3routeaddr },
779 { "ircaddrs", conf_set_ircaddrs, conf_get_ircaddrs, conf_setdef_ircaddrs },
780 { "use_keepalive", conf_set_use_keepalive, conf_get_use_keepalive, conf_setdef_use_keepalive },
781 { "udptest_port", conf_set_udptest_port, conf_get_udptest_port, conf_setdef_udptest_port },
782 { "ipbanfile", conf_set_ipbanfile, conf_get_ipbanfile, conf_setdef_ipbanfile },
783 { "disc_is_loss", conf_set_disc_is_loss, conf_get_disc_is_loss, conf_setdef_disc_is_loss },
784 { "helpfile", conf_set_helpfile, conf_get_helpfile, conf_setdef_helpfile },
785 { "transfile", conf_set_transfile, conf_get_transfile, conf_setdef_transfile },
786 { "chanlog", conf_set_chanlog, conf_get_chanlog, conf_setdef_chanlog },
787 { "chanlogdir", conf_set_chanlogdir, conf_get_chanlogdir, conf_setdef_chanlogdir },
788 { "userlogdir", conf_set_userlogdir, conf_get_userlogdir, conf_setdef_userlogdir },
789 { "quota", conf_set_quota, conf_get_quota, conf_setdef_quota },
790 { "quota_lines", conf_set_quota_lines, conf_get_quota_lines, conf_setdef_quota_lines },
791 { "quota_time", conf_set_quota_time, conf_get_quota_time, conf_setdef_quota_time },
792 { "quota_wrapline", conf_set_quota_wrapline, conf_get_quota_wrapline, conf_setdef_quota_wrapline },
793 { "quota_maxline", conf_set_quota_maxline, conf_get_quota_maxline, conf_setdef_quota_maxline },
794 { "ladder_init_rating", conf_set_ladder_init_rating, conf_get_ladder_init_rating, conf_setdef_ladder_init_rating },
795 { "quota_dobae", conf_set_quota_dobae, conf_get_quota_dobae, conf_setdef_quota_dobae },
796 { "realmfile", conf_set_realmfile, conf_get_realmfile, conf_setdef_realmfile },
797 { "issuefile", conf_set_issuefile, conf_get_issuefile, conf_setdef_issuefile },
798 { "effective_user", conf_set_effective_user, conf_get_effective_user, conf_setdef_effective_user },
799 { "effective_group", conf_set_effective_group, conf_get_effective_group, conf_setdef_effective_group },
800 { "nullmsg", conf_set_nullmsg, conf_get_nullmsg, conf_setdef_nullmsg },
801 { "mail_support", conf_set_mail_support, conf_get_mail_support, conf_setdef_mail_support },
802 { "mail_quota", conf_set_mail_quota, conf_get_mail_quota, conf_setdef_mail_quota },
803 { "maildir", conf_set_maildir, conf_get_maildir, conf_setdef_maildir },
804 { "log_notice", conf_set_log_notice, conf_get_log_notice, conf_setdef_log_notice },
805 { "savebyname", conf_set_savebyname, conf_get_savebyname, conf_setdef_savebyname },
806 { "allow_bad_version", conf_set_allow_bad_version, conf_get_allow_bad_version, conf_setdef_allow_bad_version },
807 { "allow_unknown_version", conf_set_allow_unknown_version, conf_get_allow_unknown_version, conf_setdef_allow_unknown_version },
808 { "versioncheck_file", conf_set_versioncheck_file, conf_get_versioncheck_file, conf_setdef_versioncheck_file },
809 { "d2cs_version", conf_set_d2cs_version, conf_get_d2cs_version, conf_setdef_d2cs_version },
810 { "allow_d2cs_setname", conf_set_allow_d2cs_setname, conf_get_allow_d2cs_setname, conf_setdef_allow_d2cs_setname },
811 { "hashtable_size", conf_set_hashtable_size, conf_get_hashtable_size, conf_setdef_hashtable_size },
812 { "telnetaddrs", conf_set_telnetaddrs, conf_get_telnetaddrs, conf_setdef_telnetaddrs },
813 { "ipban_check_int", conf_set_ipban_check_int, conf_get_ipban_check_int, conf_setdef_ipban_check_int },
814 { "max_concurrent_logins", conf_set_max_concurrent_logins, conf_get_max_concurrent_logins, conf_setdef_max_concurrent_logins },
815 { "mapsfile", conf_set_mapsfile, conf_get_mapsfile, conf_setdef_mapsfile },
816 { "xplevelfile", conf_set_xplevelfile, conf_get_xplevelfile, conf_setdef_xplevelfile },
817 { "xpcalcfile", conf_set_xpcalcfile, conf_get_xpcalcfile, conf_setdef_xpcalcfile },
818 { "initkill_timer", conf_set_initkill_timer, conf_get_initkill_timer, conf_setdef_initkill_timer },
819 { "war3_ladder_update_secs", conf_set_war3_ladder_update_secs, conf_get_war3_ladder_update_secs, conf_setdef_war3_ladder_update_secs },
820 { "output_update_secs", conf_set_output_update_secs, conf_get_output_update_secs, conf_setdef_output_update_secs },
821 { "ladderdir", conf_set_ladderdir, conf_get_ladderdir, conf_setdef_ladderdir },
822 { "statusdir", conf_set_statusdir, conf_get_statusdir, conf_setdef_statusdir },
823 { "XML_output_ladder", conf_set_XML_output_ladder, conf_get_XML_output_ladder, conf_setdef_XML_output_ladder },
824 { "XML_status_output", conf_set_XML_status_output, conf_get_XML_status_output, conf_setdef_XML_status_output },
825 { "account_allowed_symbols", conf_set_account_allowed_symbols, conf_get_account_allowed_symbols, conf_setdef_account_allowed_symbols },
826 { "account_force_username", conf_set_account_force_username, conf_get_account_force_username, conf_setdef_account_force_username },
827 { "command_groups_file", conf_set_command_groups_file, conf_get_command_groups_file, conf_setdef_command_groups_file },
828 { "tournament_file", conf_set_tournament_file, conf_get_tournament_file, conf_setdef_tournament_file },
829 { "customicons_file", conf_set_customicons_file, conf_get_customicons_file, conf_setdef_customicons_file },
830 { "scriptdir", conf_set_scriptdir, conf_get_scriptdir, conf_setdef_scriptdir },
831 { "aliasfile", conf_set_aliasfile, conf_get_aliasfile, conf_setdef_aliasfile },
832 { "anongame_infos_file", conf_set_anongame_infos_file, conf_get_anongame_infos_file, conf_setdef_anongame_infos_file },
833 { "max_conns_per_IP", conf_set_max_conns_per_IP, conf_get_max_conns_per_IP, conf_setdef_max_conns_per_IP },
834 { "max_friends", conf_set_max_friends, conf_get_max_friends, conf_setdef_max_friends },
835 { "clan_newer_time", conf_set_clan_newer_time, conf_get_clan_newer_time, conf_setdef_clan_newer_time },
836 { "clan_max_members", conf_set_clan_max_members, conf_get_clan_max_members, conf_setdef_clan_max_members },
837 { "clan_channel_default_private", conf_set_clan_channel_default_private, conf_get_clan_channel_default_private, conf_setdef_clan_channel_default_private },
838 { "clan_min_invites", conf_set_clan_min_invites, conf_get_clan_min_invites, conf_setdef_clan_min_invites },
839 { "passfail_count", conf_set_passfail_count, conf_get_passfail_count, conf_setdef_passfail_count },
840 { "passfail_bantime", conf_set_passfail_bantime, conf_get_passfail_bantime, conf_setdef_passfail_bantime },
841 { "maxusers_per_channel", conf_set_maxusers_per_channel, conf_get_maxusers_per_channel, conf_setdef_maxusers_per_channel },
842 { "allowed_clients", conf_set_allowed_clients, conf_get_allowed_clients, conf_setdef_allowed_clients },
843 { "ladder_games", conf_set_ladder_games, conf_get_ladder_games, conf_setdef_ladder_games },
844 { "max_connections", conf_set_max_connections, conf_get_max_connections, conf_setdef_max_connections },
845 { "packet_limit", conf_set_packet_limit, conf_get_packet_limit, conf_setdef_packet_limit },
846 { "sync_on_logoff", conf_set_sync_on_logoff, conf_get_sync_on_logoff, conf_setdef_sync_on_logoff },
847 { "ladder_prefix", conf_set_ladder_prefix, conf_get_ladder_prefix, conf_setdef_ladder_prefix },
848 { "irc_network_name", conf_set_irc_network_name, conf_get_irc_network_name, conf_setdef_irc_network_name },
849 { "localize_by_country", conf_set_localize_by_country, conf_get_localize_by_country, conf_setdef_localize_by_country },
850 { "log_commands", conf_set_log_commands, conf_get_log_commands, conf_setdef_log_commands },
851 { "log_command_groups", conf_set_log_command_groups, conf_get_log_command_groups, conf_setdef_log_command_groups },
852 { "log_command_list", conf_set_log_command_list, conf_get_log_command_list, conf_setdef_log_command_list },
853
854 { "apiregaddrs", conf_set_apireg_addrs, conf_get_apireg_addrs, conf_setdef_apireg_addrs },
855 { "wgameresaddrs", conf_set_wgameres_addrs, conf_get_wgameres_addrs, conf_setdef_wgameres_addrs },
856 { "wolv1addrs", conf_set_wolv1_addrs, conf_get_wolv1_addrs, conf_setdef_wolv1_addrs },
857 { "wolv2addrs", conf_set_wolv2_addrs, conf_get_wolv2_addrs, conf_setdef_wolv2_addrs },
858 { "woltimezone", conf_set_wol_timezone, conf_get_wol_timezone, conf_setdef_wol_timezone },
859 { "wollongitude", conf_set_wol_longitude, conf_get_wol_longitude, conf_setdef_wol_longitude },
860 { "wollatitude", conf_set_wol_latitude, conf_get_wol_latitude, conf_setdef_wol_latitude },
861 { "wol_autoupdate_serverhost", conf_set_wol_autoupdate_serverhost, conf_get_wol_autoupdate_serverhost, conf_setdef_wol_autoupdate_serverhost },
862 { "wol_autoupdate_username", conf_set_wol_autoupdate_username, conf_get_wol_autoupdate_username, conf_setdef_wol_autoupdate_username },
863 { "wol_autoupdate_password", conf_set_wol_autoupdate_password, conf_get_wol_autoupdate_password, conf_setdef_wol_autoupdate_password },
864
865 { NULL, NULL, NULL, NONE },
866 };
867
868 extern int prefs_load(char const * filename)
869 {
870 std::FILE *fd;
871
872 if (!filename) {
873 eventlog(eventlog_level_error, __FUNCTION__, "got NULL filename");
874 return -1;
875 }
876
877 fd = std::fopen(filename, "rt");
878 if (!fd) {
879 eventlog(eventlog_level_error, __FUNCTION__, "could not open file '{}'", filename);
880 return -1;
881 }
882
883 if (conf_load_file(fd, conf_table)) {
884 eventlog(eventlog_level_error, __FUNCTION__, "error loading config file '{}'", filename);
885 std::fclose(fd);
886 return -1;
887 }
888
889 std::fclose(fd);
890
891 return 0;
892 }
893
894
895 extern void prefs_unload(void)
896 {
897 conf_unload(conf_table);
898 }
899
900 extern char const * prefs_get_storage_path(void)
901 {
902 return prefs_runtime_config.storage_path;
903 }
904
905 static int conf_set_storage_path(const char *valstr)
906 {
907 return conf_set_str(&prefs_runtime_config.storage_path, valstr, NULL);
908 }
909
910 static int conf_setdef_storage_path(void)
911 {
912 return conf_set_str(&prefs_runtime_config.storage_path, NULL, BNETD_STORAGE_PATH);
913 }
914
915 static const char* conf_get_storage_path(void)
916 {
917 return prefs_runtime_config.storage_path;
918 }
919
920
921 extern char const * prefs_get_filedir(void)
922 {
923 return prefs_runtime_config.filedir;
924 }
925
926 static int conf_set_filedir(const char *valstr)
927 {
928 return conf_set_str(&prefs_runtime_config.filedir, valstr, NULL);
929 }
930
931 static int conf_setdef_filedir(void)
932 {
933 return conf_set_str(&prefs_runtime_config.filedir, NULL, BNETD_FILE_DIR);
934 }
935
936 static const char* conf_get_filedir(void)
937 {
938 return prefs_runtime_config.filedir;
939 }
940
941
942 extern char const * prefs_get_i18ndir(void)
943 {
944 return prefs_runtime_config.i18ndir;
945 }
946
947 static int conf_set_i18ndir(const char *valstr)
948 {
949 return conf_set_str(&prefs_runtime_config.i18ndir, valstr, NULL);
950 }
951
952 static int conf_setdef_i18ndir(void)
953 {
954 return conf_set_str(&prefs_runtime_config.i18ndir, NULL, BNETD_I18N_DIR);
955 }
956
957 static const char* conf_get_i18ndir(void)
958 {
959 return prefs_runtime_config.i18ndir;
960 }
961
962
963 extern char const * prefs_get_logfile(void)
964 {
965 return prefs_runtime_config.logfile;
966 }
967
968 static int conf_set_logfile(const char *valstr)
969 {
970 return conf_set_str(&prefs_runtime_config.logfile, valstr, NULL);
971 }
972
973 static int conf_setdef_logfile(void)
974 {
975 return conf_set_str(&prefs_runtime_config.logfile, NULL, BNETD_LOG_FILE);
976 }
977
978 static const char* conf_get_logfile(void)
979 {
980 return prefs_runtime_config.logfile;
981 }
982
983
984 extern char const * prefs_get_loglevels(void)
985 {
986 return prefs_runtime_config.loglevels;
987 }
988
989 static int conf_set_loglevels(const char *valstr)
990 {
991 return conf_set_str(&prefs_runtime_config.loglevels, valstr, NULL);
992 }
993
994 static int conf_setdef_loglevels(void)
995 {
996 return conf_set_str(&prefs_runtime_config.loglevels, NULL, BNETD_LOG_LEVELS);
997 }
998
999 static const char* conf_get_loglevels(void)
1000 {
1001 return prefs_runtime_config.loglevels;
1002 }
1003
1004
1005 extern char const * prefs_get_localizefile(void)
1006 {
1007 return prefs_runtime_config.localizefile;
1008 }
1009
1010 static int conf_set_localizefile(const char *valstr)
1011 {
1012 return conf_set_str(&prefs_runtime_config.localizefile, valstr, NULL);
1013 }
1014
1015 static int conf_setdef_localizefile(void)
1016 {
1017 return conf_set_str(&prefs_runtime_config.localizefile, NULL, BNETD_LOCALIZE_FILE);
1018 }
1019
1020 static const char* conf_get_localizefile(void)
1021 {
1022 return prefs_runtime_config.localizefile;
1023 }
1024
1025
1026 extern char const * prefs_get_motdfile(void)
1027 {
1028 return prefs_runtime_config.motdfile;
1029 }
1030
1031 static int conf_set_motdfile(const char *valstr)
1032 {
1033 return conf_set_str(&prefs_runtime_config.motdfile, valstr, NULL);
1034 }
1035
1036 static int conf_setdef_motdfile(void)
1037 {
1038 return conf_set_str(&prefs_runtime_config.motdfile, NULL, BNETD_MOTD_FILE);
1039 }
1040
1041 static const char* conf_get_motdfile(void)
1042 {
1043 return prefs_runtime_config.motdfile;
1044 }
1045
1046
1047 extern char const * prefs_get_motdw3file(void)
1048 {
1049 return prefs_runtime_config.motdw3file;
1050 }
1051
1052 static int conf_set_motdw3file(const char *valstr)
1053 {
1054 return conf_set_str(&prefs_runtime_config.motdw3file, valstr, NULL);
1055 }
1056
1057 static int conf_setdef_motdw3file(void)
1058 {
1059 return conf_set_str(&prefs_runtime_config.motdw3file, NULL, BNETD_MOTDW3_FILE);
1060 }
1061
1062 static const char* conf_get_motdw3file(void)
1063 {
1064 return prefs_runtime_config.motdw3file;
1065 }
1066
1067
1068 extern char const * prefs_get_newsfile(void)
1069 {
1070 return prefs_runtime_config.newsfile;
1071 }
1072
1073 static int conf_set_newsfile(const char *valstr)
1074 {
1075 return conf_set_str(&prefs_runtime_config.newsfile, valstr, NULL);
1076 }
1077
1078 static int conf_setdef_newsfile(void)
1079 {
1080 return conf_set_str(&prefs_runtime_config.newsfile, NULL, BNETD_NEWS_FILE);
1081 }
1082
1083 static const char* conf_get_newsfile(void)
1084 {
1085 return prefs_runtime_config.newsfile;
1086 }
1087
1088
1089 extern char const * prefs_get_adfile(void)
1090 {
1091 return prefs_runtime_config.adfile;
1092 }
1093
1094 static int conf_set_adfile(const char *valstr)
1095 {
1096 return conf_set_str(&prefs_runtime_config.adfile, valstr, NULL);
1097 }
1098
1099 static int conf_setdef_adfile(void)
1100 {
1101 return conf_set_str(&prefs_runtime_config.adfile, NULL, BNETD_AD_FILE);
1102 }
1103
1104 static const char* conf_get_adfile(void)
1105 {
1106 return prefs_runtime_config.adfile;
1107 }
1108
1109
1110 extern char const * prefs_get_topicfile(void)
1111 {
1112 return prefs_runtime_config.topicfile;
1113 }
1114
1115 static int conf_set_topicfile(const char *valstr)
1116 {
1117 return conf_set_str(&prefs_runtime_config.topicfile, valstr, NULL);
1118 }
1119
1120 static int conf_setdef_topicfile(void)
1121 {
1122 return conf_set_str(&prefs_runtime_config.topicfile, NULL, BNETD_TOPIC_FILE);
1123 }
1124
1125 static const char* conf_get_topicfile(void)
1126 {
1127 return prefs_runtime_config.topicfile;
1128 }
1129
1130
1131 extern char const * prefs_get_DBlayoutfile(void)
1132 {
1133 return prefs_runtime_config.DBlayoutfile;
1134 }
1135
1136 static int conf_set_DBlayoutfile(const char *valstr)
1137 {
1138 return conf_set_str(&prefs_runtime_config.DBlayoutfile, valstr, NULL);
1139 }
1140
1141 static int conf_setdef_DBlayoutfile(void)
1142 {
1143 return conf_set_str(&prefs_runtime_config.DBlayoutfile, NULL, BNETD_DBLAYOUT_FILE);
1144 }
1145
1146 static const char* conf_get_DBlayoutfile(void)
1147 {
1148 return prefs_runtime_config.DBlayoutfile;
1149 }
1150
1151
1152 extern unsigned int prefs_get_user_sync_timer(void)
1153 {
1154 return prefs_runtime_config.usersync;
1155 }
1156
1157 static int conf_set_usersync(const char *valstr)
1158 {
1159 return conf_set_int(&prefs_runtime_config.usersync, valstr, 0);
1160 }
1161
1162 static int conf_setdef_usersync(void)
1163 {
1164 return conf_set_int(&prefs_runtime_config.usersync, NULL, BNETD_USERSYNC);
1165 }
1166
1167 static const char* conf_get_usersync(void)
1168 {
1169 return conf_get_int(prefs_runtime_config.usersync);
1170 }
1171
1172
1173 extern unsigned int prefs_get_user_flush_timer(void)
1174 {
1175 return prefs_runtime_config.userflush;
1176 }
1177
1178 static int conf_set_userflush(const char *valstr)
1179 {
1180 return conf_set_int(&prefs_runtime_config.userflush, valstr, 0);
1181 }
1182
1183 static int conf_setdef_userflush(void)
1184 {
1185 return conf_set_int(&prefs_runtime_config.userflush, NULL, BNETD_USERFLUSH);
1186 }
1187
1188 static const char* conf_get_userflush(void)
1189 {
1190 return conf_get_int(prefs_runtime_config.userflush);
1191 }
1192
1193
1194 extern unsigned int prefs_get_user_flush_connected(void)
1195 {
1196 return prefs_runtime_config.userflush_connected;
1197 }
1198
1199 static int conf_set_userflush_connected(const char *valstr)
1200 {
1201 return conf_set_bool(&prefs_runtime_config.userflush_connected, valstr, 0);
1202 }
1203
1204 static int conf_setdef_userflush_connected(void)
1205 {
1206 return conf_set_bool(&prefs_runtime_config.userflush_connected, NULL, 0);
1207 }
1208
1209 static const char* conf_get_userflush_connected(void)
1210 {
1211 return conf_get_bool(prefs_runtime_config.userflush_connected);
1212 }
1213
1214
1215 extern unsigned int prefs_get_user_step(void)
1216 {
1217 return prefs_runtime_config.userstep;
1218 }
1219
1220 static int conf_set_userstep(const char *valstr)
1221 {
1222 return conf_set_int(&prefs_runtime_config.userstep, valstr, 0);
1223 }
1224
1225 static int conf_setdef_userstep(void)
1226 {
1227 return conf_set_int(&prefs_runtime_config.userstep, NULL, BNETD_USERSTEP);
1228 }
1229
1230 static const char* conf_get_userstep(void)
1231 {
1232 return conf_get_int(prefs_runtime_config.userstep);
1233 }
1234
1235
1236 extern char const * prefs_get_servername(void)
1237 {
1238 return prefs_runtime_config.servername;
1239 }
1240
1241 static int conf_set_servername(const char *valstr)
1242 {
1243 return conf_set_str(&prefs_runtime_config.servername, valstr, NULL);
1244 }
1245
1246 static int conf_setdef_servername(void)
1247 {
1248 return conf_set_str(&prefs_runtime_config.servername, NULL, BNETD_SERVERNAME);
1249 }
1250
1251 static const char* conf_get_servername(void)
1252 {
1253 return prefs_runtime_config.servername;
1254 }
1255
1256
1257 extern char const * prefs_get_hostname(void)
1258 {
1259 return prefs_runtime_config.hostname;
1260 }
1261
1262 static int conf_set_hostname(const char *valstr)
1263 {
1264 return conf_set_str(&prefs_runtime_config.hostname, valstr, NULL);
1265 }
1266
1267 static int conf_setdef_hostname(void)
1268 {
1269 return conf_set_str(&prefs_runtime_config.hostname, NULL, "");
1270 }
1271
1272 static const char* conf_get_hostname(void)
1273 {
1274 return prefs_runtime_config.hostname;
1275 }
1276
1277
1278 extern unsigned int prefs_get_track(void)
1279 {
1280 return prefs_runtime_config.track;
1281 }
1282
1283 static int conf_set_track(const char *valstr)
1284 {
1285 unsigned int rez;
1286
1287 conf_set_int(&prefs_runtime_config.track, valstr, 0);
1288 rez = prefs_runtime_config.track;
1289 if (rez > 0 && rez < 60) rez = 60;
1290 return 0;
1291 }
1292
1293 static int conf_setdef_track(void)
1294 {
1295 return conf_set_int(&prefs_runtime_config.track, NULL, BNETD_TRACK_TIME);
1296 }
1297
1298 static const char* conf_get_track(void)
1299 {
1300 return conf_get_int(prefs_runtime_config.track);
1301 }
1302
1303
1304 extern char const * prefs_get_location(void)
1305 {
1306 return prefs_runtime_config.location;
1307 }
1308
1309 static int conf_set_location(const char *valstr)
1310 {
1311 return conf_set_str(&prefs_runtime_config.location, valstr, NULL);
1312 }
1313
1314 static int conf_setdef_location(void)
1315 {
1316 return conf_set_str(&prefs_runtime_config.location, NULL, "");
1317 }
1318
1319 static const char* conf_get_location(void)
1320 {
1321 return prefs_runtime_config.location;
1322 }
1323
1324
1325 extern char const * prefs_get_description(void)
1326 {
1327 return prefs_runtime_config.description;
1328 }
1329
1330 static int conf_set_description(const char *valstr)
1331 {
1332 return conf_set_str(&prefs_runtime_config.description, valstr, NULL);
1333 }
1334
1335 static int conf_setdef_description(void)
1336 {
1337 return conf_set_str(&prefs_runtime_config.description, NULL, "");
1338 }
1339
1340 static const char* conf_get_description(void)
1341 {
1342 return prefs_runtime_config.description;
1343 }
1344
1345
1346 extern char const * prefs_get_url(void)
1347 {
1348 return prefs_runtime_config.url;
1349 }
1350
1351 static int conf_set_url(const char *valstr)
1352 {
1353 return conf_set_str(&prefs_runtime_config.url, valstr, NULL);
1354 }
1355
1356 static int conf_setdef_url(void)
1357 {
1358 return conf_set_str(&prefs_runtime_config.url, NULL, "");
1359 }
1360
1361 static const char* conf_get_url(void)
1362 {
1363 return prefs_runtime_config.url;
1364 }
1365
1366
1367 extern char const * prefs_get_contact_name(void)
1368 {
1369 return prefs_runtime_config.contact_name;
1370 }
1371
1372 static int conf_set_contact_name(const char *valstr)
1373 {
1374 return conf_set_str(&prefs_runtime_config.contact_name, valstr, NULL);
1375 }
1376
1377 static int conf_setdef_contact_name(void)
1378 {
1379 return conf_set_str(&prefs_runtime_config.contact_name, NULL, "");
1380 }
1381
1382 static const char* conf_get_contact_name(void)
1383 {
1384 return prefs_runtime_config.contact_name;
1385 }
1386
1387
1388 extern char const * prefs_get_contact_email(void)
1389 {
1390 return prefs_runtime_config.contact_email;
1391 }
1392
1393 static int conf_set_contact_email(const char *valstr)
1394 {
1395 return conf_set_str(&prefs_runtime_config.contact_email, valstr, NULL);
1396 }
1397
1398 static int conf_setdef_contact_email(void)
1399 {
1400 return conf_set_str(&prefs_runtime_config.contact_email, NULL, "");
1401 }
1402
1403 static const char* conf_get_contact_email(void)
1404 {
1405 return prefs_runtime_config.contact_email;
1406 }
1407
1408
1409 extern unsigned int prefs_get_latency(void)
1410 {
1411 return prefs_runtime_config.latency;
1412 }
1413
1414 static int conf_set_latency(const char *valstr)
1415 {
1416 return conf_set_int(&prefs_runtime_config.latency, valstr, 0);
1417 }
1418
1419 static int conf_setdef_latency(void)
1420 {
1421 return conf_set_int(&prefs_runtime_config.latency, NULL, BNETD_LATENCY);
1422 }
1423
1424 static const char* conf_get_latency(void)
1425 {
1426 return conf_get_int(prefs_runtime_config.latency);
1427 }
1428
1429
1430 extern unsigned int prefs_get_irc_latency(void)
1431 {
1432 return prefs_runtime_config.irc_latency;
1433 }
1434
1435 static int conf_set_irc_latency(const char *valstr)
1436 {
1437 return conf_set_int(&prefs_runtime_config.irc_latency, valstr, 0);
1438 }
1439
1440 static int conf_setdef_irc_latency(void)
1441 {
1442 return conf_set_int(&prefs_runtime_config.irc_latency, NULL, BNETD_IRC_LATENCY);
1443 }
1444
1445 static const char* conf_get_irc_latency(void)
1446 {
1447 return conf_get_int(prefs_runtime_config.irc_latency);
1448 }
1449
1450
1451 extern unsigned int prefs_get_shutdown_delay(void)
1452 {
1453 return prefs_runtime_config.shutdown_delay;
1454 }
1455
1456 static int conf_set_shutdown_delay(const char *valstr)
1457 {
1458 return conf_set_int(&prefs_runtime_config.shutdown_delay, valstr, 0);
1459 }
1460
1461 static int conf_setdef_shutdown_delay(void)
1462 {
1463 return conf_set_int(&prefs_runtime_config.shutdown_delay, NULL, BNETD_SHUTDELAY);
1464 }
1465
1466 static const char* conf_get_shutdown_delay(void)
1467 {
1468 return conf_get_int(prefs_runtime_config.shutdown_delay);
1469 }
1470
1471
1472 extern unsigned int prefs_get_shutdown_decr(void)
1473 {
1474 return prefs_runtime_config.shutdown_decr;
1475 }
1476
1477 static int conf_set_shutdown_decr(const char *valstr)
1478 {
1479 return conf_set_int(&prefs_runtime_config.shutdown_decr, valstr, 0);
1480 }
1481
1482 static int conf_setdef_shutdown_decr(void)
1483 {
1484 return conf_set_int(&prefs_runtime_config.shutdown_decr, NULL, BNETD_SHUTDECR);
1485 }
1486
1487 static const char* conf_get_shutdown_decr(void)
1488 {
1489 return conf_get_int(prefs_runtime_config.shutdown_decr);
1490 }
1491
1492
1493 extern unsigned int prefs_get_allow_new_accounts(void)
1494 {
1495 return prefs_runtime_config.new_accounts;
1496 }
1497
1498 static int conf_set_new_accounts(const char *valstr)
1499 {
1500 return conf_set_bool(&prefs_runtime_config.new_accounts, valstr, 0);
1501 }
1502
1503 static int conf_setdef_new_accounts(void)
1504 {
1505 return conf_set_bool(&prefs_runtime_config.new_accounts, NULL, 1);
1506 }
1507
1508 static const char* conf_get_new_accounts(void)
1509 {
1510 return conf_get_bool(prefs_runtime_config.new_accounts);
1511 }
1512
1513
1514 extern unsigned int prefs_get_max_accounts(void)
1515 {
1516 return prefs_runtime_config.max_accounts;
1517 }
1518
1519 static int conf_set_max_accounts(const char *valstr)
1520 {
1521 return conf_set_int(&prefs_runtime_config.max_accounts, valstr, 0);
1522 }
1523
1524 static int conf_setdef_max_accounts(void)
1525 {
1526 return conf_set_int(&prefs_runtime_config.max_accounts, NULL, 0);
1527 }
1528
1529 static const char* conf_get_max_accounts(void)
1530 {
1531 return conf_get_int(prefs_runtime_config.max_accounts);
1532 }
1533
1534
1535 extern unsigned int prefs_get_kick_old_login(void)
1536 {
1537 return prefs_runtime_config.kick_old_login;
1538 }
1539
1540 static int conf_set_kick_old_login(const char *valstr)
1541 {
1542 return conf_set_bool(&prefs_runtime_config.kick_old_login, valstr, 0);
1543 }
1544
1545 static int conf_setdef_kick_old_login(void)
1546 {
1547 return conf_set_bool(&prefs_runtime_config.kick_old_login, NULL, 1);
1548 }
1549
1550 static const char* conf_get_kick_old_login(void)
1551 {
1552 return conf_get_bool(prefs_runtime_config.kick_old_login);
1553 }
1554
1555
1556 extern char const * prefs_get_channelfile(void)
1557 {
1558 return prefs_runtime_config.channelfile;
1559 }
1560
1561 static int conf_set_channelfile(const char *valstr)
1562 {
1563 return conf_set_str(&prefs_runtime_config.channelfile, valstr, NULL);
1564 }
1565
1566 static int conf_setdef_channelfile(void)
1567 {
1568 return conf_set_str(&prefs_runtime_config.channelfile, NULL, BNETD_CHANNEL_FILE);
1569 }
1570
1571 static const char* conf_get_channelfile(void)
1572 {
1573 return prefs_runtime_config.channelfile;
1574 }
1575
1576
1577 extern unsigned int prefs_get_ask_new_channel(void)
1578 {
1579 return prefs_runtime_config.ask_new_channel;
1580 }
1581
1582 static int conf_set_ask_new_channel(const char *valstr)
1583 {
1584 return conf_set_bool(&prefs_runtime_config.ask_new_channel, valstr, 0);
1585 }
1586
1587 static int conf_setdef_ask_new_channel(void)
1588 {
1589 return conf_set_bool(&prefs_runtime_config.ask_new_channel, NULL, 1);
1590 }
1591
1592 static const char* conf_get_ask_new_channel(void)
1593 {
1594 return conf_get_bool(prefs_runtime_config.ask_new_channel);
1595 }
1596
1597
1598 extern unsigned int prefs_get_hide_pass_games(void)
1599 {
1600 return prefs_runtime_config.hide_pass_games;
1601 }
1602
1603 static int conf_set_hide_pass_games(const char *valstr)
1604 {
1605 return conf_set_bool(&prefs_runtime_config.hide_pass_games, valstr, 0);
1606 }
1607
1608 static int conf_setdef_hide_pass_games(void)
1609 {
1610 return conf_set_bool(&prefs_runtime_config.hide_pass_games, NULL, 1);
1611 }
1612
1613 static const char* conf_get_hide_pass_games(void)
1614 {
1615 return conf_get_bool(prefs_runtime_config.hide_pass_games);
1616 }
1617
1618
1619 extern unsigned int prefs_get_hide_started_games(void)
1620 {
1621 return prefs_runtime_config.hide_started_games;
1622 }
1623
1624 static int conf_set_hide_started_games(const char *valstr)
1625 {
1626 return conf_set_bool(&prefs_runtime_config.hide_started_games, valstr, 0);
1627 }
1628
1629 static int conf_setdef_hide_started_games(void)
1630 {
1631 return conf_set_bool(&prefs_runtime_config.hide_started_games, NULL, 1);
1632 }
1633
1634 static const char* conf_get_hide_started_games(void)
1635 {
1636 return conf_get_bool(prefs_runtime_config.hide_started_games);
1637 }
1638
1639
1640 extern unsigned int prefs_get_hide_temp_channels(void)
1641 {
1642 return prefs_runtime_config.hide_temp_channels;
1643 }
1644
1645 static int conf_set_hide_temp_channels(const char *valstr)
1646 {
1647 return conf_set_bool(&prefs_runtime_config.hide_temp_channels, valstr, 0);
1648 }
1649
1650 static int conf_setdef_hide_temp_channels(void)
1651 {
1652 return conf_set_bool(&prefs_runtime_config.hide_temp_channels, NULL, 1);
1653 }
1654
1655 static const char* conf_get_hide_temp_channels(void)
1656 {
1657 return conf_get_bool(prefs_runtime_config.hide_temp_channels);
1658 }
1659
1660 extern unsigned prefs_get_hide_addr(void)
1661 {
1662 return prefs_runtime_config.hide_addr;
1663 }
1664
1665 static int conf_set_hide_addr(const char *valstr)
1666 {
1667 return conf_set_bool(&prefs_runtime_config.hide_addr, valstr, 0);
1668 }
1669
1670 static int conf_setdef_hide_addr(void)
1671 {
1672 return conf_set_bool(&prefs_runtime_config.hide_addr, NULL, 1);
1673 }
1674
1675 static const char* conf_get_hide_addr(void)
1676 {
1677 return conf_get_bool(prefs_runtime_config.hide_addr);
1678 }
1679
1680
1681 extern unsigned int prefs_get_enable_conn_all(void)
1682 {
1683 return prefs_runtime_config.enable_conn_all;
1684 }
1685
1686 static int conf_set_enable_conn_all(const char *valstr)
1687 {
1688 return conf_set_bool(&prefs_runtime_config.enable_conn_all, valstr, 0);
1689 }
1690
1691 static int conf_setdef_enable_conn_all(void)
1692 {
1693 return conf_set_bool(&prefs_runtime_config.enable_conn_all, NULL, 0);
1694 }
1695
1696 static const char* conf_get_enable_conn_all(void)
1697 {
1698 return conf_get_bool(prefs_runtime_config.enable_conn_all);
1699 }
1700
1701
1702 extern char const * prefs_get_reportdir(void)
1703 {
1704 return prefs_runtime_config.reportdir;
1705 }
1706
1707 static int conf_set_reportdir(const char *valstr)
1708 {
1709 return conf_set_str(&prefs_runtime_config.reportdir, valstr, NULL);
1710 }
1711
1712 static int conf_setdef_reportdir(void)
1713 {
1714 return conf_set_str(&prefs_runtime_config.reportdir, NULL, BNETD_REPORT_DIR);
1715 }
1716
1717 static const char* conf_get_reportdir(void)
1718 {
1719 return prefs_runtime_config.reportdir;
1720 }
1721
1722
1723 extern unsigned int prefs_get_report_all_games(void)
1724 {
1725 return prefs_runtime_config.report_all_games;
1726 }
1727
1728 static int conf_set_report_all_games(const char *valstr)
1729 {
1730 return conf_set_bool(&prefs_runtime_config.report_all_games, valstr, 0);
1731 }
1732
1733 static int conf_setdef_report_all_games(void)
1734 {
1735 return conf_set_bool(&prefs_runtime_config.report_all_games, NULL, 0);
1736 }
1737
1738 static const char* conf_get_report_all_games(void)
1739 {
1740 return conf_get_bool(prefs_runtime_config.report_all_games);
1741 }
1742
1743
1744 extern unsigned int prefs_get_report_diablo_games(void)
1745 {
1746 return prefs_runtime_config.report_diablo_games;
1747 }
1748
1749 static int conf_set_report_diablo_games(const char *valstr)
1750 {
1751 return conf_set_bool(&prefs_runtime_config.report_diablo_games, valstr, 0);
1752 }
1753
1754 static int conf_setdef_report_diablo_games(void)
1755 {
1756 return conf_set_bool(&prefs_runtime_config.report_diablo_games, NULL, 0);
1757 }
1758
1759 static const char* conf_get_report_diablo_games(void)
1760 {
1761 return conf_get_bool(prefs_runtime_config.report_diablo_games);
1762 }
1763
1764
1765 extern char const * prefs_get_pidfile(void)
1766 {
1767 return prefs_runtime_config.pidfile;
1768 }
1769
1770 static int conf_set_pidfile(const char *valstr)
1771 {
1772 return conf_set_str(&prefs_runtime_config.pidfile, valstr, NULL);
1773 }
1774
1775 static int conf_setdef_pidfile(void)
1776 {
1777 return conf_set_str(&prefs_runtime_config.pidfile, NULL, BNETD_PID_FILE);
1778 }
1779
1780 static const char* conf_get_pidfile(void)
1781 {
1782 return prefs_runtime_config.pidfile;
1783 }
1784
1785
1786 extern char const * prefs_get_iconfile(void)
1787 {
1788 return prefs_runtime_config.iconfile;
1789 }
1790
1791 static int conf_set_iconfile(const char *valstr)
1792 {
1793 return conf_set_str(&prefs_runtime_config.iconfile, valstr, NULL);
1794 }
1795
1796 static int conf_setdef_iconfile(void)
1797 {
1798 return conf_set_str(&prefs_runtime_config.iconfile, NULL, BNETD_ICON_FILE);
1799 }
1800
1801 static const char* conf_get_iconfile(void)
1802 {
1803 return prefs_runtime_config.iconfile;
1804 }
1805
1806
1807 extern char const * prefs_get_war3_iconfile(void)
1808 {
1809 return prefs_runtime_config.war3_iconfile;
1810 }
1811
1812 static int conf_set_war3_iconfile(const char *valstr)
1813 {
1814 return conf_set_str(&prefs_runtime_config.war3_iconfile, valstr, NULL);
1815 }
1816
1817 static int conf_setdef_war3_iconfile(void)
1818 {
1819 return conf_set_str(&prefs_runtime_config.war3_iconfile, NULL, BNETD_WAR3_ICON_FILE);
1820 }
1821
1822 static const char* conf_get_war3_iconfile(void)
1823 {
1824 return prefs_runtime_config.war3_iconfile;
1825 }
1826
1827
1828 extern char const * prefs_get_star_iconfile(void)
1829 {
1830 return prefs_runtime_config.star_iconfile;
1831 }
1832
1833 static int conf_set_star_iconfile(const char *valstr)
1834 {
1835 return conf_set_str(&prefs_runtime_config.star_iconfile, valstr, NULL);
1836 }
1837
1838 static int conf_setdef_star_iconfile(void)
1839 {
1840 return conf_set_str(&prefs_runtime_config.star_iconfile, NULL, BNETD_STAR_ICON_FILE);
1841 }
1842
1843 static const char* conf_get_star_iconfile(void)
1844 {
1845 return prefs_runtime_config.star_iconfile;
1846 }
1847
1848
1849 extern char const * prefs_get_tosfile(void)
1850 {
1851 return prefs_runtime_config.tosfile;
1852 }
1853
1854 static int conf_set_tosfile(const char *valstr)
1855 {
1856 return conf_set_str(&prefs_runtime_config.tosfile, valstr, NULL);
1857 }
1858
1859 static int conf_setdef_tosfile(void)
1860 {
1861 return conf_set_str(&prefs_runtime_config.tosfile, NULL, BNETD_TOS_FILE);
1862 }
1863
1864 static const char* conf_get_tosfile(void)
1865 {
1866 return prefs_runtime_config.tosfile;
1867 }
1868
1869
1870 extern char const * prefs_get_mpqfile(void)
1871 {
1872 return prefs_runtime_config.mpqfile;
1873 }
1874
1875 static int conf_set_mpqfile(const char *valstr)
1876 {
1877 return conf_set_str(&prefs_runtime_config.mpqfile, valstr, NULL);
1878 }
1879
1880 static int conf_setdef_mpqfile(void)
1881 {
1882 return conf_set_str(&prefs_runtime_config.mpqfile, NULL, BNETD_MPQ_FILE);
1883 }
1884
1885 static const char* conf_get_mpqfile(void)
1886 {
1887 return prefs_runtime_config.mpqfile;
1888 }
1889
1890
1891 extern char const * prefs_get_trackserv_addrs(void)
1892 {
1893 return prefs_runtime_config.trackaddrs;
1894 }
1895
1896 static int conf_set_trackaddrs(const char *valstr)
1897 {
1898 return conf_set_str(&prefs_runtime_config.trackaddrs, valstr, NULL);
1899 }
1900
1901 static int conf_setdef_trackaddrs(void)
1902 {
1903 return conf_set_str(&prefs_runtime_config.trackaddrs, NULL, BNETD_TRACK_ADDRS);
1904 }
1905
1906 static const char* conf_get_trackaddrs(void)
1907 {
1908 return prefs_runtime_config.trackaddrs;
1909 }
1910
1911
1912 extern char const * prefs_get_bnetdserv_addrs(void)
1913 {
1914 return prefs_runtime_config.servaddrs;
1915 }
1916
1917 static int conf_set_servaddrs(const char *valstr)
1918 {
1919 return conf_set_str(&prefs_runtime_config.servaddrs, valstr, NULL);
1920 }
1921
1922 static int conf_setdef_servaddrs(void)
1923 {
1924 return conf_set_str(&prefs_runtime_config.servaddrs, NULL, BNETD_SERV_ADDRS);
1925 }
1926
1927 static const char* conf_get_servaddrs(void)
1928 {
1929 return prefs_runtime_config.servaddrs;
1930 }
1931
1932
1933 extern char const * prefs_get_w3route_addr(void)
1934 {
1935 return prefs_runtime_config.w3routeaddr;
1936 }
1937
1938 static int conf_set_w3routeaddr(const char *valstr)
1939 {
1940 return conf_set_str(&prefs_runtime_config.w3routeaddr, valstr, NULL);
1941 }
1942
1943 static int conf_setdef_w3routeaddr(void)
1944 {
1945 return conf_set_str(&prefs_runtime_config.w3routeaddr, NULL, BNETD_W3ROUTE_ADDR);
1946 }
1947
1948 static const char* conf_get_w3routeaddr(void)
1949 {
1950 return prefs_runtime_config.w3routeaddr;
1951 }
1952
1953
1954 extern char const * prefs_get_irc_addrs(void)
1955 {
1956 return prefs_runtime_config.ircaddrs;
1957 }
1958
1959 static int conf_set_ircaddrs(const char *valstr)
1960 {
1961 return conf_set_str(&prefs_runtime_config.ircaddrs, valstr, NULL);
1962 }
1963
1964 static int conf_setdef_ircaddrs(void)
1965 {
1966 return conf_set_str(&prefs_runtime_config.ircaddrs, NULL, BNETD_IRC_ADDRS);
1967 }
1968
1969 static const char* conf_get_ircaddrs(void)
1970 {
1971 return prefs_runtime_config.ircaddrs;
1972 }
1973
1974
1975 extern unsigned int prefs_get_use_keepalive(void)
1976 {
1977 return prefs_runtime_config.use_keepalive;
1978 }
1979
1980 static int conf_set_use_keepalive(const char *valstr)
1981 {
1982 return conf_set_bool(&prefs_runtime_config.use_keepalive, valstr, 0);
1983 }
1984
1985 static int conf_setdef_use_keepalive(void)
1986 {
1987 return conf_set_bool(&prefs_runtime_config.use_keepalive, NULL, 0);
1988 }
1989
1990 static const char* conf_get_use_keepalive(void)
1991 {
1992 return conf_get_bool(prefs_runtime_config.use_keepalive);
1993 }
1994
1995
1996 extern unsigned int prefs_get_udptest_port(void)
1997 {
1998 return prefs_runtime_config.udptest_port;
1999 }
2000
2001 static int conf_set_udptest_port(const char *valstr)
2002 {
2003 return conf_set_int(&prefs_runtime_config.udptest_port, valstr, 0);
2004 }
2005
2006 static int conf_setdef_udptest_port(void)
2007 {
2008 return conf_set_int(&prefs_runtime_config.udptest_port, NULL, BNETD_DEF_TEST_PORT);
2009 }
2010
2011 static const char* conf_get_udptest_port(void)
2012 {
2013 return conf_get_int(prefs_runtime_config.udptest_port);
2014 }
2015
2016
2017 extern char const * prefs_get_ipbanfile(void)
2018 {
2019 return prefs_runtime_config.ipbanfile;
2020 }
2021
2022 static int conf_set_ipbanfile(const char *valstr)
2023 {
2024 return conf_set_str(&prefs_runtime_config.ipbanfile, valstr, NULL);
2025 }
2026
2027 static int conf_setdef_ipbanfile(void)
2028 {
2029 return conf_set_str(&prefs_runtime_config.ipbanfile, NULL, BNETD_IPBAN_FILE);
2030 }
2031
2032 static const char* conf_get_ipbanfile(void)
2033 {
2034 return prefs_runtime_config.ipbanfile;
2035 }
2036
2037
2038 extern unsigned int prefs_get_discisloss(void)
2039 {
2040 return prefs_runtime_config.disc_is_loss;
2041 }
2042
2043 static int conf_set_disc_is_loss(const char *valstr)
2044 {
2045 return conf_set_bool(&prefs_runtime_config.disc_is_loss, valstr, 0);
2046 }
2047
2048 static int conf_setdef_disc_is_loss(void)
2049 {
2050 return conf_set_bool(&prefs_runtime_config.disc_is_loss, NULL, 0);
2051 }
2052
2053 static const char* conf_get_disc_is_loss(void)
2054 {
2055 return conf_get_bool(prefs_runtime_config.disc_is_loss);
2056 }
2057
2058
2059 extern char const * prefs_get_helpfile(void)
2060 {
2061 return prefs_runtime_config.helpfile;
2062 }
2063
2064 static int conf_set_helpfile(const char *valstr)
2065 {
2066 return conf_set_str(&prefs_runtime_config.helpfile, valstr, NULL);
2067 }
2068
2069 static int conf_setdef_helpfile(void)
2070 {
2071 return conf_set_str(&prefs_runtime_config.helpfile, NULL, BNETD_HELP_FILE);
2072 }
2073
2074 static const char* conf_get_helpfile(void)
2075 {
2076 return prefs_runtime_config.helpfile;
2077 }
2078
2079
2080 extern char const * prefs_get_transfile(void)
2081 {
2082 return prefs_runtime_config.transfile;
2083 }
2084
2085 static int conf_set_transfile(const char *valstr)
2086 {
2087 return conf_set_str(&prefs_runtime_config.transfile, valstr, NULL);
2088 }
2089
2090 static int conf_setdef_transfile(void)
2091 {
2092 return conf_set_str(&prefs_runtime_config.transfile, NULL, BNETD_TRANS_FILE);
2093 }
2094
2095 static const char* conf_get_transfile(void)
2096 {
2097 return prefs_runtime_config.transfile;
2098 }
2099
2100
2101 extern unsigned int prefs_get_chanlog(void)
2102 {
2103 return prefs_runtime_config.chanlog;
2104 }
2105
2106 static int conf_set_chanlog(const char *valstr)
2107 {
2108 return conf_set_bool(&prefs_runtime_config.chanlog, valstr, 0);
2109 }
2110
2111 static int conf_setdef_chanlog(void)
2112 {
2113 return conf_set_bool(&prefs_runtime_config.chanlog, NULL, BNETD_CHANLOG);
2114 }
2115
2116 static const char* conf_get_chanlog(void)
2117 {
2118 return conf_get_bool(prefs_runtime_config.chanlog);
2119 }
2120
2121
2122 extern char const * prefs_get_chanlogdir(void)
2123 {
2124 return prefs_runtime_config.chanlogdir;
2125 }
2126
2127 static int conf_set_chanlogdir(const char *valstr)
2128 {
2129 return conf_set_str(&prefs_runtime_config.chanlogdir, valstr, NULL);
2130 }
2131
2132 static int conf_setdef_chanlogdir(void)
2133 {
2134 return conf_set_str(&prefs_runtime_config.chanlogdir, NULL, BNETD_CHANLOG_DIR);
2135 }
2136
2137 static const char* conf_get_chanlogdir(void)
2138 {
2139 return prefs_runtime_config.chanlogdir;
2140 }
2141
2142
2143 extern char const * prefs_get_userlogdir(void)
2144 {
2145 return prefs_runtime_config.userlogdir;
2146 }
2147
2148 static int conf_set_userlogdir(const char *valstr)
2149 {
2150 return conf_set_str(&prefs_runtime_config.userlogdir, valstr, NULL);
2151 }
2152
2153 static int conf_setdef_userlogdir(void)
2154 {
2155 return conf_set_str(&prefs_runtime_config.userlogdir, NULL, BNETD_USERLOG_DIR);
2156 }
2157
2158 static const char* conf_get_userlogdir(void)
2159 {
2160 return prefs_runtime_config.userlogdir;
2161 }
2162
2163
2164 extern unsigned int prefs_get_quota(void)
2165 {
2166 return prefs_runtime_config.quota;
2167 }
2168
2169 static int conf_set_quota(const char *valstr)
2170 {
2171 return conf_set_bool(&prefs_runtime_config.quota, valstr, 0);
2172 }
2173
2174 static int conf_setdef_quota(void)
2175 {
2176 return conf_set_bool(&prefs_runtime_config.quota, NULL, 0);
2177 }
2178
2179 static const char* conf_get_quota(void)
2180 {
2181 return conf_get_bool(prefs_runtime_config.quota);
2182 }
2183
2184
2185 extern unsigned int prefs_get_quota_lines(void)
2186 {
2187 unsigned int rez;
2188
2189 rez = prefs_runtime_config.quota_lines;
2190 if (rez<1) rez = 1;
2191 if (rez>100) rez = 100;
2192 return rez;
2193 }
2194
2195 static int conf_set_quota_lines(const char *valstr)
2196 {
2197 return conf_set_int(&prefs_runtime_config.quota_lines, valstr, 0);
2198 }
2199
2200 static int conf_setdef_quota_lines(void)
2201 {
2202 return conf_set_int(&prefs_runtime_config.quota_lines, NULL, BNETD_QUOTA_LINES);
2203 }
2204
2205 static const char* conf_get_quota_lines(void)
2206 {
2207 return conf_get_int(prefs_runtime_config.quota_lines);
2208 }
2209
2210
2211 extern unsigned int prefs_get_quota_time(void)
2212 {
2213 unsigned int rez;
2214
2215 rez = prefs_runtime_config.quota_time;
2216 if (rez<1) rez = 1;
2217 if (rez>10) rez = 60;
2218 return rez;
2219 }
2220
2221 static int conf_set_quota_time(const char *valstr)
2222 {
2223 return conf_set_int(&prefs_runtime_config.quota_time, valstr, 0);
2224 }
2225
2226 static int conf_setdef_quota_time(void)
2227 {
2228 return conf_set_int(&prefs_runtime_config.quota_time, NULL, BNETD_QUOTA_TIME);
2229 }
2230
2231 static const char* conf_get_quota_time(void)
2232 {
2233 return conf_get_int(prefs_runtime_config.quota_time);
2234 }
2235
2236
2237 extern unsigned int prefs_get_quota_wrapline(void)
2238 {
2239 unsigned int rez;
2240
2241 rez = prefs_runtime_config.quota_wrapline;
2242 if (rez<1) rez = 1;
2243 if (rez>256) rez = 256;
2244 return rez;
2245 }
2246
2247 static int conf_set_quota_wrapline(const char *valstr)
2248 {
2249 return conf_set_int(&prefs_runtime_config.quota_wrapline, valstr, 0);
2250 }
2251
2252 static int conf_setdef_quota_wrapline(void)
2253 {
2254 return conf_set_int(&prefs_runtime_config.quota_wrapline, NULL, BNETD_QUOTA_WLINE);
2255 }
2256
2257 static const char* conf_get_quota_wrapline(void)
2258 {
2259 return conf_get_int(prefs_runtime_config.quota_wrapline);
2260 }
2261
2262
2263 extern unsigned int prefs_get_quota_maxline(void)
2264 {
2265 unsigned int rez;
2266
2267 rez = prefs_runtime_config.quota_maxline;
2268 if (rez<1) rez = 1;
2269 if (rez>256) rez = 256;
2270 return rez;
2271 }
2272
2273 static int conf_set_quota_maxline(const char *valstr)
2274 {
2275 return conf_set_int(&prefs_runtime_config.quota_maxline, valstr, 0);
2276 }
2277
2278 static int conf_setdef_quota_maxline(void)
2279 {
2280 return conf_set_int(&prefs_runtime_config.quota_maxline, NULL, BNETD_QUOTA_MLINE);
2281 }
2282
2283 static const char* conf_get_quota_maxline(void)
2284 {
2285 return conf_get_int(prefs_runtime_config.quota_maxline);
2286 }
2287
2288
2289 extern unsigned int prefs_get_ladder_init_rating(void)
2290 {
2291 return prefs_runtime_config.ladder_init_rating;
2292 }
2293
2294 static int conf_set_ladder_init_rating(const char *valstr)
2295 {
2296 return conf_set_int(&prefs_runtime_config.ladder_init_rating, valstr, 0);
2297 }
2298
2299 static int conf_setdef_ladder_init_rating(void)
2300 {
2301 return conf_set_int(&prefs_runtime_config.ladder_init_rating, NULL, BNETD_LADDER_INIT_RAT);
2302 }
2303
2304 static const char* conf_get_ladder_init_rating(void)
2305 {
2306 return conf_get_int(prefs_runtime_config.ladder_init_rating);
2307 }
2308
2309
2310 extern unsigned int prefs_get_quota_dobae(void)
2311 {
2312 unsigned int rez;
2313
2314 rez = prefs_runtime_config.quota_dobae;
2315 if (rez<1) rez = 1;
2316 if (rez>100) rez = 100;
2317 return rez;
2318 }
2319
2320 static int conf_set_quota_dobae(const char *valstr)
2321 {
2322 return conf_set_int(&prefs_runtime_config.quota_dobae, valstr, 0);
2323 }
2324
2325 static int conf_setdef_quota_dobae(void)
2326 {
2327 return conf_set_int(&prefs_runtime_config.quota_dobae, NULL, BNETD_QUOTA_DOBAE);
2328 }
2329
2330 static const char* conf_get_quota_dobae(void)
2331 {
2332 return conf_get_int(prefs_runtime_config.quota_dobae);
2333 }
2334
2335
2336 extern char const * prefs_get_realmfile(void)
2337 {
2338 return prefs_runtime_config.realmfile;
2339 }
2340
2341 static int conf_set_realmfile(const char *valstr)
2342 {
2343 return conf_set_str(&prefs_runtime_config.realmfile, valstr, NULL);
2344 }
2345
2346 static int conf_setdef_realmfile(void)
2347 {
2348 return conf_set_str(&prefs_runtime_config.realmfile, NULL, BNETD_REALM_FILE);
2349 }
2350
2351 static const char* conf_get_realmfile(void)
2352 {
2353 return prefs_runtime_config.realmfile;
2354 }
2355
2356
2357 extern char const * prefs_get_issuefile(void)
2358 {
2359 return prefs_runtime_config.issuefile;
2360 }
2361
2362 static int conf_set_issuefile(const char *valstr)
2363 {
2364 return conf_set_str(&prefs_runtime_config.issuefile, valstr, NULL);
2365 }
2366
2367 static int conf_setdef_issuefile(void)
2368 {
2369 return conf_set_str(&prefs_runtime_config.issuefile, NULL, BNETD_ISSUE_FILE);
2370 }
2371
2372 static const char* conf_get_issuefile(void)
2373 {
2374 return prefs_runtime_config.issuefile;
2375 }
2376
2377
2378 extern char const * prefs_get_effective_user(void)
2379 {
2380 return prefs_runtime_config.effective_user;
2381 }
2382
2383 static int conf_set_effective_user(const char *valstr)
2384 {
2385 return conf_set_str(&prefs_runtime_config.effective_user, valstr, NULL);
2386 }
2387
2388 static int conf_setdef_effective_user(void)
2389 {
2390 return conf_set_str(&prefs_runtime_config.effective_user, NULL, NULL);
2391 }
2392
2393 static const char* conf_get_effective_user(void)
2394 {
2395 return prefs_runtime_config.effective_user;
2396 }
2397
2398
2399 extern char const * prefs_get_effective_group(void)
2400 {
2401 return prefs_runtime_config.effective_group;
2402 }
2403
2404 static int conf_set_effective_group(const char *valstr)
2405 {
2406 return conf_set_str(&prefs_runtime_config.effective_group, valstr, NULL);
2407 }
2408
2409 static int conf_setdef_effective_group(void)
2410 {
2411 return conf_set_str(&prefs_runtime_config.effective_group, NULL, NULL);
2412 }
2413
2414 static const char* conf_get_effective_group(void)
2415 {
2416 return prefs_runtime_config.effective_group;
2417 }
2418
2419
2420 extern unsigned int prefs_get_nullmsg(void)
2421 {
2422 return prefs_runtime_config.nullmsg;
2423 }
2424
2425 static int conf_set_nullmsg(const char *valstr)
2426 {
2427 return conf_set_int(&prefs_runtime_config.nullmsg, valstr, 0);
2428 }
2429
2430 static int conf_setdef_nullmsg(void)
2431 {
2432 return conf_set_int(&prefs_runtime_config.nullmsg, NULL, BNETD_DEF_NULLMSG);
2433 }
2434
2435 static const char* conf_get_nullmsg(void)
2436 {
2437 return conf_get_int(prefs_runtime_config.nullmsg);
2438 }
2439
2440
2441 extern unsigned int prefs_get_mail_support(void)
2442 {
2443 return prefs_runtime_config.mail_support;
2444 }
2445
2446 static int conf_set_mail_support(const char *valstr)
2447 {
2448 return conf_set_bool(&prefs_runtime_config.mail_support, valstr, 0);
2449 }
2450
2451 static int conf_setdef_mail_support(void)
2452 {
2453 return conf_set_bool(&prefs_runtime_config.mail_support, NULL, BNETD_MAIL_SUPPORT);
2454 }
2455
2456 static const char* conf_get_mail_support(void)
2457 {
2458 return conf_get_bool(prefs_runtime_config.mail_support);
2459 }
2460
2461
2462 extern unsigned int prefs_get_mail_quota(void)
2463 {
2464 unsigned int rez;
2465
2466 rez = prefs_runtime_config.mail_quota;
2467 if (rez<1) rez = 1;
2468 if (rez>30) rez = 30;
2469 return rez;
2470 }
2471
2472 static int conf_set_mail_quota(const char *valstr)
2473 {
2474 return conf_set_int(&prefs_runtime_config.mail_quota, valstr, 0);
2475 }
2476
2477 static int conf_setdef_mail_quota(void)
2478 {
2479 return conf_set_int(&prefs_runtime_config.mail_quota, NULL, BNETD_MAIL_QUOTA);
2480 }
2481
2482 static const char* conf_get_mail_quota(void)
2483 {
2484 return conf_get_int(prefs_runtime_config.mail_quota);
2485 }
2486
2487
2488 extern char const * prefs_get_maildir(void)
2489 {
2490 return prefs_runtime_config.maildir;
2491 }
2492
2493 static int conf_set_maildir(const char *valstr)
2494 {
2495 return conf_set_str(&prefs_runtime_config.maildir, valstr, NULL);
2496 }
2497
2498 static int conf_setdef_maildir(void)
2499 {
2500 return conf_set_str(&prefs_runtime_config.maildir, NULL, BNETD_MAIL_DIR);
2501 }
2502
2503 static const char* conf_get_maildir(void)
2504 {
2505 return prefs_runtime_config.maildir;
2506 }
2507
2508
2509 extern char const * prefs_get_log_notice(void)
2510 {
2511 return prefs_runtime_config.log_notice;
2512 }
2513
2514 static int conf_set_log_notice(const char *valstr)
2515 {
2516 return conf_set_str(&prefs_runtime_config.log_notice, valstr, NULL);
2517 }
2518
2519 static int conf_setdef_log_notice(void)
2520 {
2521 return conf_set_str(&prefs_runtime_config.log_notice, NULL, BNETD_LOG_NOTICE);
2522 }
2523
2524 static const char* conf_get_log_notice(void)
2525 {
2526 return prefs_runtime_config.log_notice;
2527 }
2528
2529
2530 extern unsigned int prefs_get_savebyname(void)
2531 {
2532 return prefs_runtime_config.savebyname;
2533 }
2534
2535 static int conf_set_savebyname(const char *valstr)
2536 {
2537 return conf_set_bool(&prefs_runtime_config.savebyname, valstr, 0);
2538 }
2539
2540 static int conf_setdef_savebyname(void)
2541 {
2542 return conf_set_bool(&prefs_runtime_config.savebyname, NULL, 1);
2543 }
2544
2545 static const char* conf_get_savebyname(void)
2546 {
2547 return conf_get_bool(prefs_runtime_config.savebyname);
2548 }
2549
2550
2551 extern unsigned int prefs_get_allow_bad_version(void)
2552 {
2553 return prefs_runtime_config.allow_bad_version;
2554 }
2555
2556 static int conf_set_allow_bad_version(const char *valstr)
2557 {
2558 return conf_set_bool(&prefs_runtime_config.allow_bad_version, valstr, 0);
2559 }
2560
2561 static int conf_setdef_allow_bad_version(void)
2562 {
2563 return conf_set_bool(&prefs_runtime_config.allow_bad_version, NULL, 0);
2564 }
2565
2566 static const char* conf_get_allow_bad_version(void)
2567 {
2568 return conf_get_bool(prefs_runtime_config.allow_bad_version);
2569 }
2570
2571
2572 extern unsigned int prefs_get_allow_unknown_version(void)
2573 {
2574 return prefs_runtime_config.allow_unknown_version;
2575 }
2576
2577 static int conf_set_allow_unknown_version(const char *valstr)
2578 {
2579 return conf_set_bool(&prefs_runtime_config.allow_unknown_version, valstr, 0);
2580 }
2581
2582 static int conf_setdef_allow_unknown_version(void)
2583 {
2584 return conf_set_bool(&prefs_runtime_config.allow_unknown_version, NULL, 0);
2585 }
2586
2587 static const char* conf_get_allow_unknown_version(void)
2588 {
2589 return conf_get_bool(prefs_runtime_config.allow_unknown_version);
2590 }
2591
2592
2593 extern char const * prefs_get_versioncheck_file(void)
2594 {
2595 return prefs_runtime_config.versioncheck_file;
2596 }
2597
2598 static int conf_set_versioncheck_file(const char *valstr)
2599 {
2600 return conf_set_str(&prefs_runtime_config.versioncheck_file, valstr, NULL);
2601 }
2602
2603 static int conf_setdef_versioncheck_file(void)
2604 {
2605 return conf_set_str(&prefs_runtime_config.versioncheck_file, NULL, PVPGN_VERSIONCHECK);
2606 }
2607
2608 static const char* conf_get_versioncheck_file(void)
2609 {
2610 return prefs_runtime_config.versioncheck_file;
2611 }
2612
2613
2614 extern unsigned int prefs_allow_d2cs_setname(void)
2615 {
2616 return prefs_runtime_config.allow_d2cs_setname;
2617 }
2618
2619 static int conf_set_allow_d2cs_setname(const char *valstr)
2620 {
2621 return conf_set_bool(&prefs_runtime_config.allow_d2cs_setname, valstr, 0);
2622 }
2623
2624 static int conf_setdef_allow_d2cs_setname(void)
2625 {
2626 return conf_set_bool(&prefs_runtime_config.allow_d2cs_setname, NULL, 1);
2627 }
2628
2629 static const char* conf_get_allow_d2cs_setname(void)
2630 {
2631 return conf_get_bool(prefs_runtime_config.allow_d2cs_setname);
2632 }
2633
2634
2635 extern unsigned int prefs_get_d2cs_version(void)
2636 {
2637 return prefs_runtime_config.d2cs_version;
2638 }
2639
2640 static int conf_set_d2cs_version(const char *valstr)
2641 {
2642 return conf_set_int(&prefs_runtime_config.d2cs_version, valstr, 0);
2643 }
2644
2645 static int conf_setdef_d2cs_version(void)
2646 {
2647 return conf_set_int(&prefs_runtime_config.d2cs_version, NULL, 0);
2648 }
2649
2650 static const char* conf_get_d2cs_version(void)
2651 {
2652 return conf_get_int(prefs_runtime_config.d2cs_version);
2653 }
2654
2655
2656 extern unsigned int prefs_get_hashtable_size(void)
2657 {
2658 return prefs_runtime_config.hashtable_size;
2659 }
2660
2661 static int conf_set_hashtable_size(const char *valstr)
2662 {
2663 return conf_set_int(&prefs_runtime_config.hashtable_size, valstr, 0);
2664 }
2665
2666 static int conf_setdef_hashtable_size(void)
2667 {
2668 return conf_set_int(&prefs_runtime_config.hashtable_size, NULL, BNETD_HASHTABLE_SIZE);
2669 }
2670
2671 static const char* conf_get_hashtable_size(void)
2672 {
2673 return conf_get_int(prefs_runtime_config.hashtable_size);
2674 }
2675
2676
2677 extern char const * prefs_get_telnet_addrs(void)
2678 {
2679 return prefs_runtime_config.telnetaddrs;
2680 }
2681
2682 static int conf_set_telnetaddrs(const char *valstr)
2683 {
2684 return conf_set_str(&prefs_runtime_config.telnetaddrs, valstr, NULL);
2685 }
2686
2687 static int conf_setdef_telnetaddrs(void)
2688 {
2689 return conf_set_str(&prefs_runtime_config.telnetaddrs, NULL, BNETD_TELNET_ADDRS);
2690 }
2691
2692 static const char* conf_get_telnetaddrs(void)
2693 {
2694 return prefs_runtime_config.telnetaddrs;
2695 }
2696
2697
2698 extern unsigned int prefs_get_ipban_check_int(void)
2699 {
2700 return prefs_runtime_config.ipban_check_int;
2701 }
2702
2703 static int conf_set_ipban_check_int(const char *valstr)
2704 {
2705 return conf_set_int(&prefs_runtime_config.ipban_check_int, valstr, 0);
2706 }
2707
2708 static int conf_setdef_ipban_check_int(void)
2709 {
2710 return conf_set_int(&prefs_runtime_config.ipban_check_int, NULL, 30);
2711 }
2712
2713 static const char* conf_get_ipban_check_int(void)
2714 {
2715 return conf_get_int(prefs_runtime_config.ipban_check_int);
2716 }
2717
2718
2719 extern unsigned int prefs_get_max_concurrent_logins(void)
2720 {
2721 return prefs_runtime_config.max_concurrent_logins;
2722 }
2723
2724 static int conf_set_max_concurrent_logins(const char *valstr)
2725 {
2726 return conf_set_int(&prefs_runtime_config.max_concurrent_logins, valstr, 0);
2727 }
2728
2729 static int conf_setdef_max_concurrent_logins(void)
2730 {
2731 return conf_set_int(&prefs_runtime_config.max_concurrent_logins, NULL, 0);
2732 }
2733
2734 static const char* conf_get_max_concurrent_logins(void)
2735 {
2736 return conf_get_int(prefs_runtime_config.max_concurrent_logins);
2737 }
2738
2739
2740 extern char const * prefs_get_mapsfile(void)
2741 {
2742 return prefs_runtime_config.mapsfile;
2743 }
2744
2745 static int conf_set_mapsfile(const char *valstr)
2746 {
2747 return conf_set_str(&prefs_runtime_config.mapsfile, valstr, NULL);
2748 }
2749
2750 static int conf_setdef_mapsfile(void)
2751 {
2752 return conf_set_str(&prefs_runtime_config.mapsfile, NULL, NULL);
2753 }
2754
2755 static const char* conf_get_mapsfile(void)
2756 {
2757 return prefs_runtime_config.mapsfile;
2758 }
2759
2760
2761 extern char const * prefs_get_xplevel_file(void)
2762 {
2763 return prefs_runtime_config.xplevelfile;
2764 }
2765
2766 static int conf_set_xplevelfile(const char *valstr)
2767 {
2768 return conf_set_str(&prefs_runtime_config.xplevelfile, valstr, NULL);
2769 }
2770
2771 static int conf_setdef_xplevelfile(void)
2772 {
2773 return conf_set_str(&prefs_runtime_config.xplevelfile, NULL, NULL);
2774 }
2775
2776 static const char* conf_get_xplevelfile(void)
2777 {
2778 return prefs_runtime_config.xplevelfile;
2779 }
2780
2781
2782 extern char const * prefs_get_xpcalc_file(void)
2783 {
2784 return prefs_runtime_config.xpcalcfile;
2785 }
2786
2787 static int conf_set_xpcalcfile(const char *valstr)
2788 {
2789 return conf_set_str(&prefs_runtime_config.xpcalcfile, valstr, NULL);
2790 }
2791
2792 static int conf_setdef_xpcalcfile(void)
2793 {
2794 return conf_set_str(&prefs_runtime_config.xpcalcfile, NULL, NULL);
2795 }
2796
2797 static const char* conf_get_xpcalcfile(void)
2798 {
2799 return prefs_runtime_config.xpcalcfile;
2800 }
2801
2802
2803 extern int prefs_get_initkill_timer(void)
2804 {
2805 return prefs_runtime_config.initkill_timer;
2806 }
2807
2808 static int conf_set_initkill_timer(const char *valstr)
2809 {
2810 return conf_set_int(&prefs_runtime_config.initkill_timer, valstr, 0);
2811 }
2812
2813 static int conf_setdef_initkill_timer(void)
2814 {
2815 return conf_set_int(&prefs_runtime_config.initkill_timer, NULL, 0);
2816 }
2817
2818 static const char* conf_get_initkill_timer(void)
2819 {
2820 return conf_get_int(prefs_runtime_config.initkill_timer);
2821 }
2822
2823
2824 extern int prefs_get_war3_ladder_update_secs(void)
2825 {
2826 return prefs_runtime_config.war3_ladder_update_secs;
2827 }
2828
2829 static int conf_set_war3_ladder_update_secs(const char *valstr)
2830 {
2831 return conf_set_int(&prefs_runtime_config.war3_ladder_update_secs, valstr, 0);
2832 }
2833
2834 static int conf_setdef_war3_ladder_update_secs(void)
2835 {
2836 return conf_set_int(&prefs_runtime_config.war3_ladder_update_secs, NULL, 0);
2837 }
2838
2839 static const char* conf_get_war3_ladder_update_secs(void)
2840 {
2841 return conf_get_int(prefs_runtime_config.war3_ladder_update_secs);
2842 }
2843
2844
2845 extern int prefs_get_output_update_secs(void)
2846 {
2847 return prefs_runtime_config.output_update_secs;
2848 }
2849
2850 static int conf_set_output_update_secs(const char *valstr)
2851 {
2852 return conf_set_int(&prefs_runtime_config.output_update_secs, valstr, 0);
2853 }
2854
2855 static int conf_setdef_output_update_secs(void)
2856 {
2857 return conf_set_int(&prefs_runtime_config.output_update_secs, NULL, 0);
2858 }
2859
2860 static const char* conf_get_output_update_secs(void)
2861 {
2862 return conf_get_int(prefs_runtime_config.output_update_secs);
2863 }
2864
2865
2866 extern char const * prefs_get_ladderdir(void)
2867 {
2868 return prefs_runtime_config.ladderdir;
2869 }
2870
2871 static int conf_set_ladderdir(const char *valstr)
2872 {
2873 return conf_set_str(&prefs_runtime_config.ladderdir, valstr, NULL);
2874 }
2875
2876 static int conf_setdef_ladderdir(void)
2877 {
2878 return conf_set_str(&prefs_runtime_config.ladderdir, NULL, BNETD_LADDER_DIR);
2879 }
2880
2881 static const char* conf_get_ladderdir(void)
2882 {
2883 return prefs_runtime_config.ladderdir;
2884 }
2885
2886
2887 extern char const * prefs_get_outputdir(void)
2888 {
2889 return prefs_runtime_config.statusdir;
2890 }
2891
2892 static int conf_set_statusdir(const char *valstr)
2893 {
2894 return conf_set_str(&prefs_runtime_config.statusdir, valstr, NULL);
2895 }
2896
2897 static int conf_setdef_statusdir(void)
2898 {
2899 return conf_set_str(&prefs_runtime_config.statusdir, NULL, BNETD_STATUS_DIR);
2900 }
2901
2902 static const char* conf_get_statusdir(void)
2903 {
2904 return prefs_runtime_config.statusdir;
2905 }
2906
2907
2908 extern int prefs_get_XML_output_ladder(void)
2909 {
2910 return prefs_runtime_config.XML_output_ladder;
2911 }
2912
2913 static int conf_set_XML_output_ladder(const char *valstr)
2914 {
2915 return conf_set_bool(&prefs_runtime_config.XML_output_ladder, valstr, 0);
2916 }
2917
2918 static int conf_setdef_XML_output_ladder(void)
2919 {
2920 return conf_set_bool(&prefs_runtime_config.XML_output_ladder, NULL, 0);
2921 }
2922
2923 static const char* conf_get_XML_output_ladder(void)
2924 {
2925 return conf_get_bool(prefs_runtime_config.XML_output_ladder);
2926 }
2927
2928
2929 extern int prefs_get_XML_status_output(void)
2930 {
2931 return prefs_runtime_config.XML_status_output;
2932 }
2933
2934 static int conf_set_XML_status_output(const char *valstr)
2935 {
2936 return conf_set_bool(&prefs_runtime_config.XML_status_output, valstr, 0);
2937 }
2938
2939 static int conf_setdef_XML_status_output(void)
2940 {
2941 return conf_set_bool(&prefs_runtime_config.XML_status_output, NULL, 0);
2942 }
2943
2944 static const char* conf_get_XML_status_output(void)
2945 {
2946 return conf_get_bool(prefs_runtime_config.XML_status_output);
2947 }
2948
2949
2950 extern char const * prefs_get_account_allowed_symbols(void)
2951 {
2952 return prefs_runtime_config.account_allowed_symbols;
2953 }
2954
2955 static int conf_set_account_allowed_symbols(const char *valstr)
2956 {
2957 return conf_set_str(&prefs_runtime_config.account_allowed_symbols, valstr, NULL);
2958 }
2959
2960 static int conf_setdef_account_allowed_symbols(void)
2961 {
2962 return conf_set_str(&prefs_runtime_config.account_allowed_symbols, NULL, PVPGN_DEFAULT_SYMB);
2963 }
2964
2965 static const char* conf_get_account_allowed_symbols(void)
2966 {
2967 return prefs_runtime_config.account_allowed_symbols;
2968 }
2969
2970
2971 extern unsigned int prefs_get_account_force_username(void)
2972 {
2973 return prefs_runtime_config.account_force_username;
2974 }
2975
2976 static int conf_set_account_force_username(const char *valstr)
2977 {
2978 return conf_set_bool(&prefs_runtime_config.account_force_username, valstr, 0);
2979 }
2980
2981 static int conf_setdef_account_force_username(void)
2982 {
2983 return conf_set_bool(&prefs_runtime_config.account_force_username, NULL, 0);
2984 }
2985
2986 static const char* conf_get_account_force_username(void)
2987 {
2988 return conf_get_bool(prefs_runtime_config.account_force_username);
2989 }
2990
2991 extern char const * prefs_get_command_groups_file(void)
2992 {
2993 return prefs_runtime_config.command_groups_file;
2994 }
2995
2996 static int conf_set_command_groups_file(const char *valstr)
2997 {
2998 return conf_set_str(&prefs_runtime_config.command_groups_file, valstr, NULL);
2999 }
3000
3001 static int conf_setdef_command_groups_file(void)
3002 {
3003 return conf_set_str(&prefs_runtime_config.command_groups_file, NULL, BNETD_COMMAND_GROUPS_FILE);
3004 }
3005
3006 static const char* conf_get_command_groups_file(void)
3007 {
3008 return prefs_runtime_config.command_groups_file;
3009 }
3010
3011
3012 extern char const * prefs_get_tournament_file(void)
3013 {
3014 return prefs_runtime_config.tournament_file;
3015 }
3016
3017 static int conf_set_tournament_file(const char *valstr)
3018 {
3019 return conf_set_str(&prefs_runtime_config.tournament_file, valstr, NULL);
3020 }
3021
3022 static int conf_setdef_tournament_file(void)
3023 {
3024 return conf_set_str(&prefs_runtime_config.tournament_file, NULL, BNETD_TOURNAMENT_FILE);
3025 }
3026
3027 static const char* conf_get_tournament_file(void)
3028 {
3029 return prefs_runtime_config.tournament_file;
3030 }
3031
3032
3033 extern char const * prefs_get_customicons_file(void)
3034 {
3035 return prefs_runtime_config.customicons_file;
3036 }
3037
3038 static int conf_set_customicons_file(const char *valstr)
3039 {
3040 return conf_set_str(&prefs_runtime_config.customicons_file, valstr, NULL);
3041 }
3042
3043 static int conf_setdef_customicons_file(void)
3044 {
3045 return conf_set_str(&prefs_runtime_config.customicons_file, NULL, BNETD_CUSTOMICONS_FILE);
3046 }
3047
3048 static const char* conf_get_customicons_file(void)
3049 {
3050 return prefs_runtime_config.customicons_file;
3051 }
3052
3053 extern char const * prefs_get_scriptdir(void)
3054 {
3055 return prefs_runtime_config.scriptdir;
3056 }
3057
3058 static int conf_set_scriptdir(const char *valstr)
3059 {
3060 return conf_set_str(&prefs_runtime_config.scriptdir, valstr, NULL);
3061 }
3062
3063 static int conf_setdef_scriptdir(void)
3064 {
3065 return conf_set_str(&prefs_runtime_config.scriptdir, NULL, BNETD_SCRIPT_DIR);
3066 }
3067
3068 static const char* conf_get_scriptdir(void)
3069 {
3070 return prefs_runtime_config.scriptdir;
3071 }
3072
3073 extern char const * prefs_get_aliasfile(void)
3074 {
3075 return prefs_runtime_config.aliasfile;
3076 }
3077
3078 static int conf_set_aliasfile(const char *valstr)
3079 {
3080 return conf_set_str(&prefs_runtime_config.aliasfile, valstr, NULL);
3081 }
3082
3083 static int conf_setdef_aliasfile(void)
3084 {
3085 return conf_set_str(&prefs_runtime_config.aliasfile, NULL, BNETD_ALIASFILE);
3086 }
3087
3088 static const char* conf_get_aliasfile(void)
3089 {
3090 return prefs_runtime_config.aliasfile;
3091 }
3092
3093
3094 extern char const * prefs_get_anongame_infos_file(void)
3095 {
3096 return prefs_runtime_config.anongame_infos_file;
3097 }
3098
3099 static int conf_set_anongame_infos_file(const char *valstr)
3100 {
3101 return conf_set_str(&prefs_runtime_config.anongame_infos_file, valstr, NULL);
3102 }
3103
3104 static int conf_setdef_anongame_infos_file(void)
3105 {
3106 return conf_set_str(&prefs_runtime_config.anongame_infos_file, NULL, PVPGN_AINFO_FILE);
3107 }
3108
3109 static const char* conf_get_anongame_infos_file(void)
3110 {
3111 return prefs_runtime_config.anongame_infos_file;
3112 }
3113
3114
3115 extern unsigned int prefs_get_max_conns_per_IP(void)
3116 {
3117 return prefs_runtime_config.max_conns_per_IP;
3118 }
3119
3120 static int conf_set_max_conns_per_IP(const char *valstr)
3121 {
3122 return conf_set_int(&prefs_runtime_config.max_conns_per_IP, valstr, 0);
3123 }
3124
3125 static int conf_setdef_max_conns_per_IP(void)
3126 {
3127 return conf_set_int(&prefs_runtime_config.max_conns_per_IP, NULL, 0);
3128 }
3129
3130 static const char* conf_get_max_conns_per_IP(void)
3131 {
3132 return conf_get_int(prefs_runtime_config.max_conns_per_IP);
3133 }
3134
3135
3136 extern int prefs_get_max_friends(void)
3137 {
3138 return prefs_runtime_config.max_friends;
3139 }
3140
3141 static int conf_set_max_friends(const char *valstr)
3142 {
3143 return conf_set_int(&prefs_runtime_config.max_friends, valstr, 0);
3144 }
3145
3146 static int conf_setdef_max_friends(void)
3147 {
3148 return conf_set_int(&prefs_runtime_config.max_friends, NULL, MAX_FRIENDS);
3149 }
3150
3151 static const char* conf_get_max_friends(void)
3152 {
3153 return conf_get_int(prefs_runtime_config.max_friends);
3154 }
3155
3156
3157 extern unsigned int prefs_get_clan_newer_time(void)
3158 {
3159 return prefs_runtime_config.clan_newer_time;
3160 }
3161
3162 static int conf_set_clan_newer_time(const char *valstr)
3163 {
3164 return conf_set_int(&prefs_runtime_config.clan_newer_time, valstr, 0);
3165 }
3166
3167 static int conf_setdef_clan_newer_time(void)
3168 {
3169 return conf_set_int(&prefs_runtime_config.clan_newer_time, NULL, CLAN_NEWER_TIME);
3170 }
3171
3172 static const char* conf_get_clan_newer_time(void)
3173 {
3174 return conf_get_int(prefs_runtime_config.clan_newer_time);
3175 }
3176
3177
3178 extern unsigned int prefs_get_clan_max_members(void)
3179 {
3180 return prefs_runtime_config.clan_max_members;
3181 }
3182
3183 static int conf_set_clan_max_members(const char *valstr)
3184 {
3185 int rez = conf_set_int(&prefs_runtime_config.clan_max_members, valstr, 0);
3186
3187 if (!rez && valstr) {
3188 if (prefs_runtime_config.clan_max_members < CLAN_MIN_MEMBERS) {
3189 WARN1("Cannot set clan max members to {} lower than 10, setting to 10.", prefs_runtime_config.clan_max_members);
3190 prefs_runtime_config.clan_max_members = CLAN_MIN_MEMBERS;
3191 }
3192 else if (prefs_runtime_config.clan_max_members > CLAN_MAX_MEMBERS) {
3193 WARN1("Cannot set clan max members to {} higher than 100, setting to 100.", prefs_runtime_config.clan_max_members);
3194 prefs_runtime_config.clan_max_members = CLAN_MAX_MEMBERS;
3195 }
3196 }
3197
3198 return rez;
3199 }
3200
3201 static int conf_setdef_clan_max_members(void)
3202 {
3203 return conf_set_int(&prefs_runtime_config.clan_max_members, NULL, CLAN_DEFAULT_MAX_MEMBERS);
3204 }
3205
3206 static const char* conf_get_clan_max_members(void)
3207 {
3208 return conf_get_int(prefs_runtime_config.clan_max_members);
3209 }
3210
3211
3212 extern unsigned int prefs_get_clan_channel_default_private(void)
3213 {
3214 return prefs_runtime_config.clan_channel_default_private;
3215 }
3216
3217 static int conf_set_clan_channel_default_private(const char *valstr)
3218 {
3219 return conf_set_bool(&prefs_runtime_config.clan_channel_default_private, valstr, 0);
3220 }
3221
3222 static int conf_setdef_clan_channel_default_private(void)
3223 {
3224 return conf_set_bool(&prefs_runtime_config.clan_channel_default_private, NULL, 0);
3225 }
3226
3227 static const char* conf_get_clan_channel_default_private(void)
3228 {
3229 return conf_get_bool(prefs_runtime_config.clan_channel_default_private);
3230 }
3231
3232 extern unsigned int prefs_get_clan_min_invites(void)
3233 {
3234 return prefs_runtime_config.clan_min_invites;
3235 }
3236
3237 static int conf_set_clan_min_invites(const char *valstr)
3238 {
3239 return conf_set_int(&prefs_runtime_config.clan_min_invites, valstr, 0);
3240 }
3241
3242 static int conf_setdef_clan_min_invites(void)
3243 {
3244 return conf_set_int(&prefs_runtime_config.clan_min_invites, NULL, CLAN_DEFAULT_MIN_INVITES);
3245 }
3246
3247 static const char* conf_get_clan_min_invites(void)
3248 {
3249 return conf_get_int(prefs_runtime_config.clan_min_invites);
3250 }
3251
3252 extern unsigned int prefs_get_passfail_count(void)
3253 {
3254 return prefs_runtime_config.passfail_count;
3255 }
3256
3257 static int conf_set_passfail_count(const char *valstr)
3258 {
3259 return conf_set_int(&prefs_runtime_config.passfail_count, valstr, 0);
3260 }
3261
3262 static int conf_setdef_passfail_count(void)
3263 {
3264 return conf_set_int(&prefs_runtime_config.passfail_count, NULL, 0);
3265 }
3266
3267 static const char* conf_get_passfail_count(void)
3268 {
3269 return conf_get_int(prefs_runtime_config.passfail_count);
3270 }
3271
3272
3273 extern unsigned int prefs_get_passfail_bantime(void)
3274 {
3275 return prefs_runtime_config.passfail_bantime;
3276 }
3277
3278 static int conf_set_passfail_bantime(const char *valstr)
3279 {
3280 return conf_set_int(&prefs_runtime_config.passfail_bantime, valstr, 0);
3281 }
3282
3283 static int conf_setdef_passfail_bantime(void)
3284 {
3285 return conf_set_int(&prefs_runtime_config.passfail_bantime, NULL, 300);
3286 }
3287
3288 static const char* conf_get_passfail_bantime(void)
3289 {
3290 return conf_get_int(prefs_runtime_config.passfail_bantime);
3291 }
3292
3293
3294 extern unsigned int prefs_get_maxusers_per_channel(void)
3295 {
3296 return prefs_runtime_config.maxusers_per_channel;
3297 }
3298
3299 static int conf_set_maxusers_per_channel(const char *valstr)
3300 {
3301 return conf_set_int(&prefs_runtime_config.maxusers_per_channel, valstr, 0);
3302 }
3303
3304 static int conf_setdef_maxusers_per_channel(void)
3305 {
3306 return conf_set_int(&prefs_runtime_config.maxusers_per_channel, NULL, 0);
3307 }
3308
3309 static const char* conf_get_maxusers_per_channel(void)
3310 {
3311 return conf_get_int(prefs_runtime_config.maxusers_per_channel);
3312 }
3313
3314
3315 extern char const * prefs_get_supportfile(void)
3316 {
3317 return prefs_runtime_config.supportfile;
3318 }
3319
3320 static int conf_set_supportfile(const char *valstr)
3321 {
3322 return conf_set_str(&prefs_runtime_config.supportfile, valstr, NULL);
3323 }
3324
3325 static int conf_setdef_supportfile(void)
3326 {
3327 return conf_set_str(&prefs_runtime_config.supportfile, NULL, BNETD_SUPPORT_FILE);
3328 }
3329
3330 static const char* conf_get_supportfile(void)
3331 {
3332 return prefs_runtime_config.supportfile;
3333 }
3334
3335
3336 extern char const * prefs_get_allowed_clients(void)
3337 {
3338 return prefs_runtime_config.allowed_clients;
3339 }
3340
3341 static int conf_set_allowed_clients(const char *valstr)
3342 {
3343 return conf_set_str(&prefs_runtime_config.allowed_clients, valstr, NULL);
3344 }
3345
3346 static int conf_setdef_allowed_clients(void)
3347 {
3348 return conf_set_str(&prefs_runtime_config.allowed_clients, NULL, NULL);
3349 }
3350
3351 static const char* conf_get_allowed_clients(void)
3352 {
3353 return prefs_runtime_config.allowed_clients;
3354 }
3355
3356
3357 extern char const * prefs_get_ladder_games(void)
3358 {
3359 return prefs_runtime_config.ladder_games;
3360 }
3361
3362 static int conf_set_ladder_games(const char *valstr)
3363 {
3364 return conf_set_str(&prefs_runtime_config.ladder_games, valstr, NULL);
3365 }
3366
3367 static int conf_setdef_ladder_games(void)
3368 {
3369 return conf_set_str(&prefs_runtime_config.ladder_games, NULL, NULL);
3370 }
3371
3372 static const char* conf_get_ladder_games(void)
3373 {
3374 return prefs_runtime_config.ladder_games;
3375 }
3376
3377
3378 extern char const * prefs_get_ladder_prefix(void)
3379 {
3380 return prefs_runtime_config.ladder_prefix;
3381 }
3382
3383 static int conf_set_ladder_prefix(const char *valstr)
3384 {
3385 return conf_set_str(&prefs_runtime_config.ladder_prefix, valstr, NULL);
3386 }
3387
3388 static int conf_setdef_ladder_prefix(void)
3389 {
3390 return conf_set_str(&prefs_runtime_config.ladder_prefix, NULL, NULL);
3391 }
3392
3393 static const char* conf_get_ladder_prefix(void)
3394 {
3395 return prefs_runtime_config.ladder_prefix;
3396 }
3397
3398
3399 extern unsigned int prefs_get_max_connections(void)
3400 {
3401 return prefs_runtime_config.max_connections;
3402 }
3403
3404 static int conf_set_max_connections(const char *valstr)
3405 {
3406 return conf_set_int(&prefs_runtime_config.max_connections, valstr, 0);
3407 }
3408
3409 static int conf_setdef_max_connections(void)
3410 {
3411 return conf_set_int(&prefs_runtime_config.max_connections, NULL, BNETD_MAX_SOCKETS);
3412 }
3413
3414 static const char* conf_get_max_connections(void)
3415 {
3416 return conf_get_int(prefs_runtime_config.max_connections);
3417 }
3418
3419
3420 extern unsigned int prefs_get_packet_limit(void)
3421 {
3422 return prefs_runtime_config.packet_limit;
3423 }
3424
3425 static int conf_set_packet_limit(const char *valstr)
3426 {
3427 return conf_set_int(&prefs_runtime_config.packet_limit, valstr, 0);
3428 }
3429
3430 static int conf_setdef_packet_limit(void)
3431 {
3432 return conf_set_int(&prefs_runtime_config.packet_limit, NULL, BNETD_PACKET_LIMIT);
3433 }
3434
3435 static const char* conf_get_packet_limit(void)
3436 {
3437 return conf_get_int(prefs_runtime_config.packet_limit);
3438 }
3439
3440
3441 extern unsigned int prefs_get_sync_on_logoff(void)
3442 {
3443 return prefs_runtime_config.sync_on_logoff;
3444 }
3445
3446 static int conf_set_sync_on_logoff(const char *valstr)
3447 {
3448 return conf_set_bool(&prefs_runtime_config.sync_on_logoff, valstr, 0);
3449 }
3450
3451 static int conf_setdef_sync_on_logoff(void)
3452 {
3453 return conf_set_bool(&prefs_runtime_config.sync_on_logoff, NULL, 0);
3454 }
3455
3456 static const char* conf_get_sync_on_logoff(void)
3457 {
3458 return conf_get_bool(prefs_runtime_config.sync_on_logoff);
3459 }
3460
3461 extern char const * prefs_get_irc_network_name(void)
3462 {
3463 return prefs_runtime_config.irc_network_name;
3464 }
3465
3466 static int conf_set_irc_network_name(const char *valstr)
3467 {
3468 return conf_set_str(&prefs_runtime_config.irc_network_name, valstr, NULL);
3469 }
3470
3471 static int conf_setdef_irc_network_name(void)
3472 {
3473 return conf_set_str(&prefs_runtime_config.irc_network_name, NULL, BNETD_IRC_NETWORK_NAME);
3474 }
3475
3476 static const char* conf_get_irc_network_name(void)
3477 {
3478 return prefs_runtime_config.irc_network_name;
3479 }
3480
3481
3482 extern unsigned int prefs_get_localize_by_country(void)
3483 {
3484 return prefs_runtime_config.localize_by_country;
3485 }
3486
3487 static int conf_set_localize_by_country(const char *valstr)
3488 {
3489 return conf_set_bool(&prefs_runtime_config.localize_by_country, valstr, 0);
3490 }
3491
3492 static int conf_setdef_localize_by_country(void)
3493 {
3494 return conf_set_bool(&prefs_runtime_config.localize_by_country, NULL, 0);
3495 }
3496
3497 static const char* conf_get_localize_by_country(void)
3498 {
3499 return conf_get_bool(prefs_runtime_config.localize_by_country);
3500 }
3501
3502
3503 extern unsigned int prefs_get_log_commands(void)
3504 {
3505 return prefs_runtime_config.log_commands;
3506 }
3507
3508 static int conf_set_log_commands(const char *valstr)
3509 {
3510 return conf_set_bool(&prefs_runtime_config.log_commands, valstr, 0);
3511 }
3512
3513 static int conf_setdef_log_commands(void)
3514 {
3515 return conf_set_bool(&prefs_runtime_config.log_commands, NULL, 1);
3516 }
3517
3518 static const char* conf_get_log_commands(void)
3519 {
3520 return conf_get_bool(prefs_runtime_config.log_commands);
3521 }
3522
3523
3524 extern char const * prefs_get_log_command_groups(void)
3525 {
3526 return prefs_runtime_config.log_command_groups;
3527 }
3528
3529 static int conf_set_log_command_groups(const char *valstr)
3530 {
3531 return conf_set_str(&prefs_runtime_config.log_command_groups, valstr, NULL);
3532 }
3533
3534 static int conf_setdef_log_command_groups(void)
3535 {
3536 return conf_set_str(&prefs_runtime_config.log_command_groups, NULL, BNETD_LOG_COMMAND_GROUPS);
3537 }
3538
3539 static const char* conf_get_log_command_groups(void)
3540 {
3541 return prefs_runtime_config.log_command_groups;
3542 }
3543
3544
3545 extern char const * prefs_get_log_command_list(void)
3546 {
3547 return prefs_runtime_config.log_command_list;
3548 }
3549
3550 static int conf_set_log_command_list(const char *valstr)
3551 {
3552 return conf_set_str(&prefs_runtime_config.log_command_list, valstr, NULL);
3553 }
3554
3555 static int conf_setdef_log_command_list(void)
3556 {
3557 return conf_set_str(&prefs_runtime_config.log_command_list, NULL, BNETD_LOG_COMMAND_LIST);
3558 }
3559
3560 static const char* conf_get_log_command_list(void)
3561 {
3562 return prefs_runtime_config.log_command_list;
3563 }
3564
3565
3566
3567 /**
3568 * Westwood Online Extensions
3569 */
3570 extern char const * prefs_get_apireg_addrs(void)
3571 {
3572 return prefs_runtime_config.apiregaddrs;
3573 }
3574
3575 static int conf_set_apireg_addrs(const char *valstr)
3576 {
3577 return conf_set_str(&prefs_runtime_config.apiregaddrs, valstr, NULL);
3578 }
3579
3580 static int conf_setdef_apireg_addrs(void)
3581 {
3582 return conf_set_str(&prefs_runtime_config.apiregaddrs, NULL, BNETD_APIREG_ADDRS);
3583 }
3584
3585 static const char* conf_get_apireg_addrs(void)
3586 {
3587 return prefs_runtime_config.apiregaddrs;
3588 }
3589
3590 extern char const * prefs_get_wgameres_addrs(void)
3591 {
3592 return prefs_runtime_config.wgameresaddrs;
3593 }
3594
3595 static int conf_set_wgameres_addrs(const char *valstr)
3596 {
3597 return conf_set_str(&prefs_runtime_config.wgameresaddrs, valstr, NULL);
3598 }
3599
3600 static int conf_setdef_wgameres_addrs(void)
3601 {
3602 return conf_set_str(&prefs_runtime_config.wgameresaddrs, NULL, BNETD_WGAMERES_ADDRS);
3603 }
3604
3605 static const char* conf_get_wgameres_addrs(void)
3606 {
3607 return prefs_runtime_config.wgameresaddrs;
3608 }
3609
3610 extern char const * prefs_get_wolv1_addrs(void)
3611 {
3612 return prefs_runtime_config.wolv1addrs;
3613 }
3614
3615 static int conf_set_wolv1_addrs(const char *valstr)
3616 {
3617 return conf_set_str(&prefs_runtime_config.wolv1addrs, valstr, NULL);
3618 }
3619
3620 static int conf_setdef_wolv1_addrs(void)
3621 {
3622 return conf_set_str(&prefs_runtime_config.wolv1addrs, NULL, BNETD_WOLV1_ADDRS);
3623 }
3624
3625 static const char* conf_get_wolv1_addrs(void)
3626 {
3627 return prefs_runtime_config.wolv1addrs;
3628 }
3629
3630 extern char const * prefs_get_wolv2_addrs(void)
3631 {
3632 return prefs_runtime_config.wolv2addrs;
3633 }
3634
3635 static int conf_set_wolv2_addrs(const char *valstr)
3636 {
3637 return conf_set_str(&prefs_runtime_config.wolv2addrs, valstr, NULL);
3638 }
3639
3640 static int conf_setdef_wolv2_addrs(void)
3641 {
3642 return conf_set_str(&prefs_runtime_config.wolv2addrs, NULL, BNETD_WOLV2_ADDRS);
3643 }
3644
3645 static const char* conf_get_wolv2_addrs(void)
3646 {
3647 return prefs_runtime_config.wolv2addrs;
3648 }
3649
3650 static int conf_set_wol_timezone(const char *valstr)
3651 {
3652 return conf_set_str(&prefs_runtime_config.woltimezone, valstr, NULL);
3653 }
3654
3655 extern char const * prefs_get_wol_timezone(void)
3656 {
3657 return prefs_runtime_config.woltimezone;
3658 }
3659
3660 static char const * conf_get_wol_timezone(void)
3661 {
3662 return prefs_runtime_config.woltimezone;
3663 }
3664
3665 static int conf_setdef_wol_timezone(void)
3666 {
3667 return conf_set_str(&prefs_runtime_config.woltimezone, NULL, 0);
3668 }
3669
3670 static int conf_set_wol_longitude(const char *valstr)
3671 {
3672 return conf_set_str(&prefs_runtime_config.wollongitude, valstr, NULL);
3673 }
3674
3675 extern char const * prefs_get_wol_longitude(void)
3676 {
3677 return prefs_runtime_config.wollongitude;
3678 }
3679
3680 static char const * conf_get_wol_longitude(void)
3681 {
3682 return prefs_runtime_config.wollongitude;
3683 }
3684
3685 static int conf_setdef_wol_longitude(void)
3686 {
3687 return conf_set_str(&prefs_runtime_config.wollongitude, NULL, 0);
3688 }
3689
3690 static int conf_set_wol_latitude(const char *valstr)
3691 {
3692 return conf_set_str(&prefs_runtime_config.wollatitude, valstr, NULL);
3693 }
3694
3695 extern char const * prefs_get_wol_latitude(void)
3696 {
3697 return prefs_runtime_config.wollatitude;
3698 }
3699
3700 static char const * conf_get_wol_latitude(void)
3701 {
3702 return prefs_runtime_config.wollatitude;
3703 }
3704
3705 static int conf_setdef_wol_latitude(void)
3706 {
3707 return conf_set_str(&prefs_runtime_config.wollatitude, NULL, 0);
3708 }
3709
3710 static int conf_set_wol_autoupdate_serverhost(const char *valstr)
3711 {
3712 return conf_set_str(&prefs_runtime_config.wol_autoupdate_serverhost, valstr, NULL);
3713 }
3714
3715 extern char const * prefs_get_wol_autoupdate_serverhost(void)
3716 {
3717 return prefs_runtime_config.wol_autoupdate_serverhost;
3718 }
3719
3720 static char const * conf_get_wol_autoupdate_serverhost(void)
3721 {
3722 return prefs_runtime_config.wol_autoupdate_serverhost;
3723 }
3724
3725 static int conf_setdef_wol_autoupdate_serverhost(void)
3726 {
3727 return conf_set_str(&prefs_runtime_config.wol_autoupdate_serverhost, NULL, 0);
3728 }
3729
3730 static int conf_set_wol_autoupdate_username(const char *valstr)
3731 {
3732 return conf_set_str(&prefs_runtime_config.wol_autoupdate_username, valstr, NULL);
3733 }
3734
3735 extern char const * prefs_get_wol_autoupdate_username(void)
3736 {
3737 return prefs_runtime_config.wol_autoupdate_username;
3738 }
3739
3740 static char const * conf_get_wol_autoupdate_username(void)
3741 {
3742 return prefs_runtime_config.wol_autoupdate_username;
3743 }
3744
3745 static int conf_setdef_wol_autoupdate_username(void)
3746 {
3747 return conf_set_str(&prefs_runtime_config.wol_autoupdate_username, NULL, 0);
3748 }
3749
3750 static int conf_set_wol_autoupdate_password(const char *valstr)
3751 {
3752 return conf_set_str(&prefs_runtime_config.wol_autoupdate_password, valstr, NULL);
3753 }
3754
3755 extern char const * prefs_get_wol_autoupdate_password(void)
3756 {
3757 return prefs_runtime_config.wol_autoupdate_password;
3758 }
3759
3760 static char const * conf_get_wol_autoupdate_password(void)
3761 {
3762 return prefs_runtime_config.wol_autoupdate_password;
3763 }
3764
3765 static int conf_setdef_wol_autoupdate_password(void)
3766 {
3767 return conf_set_str(&prefs_runtime_config.wol_autoupdate_password, NULL, 0);
3768 }
3769
3770 }
3771
3772 }