/[LeafOK_CVS]/pvpgn-1.7.4/src/common/setup_before.h
ViewVC logotype

Contents of /pvpgn-1.7.4/src/common/setup_before.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Jun 24 09:20:12 2006 UTC (19 years, 8 months ago) by sysadm
Branch: MAIN
CVS Tags: pvpgn_1-7-4-0_MIL, HEAD
Changes since 1.1: +4 -0 lines
Content type: text/x-chdr
no message

1 /*
2 * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
3 * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19 #ifdef INCLUDED_SETUP_AFTER_H
20 # error "This file must be included before all other header files"
21 #endif
22 #ifndef INCLUDED_SETUP_BEFORE_H
23 #define INCLUDED_SETUP_BEFORE_H
24
25 /* get autoconf defines */
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #ifdef WIN32
31 # include "win32/configwin.h"
32 #endif
33
34 /* This file contains compile-time configuration parameters including
35 * debugging options, default configuration values, and format strings.
36 */
37
38 #include "version.h"
39
40 /***************************************************************/
41 /* Debugging options */
42
43 /* print bad calling locations of account functions */
44 #define DEBUG_ACCOUNT
45
46 /* make bnchat, etc. print debug messages */
47 #define CLIENTDEBUG
48
49 /* make the routines call xxx_check() and notice
50 xxx_purge() calls during list traversal */
51 #undef LIST_DEBUG
52 #undef HASHTABLE_DEBUG
53
54 /* this will use GCC evensions to verify that all module arguments to
55 eventlog() are correct. */
56 #undef DEBUGMODSTRINGS
57 /*
58 After you compile, use this script:
59 strings bnetd |
60 egrep '@\([^@]*@@[a-z_]*\)@' |
61 sed -e 's/@(\([^:]*\):\([a-z_]*\)@@\([a-z_]*\))@/\1 \2 \3/g' |
62 awk '{ if ( $2 != $3 ) printf("%s: %s->%s\n",$1,$2,$3); }'
63 */
64
65 /* this will test get/unget memory management in account.c */
66 #undef TESTUNGET
67
68 /* check ladders for impossible combinations when returning them */
69 #define LADDER_DEBUG
70
71 /***************************************************************/
72 /* compile-time options */
73
74 /* how long do we wait for the UDP test reply? */
75 #define CLIENT_MAX_UDPTEST_WAIT 5
76
77 /* length of listen socket queue */
78 /* #define LISTEN_QUEUE SOMAXCONN */
79 #define LISTEN_QUEUE 10
80
81 /* the format for account numbers */
82 #define UID_FORMAT "#%08u"
83 #define UID_MAXLEN 8
84
85 /* the format for game ids */
86 #define GAMEID_FORMAT "#%06u"
87 #define GAMEID_MAXLEN 8
88
89 /* the format of timestamps in the logfile */
90 #define EVENT_TIME_FORMAT "%b %d %H:%M:%S"
91 #define EVENT_TIME_MAXLEN 32
92
93 /* the format of the stat times in bnstat */
94 #define STAT_TIME_FORMAT "%Y %b %d %H:%M:%S"
95 #define STAT_TIME_MAXLEN 32
96
97 /* the format of the file modification time in bnftp */
98 #define FILE_TIME_FORMAT "%Y %b %d %H:%M:%S"
99 #define FILE_TIME_MAXLEN 32
100
101 /* the format of the dates in the game report and for /gameinfo */
102 #define GAME_TIME_FORMAT "%a %b %d %H:%M:%S %Z"
103 #define GAME_TIME_MAXLEN 32
104
105 /* the format of the timestamps for the start/end of channel log files */
106 #define CHANLOG_TIME_FORMAT "%Y %b %d %H:%M:%S %Z"
107 #define CHANLOG_TIME_MAXLEN 32
108
109 /* the format of the timestamps for lines in the channel log files */
110 #define CHANLOGLINE_TIME_FORMAT "%b %d %H:%M:%S"
111 #define CHANLOGLINE_TIME_MAXLEN 32
112
113 /* adjustable constants */
114 #define BNETD_LADDER_DEFAULT_TIME "19764578 0" /* 0:00 1 Jan 1970 GMT */
115
116 /* for clients if ioctl(TIOCGWINSZ) fails and $LINES and $COLUMNS aren't set */
117 #define DEF_SCREEN_WIDTH 80
118 #define DEF_SCREEN_HEIGHT 24
119
120 /***************************************************************/
121 /* default values for bnetd.conf */
122
123 /* default Boolean setup values */
124 #define BNETD_CHANLOG 0
125
126 /* default path configuration values */
127 #ifndef BNETD_DEFAULT_CONF_FILE
128 # define BNETD_DEFAULT_CONF_FILE "conf/bnetd.conf"
129 #endif
130 #define BNETD_FILE_DIR "files"
131 #define BNETD_STORAGE_PATH ""
132 #define BNETD_REPORT_DIR "reports"
133 #define BNETD_LOG_FILE "logs/bnetd.log"
134 #define BNETD_MOTD_FILE "conf/bnmotd.txt"
135 #define BNETD_NEWS_DIR "news"
136 #define BNETD_AD_FILE "conf/ad.conf"
137 #define BNETD_CHANNEL_FILE "conf/channel.conf"
138 #define BNETD_PID_FILE "" /* this means "none" */
139 #define BNETD_ACCOUNT_TMP ".bnetd_acct_temp"
140 #define BNETD_IPBAN_FILE "conf/bnban.conf"
141 #define BNETD_HELP_FILE "conf/bnhelp.conf"
142 #define BNETD_FORTUNECMD "/usr/games/fortune"
143 #define BNETD_TRANS_FILE "conf/address_translation.conf"
144 #define BNETD_CHANLOG_DIR "chanlogs"
145 #define BNETD_REALM_FILE "conf/realm.conf"
146 #define BNETD_ISSUE_FILE "conf/bnissue.txt"
147 #define BNETD_MAIL_DIR "var/bnmail"
148 #define PVPGN_VERSIONCHECK "conf/versioncheck.conf"
149 #define BNETD_LADDER_DIR "var/ladders"
150 #define BNETD_STATUS_DIR "var/status"
151 #define BNETD_TOPIC_FILE "var/topics"
152 #define BNETD_DBLAYOUT_FILE "conf/sql_DB_layout.conf"
153 #define BNETD_SUPPORT_FILE "conf/supportfile.conf"
154
155 #ifndef BNETD_VERIFY_DIR
156 #define BNETD_VERIFY_DIR "var/verify"
157 #endif
158
159 #define BNETD_COMMAND_GROUPS_FILE "conf/command_groups.conf"
160 #define BNETD_TOURNAMENT_FILE "conf/tournament.conf"
161 #define BNETD_ALIASFILE "conf/bnalias.conf"
162 /* ADDED BY UNDYING SOULZZ 4/9/02 */
163 /* default identify timeout value */
164 #define W3_IDENTTIMEOUT 15 /* seconds */
165 /* Added by Soar */
166 /* time limit for new member as newer(whom cannot be promoted) in clan, (hrs) */
167 #define CLAN_NEWER_TIME 168
168 #define CLAN_MAX_MEMBERS 50
169
170 /* moved from account.h */
171 #define MAX_FRIENDS 20
172
173 /* maximum ammount of bytes sent in a single server.c/sd_tcpoutput call */
174 #define BNETD_MAX_OUTBURST 16384
175
176 /* default files relative to FILE_DIR */
177 #define BNETD_TOS_FILE "tos.txt"
178 #define BNETD_ICON_FILE "icons.bni"
179 #define BNETD_WAR3_ICON_FILE "icons-WAR3.bni"
180 #define BNETD_STAR_ICON_FILE "icons_STAR.bni"
181 #define BNETD_MPQ_FILE "autoupdate"
182
183 /* other default configuration values */
184 #define BNETD_LOG_LEVELS "warn,error"
185 #define BNETD_SERV_ADDRS ":" /* this means "all" */
186 #define BNETD_SERV_PORT 6112
187 #define BNETD_W3ROUTE_ADDR "0.0.0.0"
188 #define BNETD_W3ROUTE_PORT 6200
189 #define BNETD_IRC_ADDRS "" /* this means none */
190 #define BNETD_IRC_PORT 6667 /* used if port not specified */
191 #define BNETD_TRACK_ADDRS "track.pvpgn.org"
192 #define BNETD_TRACK_PORT 6114 /* use this port if not specified */
193 #define BNETD_DEF_TEST_PORT 6112 /* default guess for UDP test port */
194 #define BNETD_MIN_TEST_PORT 6112
195 #define BNETD_MAX_TEST_PORT 6500
196 #define BNETD_USERSYNC 300 /* s */
197 #define BNETD_USERFLUSH 1000
198 #define BNETD_USERSTEP 100 /* check 100 users per call in accountlist_save() */
199 #define BNETD_LATENCY 600 /* s */
200 #define BNETD_IRC_LATENCY 180 /* s */ /* Ping timeout for IRC connections */
201 #define BNETD_DEF_NULLMSG 120 /* s */
202 #define BNETD_TRACK_TIME 0
203 #define BNETD_POLL_INTERVAL 20 /* 20 ms */
204 #define BNETD_JIFFIES 50 /* 50 ms jiffies time quantum */
205 #define BNETD_SHUTDELAY 300 /* s */
206 #define BNETD_SHUTDECR 60 /* s */
207 #define BNETD_DEFAULT_OWNER "PvPGN"
208 #define BNETD_DEFAULT_KEY "3310541526205"
209 #define BNETD_DEFAULT_HOST "localhost"
210 #define BNETD_QUOTA_DOBAE 7 /* lines */
211 #define BNETD_QUOTA_LINES 5 /* lines */
212 #define BNETD_QUOTA_TIME 5 /* s */
213 #define BNETD_QUOTA_WLINE 40 /* chars */
214 #define BNETD_QUOTA_MLINE 200 /* chars */
215 #define BNETD_LADDER_INIT_RAT 1000
216 #define BNETD_MAIL_SUPPORT 0
217 #define BNETD_MAIL_QUOTA 5
218 #define BNETD_LOG_NOTICE "*** Please note this channel is logged! ***"
219 #define BNETD_HASHTABLE_SIZE 61
220 #define BNETD_REALM_PORT 6113 /* where D2CS listens */
221 #define BNETD_TELNET_ADDRS "" /* this means none */
222 #define BNETD_TELNET_PORT 23 /* used if port not specified */
223 #define BNETD_EXEINFO_MATCH "exact"
224 #define PVPGN_VERSION_TIMEDIV 0 /* no timediff check by default */
225 #define PVPGN_CACHE_MEMLIMIT 5000000 /* bytes */
226 #define PVPGN_DEFAULT_SYMB "-_[]"
227
228 /***************************************************************/
229 /* default values for the tracking server */
230
231 #define BNTRACKD_EXPIRE 600
232 #define BNTRACKD_UPDATE 150
233 #define BNTRACKD_GRANULARITY 5
234 #define BNTRACKD_SERVER_PORT 6114
235 #define BNTRACKD_PIDFILE "" /* this means "none" */
236 #define BNTRACKD_OUTFILE "pvpgnlist.txt"
237 #ifdef WIN32
238 #define BNTRACKD_PROCESS "process.pl"
239 #define BNTRACKD_LOGFILE "bntrackd.log"
240 #else
241 #define BNTRACKD_PROCESS "scripts/process.pl"
242 #define BNTRACKD_LOGFILE "logs/bntrackd.log"
243 #endif
244
245 /***************************************************************/
246 /* default values for W3XP anongameinfo packet */
247
248 #define PVPGN_DEFAULT_URL "www.pvpgn.org"
249
250 #define PVPGN_PG_1V1_DESC "Solo Games"
251 #define PVPGN_AT_2V2_DESC "2 player team"
252 #define PVPGN_AT_3V3_DESC "3 player team"
253 #define PVPGN_AT_4V4_DESC "4 player team"
254 #define PVPGN_PG_TEAM_DESC "Team Games"
255 #define PVPGN_PG_FFA_DESC "Free for All Games"
256 #define PVPGN_CLAN_1V1_DESC "Solo Games"
257 #define PVPGN_CLAN_2V2_DESC "2 player team"
258 #define PVPGN_CLAN_3V3_DESC "3 player team"
259 #define PVPGN_CLAN_4V4_DESC "4 player team"
260
261 #define PVPGN_1V1_GT_DESC "One vs. One"
262 #define PVPGN_1V1_GT_LONG "Two players fight to the death"
263
264 #define PVPGN_2V2_GT_DESC "Two vs. Two"
265 #define PVPGN_2V2_GT_LONG "Two teams of two vie for dominance"
266
267 #define PVPGN_3V3_GT_DESC "Three vs. Three"
268 #define PVPGN_3V3_GT_LONG "Two teams of three face off on the battlefield"
269
270 #define PVPGN_4V4_GT_DESC "Four vs. Four"
271 #define PVPGN_4V4_GT_LONG "Two teams of four head to battle"
272
273 #define PVPGN_5V5_GT_DESC "Five vs. Five"
274 #define PVPGN_5V5_GT_LONG "Two teams of five - who will prevail?"
275
276 #define PVPGN_6V6_GT_DESC "Six vs. Six"
277 #define PVPGN_6V6_GT_LONG "Two teams of six - get ready to rumble!"
278
279 #define PVPGN_SFFA_GT_DESC "Small Free for All"
280 #define PVPGN_SFFA_GT_LONG "Can you defeat 3-5 opponents alone?"
281
282 #define PVPGN_TFFA_GT_DESC "Team Free for All"
283 #define PVPGN_TFFA_GT_LONG "Can your team defeat 1-2 others?"
284
285 #define PVPGN_2V2V2_GT_DESC "Two vs. Two vs. Two"
286 #define PVPGN_2V2V2_GT_LONG "Three teams of two, can you handle it?"
287
288 #define PVPGN_3V3V3_GT_DESC "Three vs. Three vs. Three"
289 #define PVPGN_3V3V3_GT_LONG "Three teams of three battle each other "
290
291 #define PVPGN_4V4V4_GT_DESC "Four vs. Four vs. Four"
292 #define PVPGN_4V4V4_GT_LONG "Three teams of four - things getting crowded?"
293
294 #define PVPGN_2V2V2V2_GT_DESC "Two vs. Two vs. Two vs. Two"
295 #define PVPGN_2V2V2V2_GT_LONG "Four teams of two, is this a challenge?"
296
297 #define PVPGN_3V3V3V3_GT_DESC "Three vs. Three vs. Three vs. Three"
298 #define PVPGN_3V3V3V3_GT_LONG "Four teams of three, the ultimate challenge!"
299
300 #define PVPGN_AINFO_FILE "conf/anongame_infos.conf"
301
302 /* max number of players in an anongame match [Omega] */
303 #define ANONGAME_MAX_GAMECOUNT 12
304
305 /* max level of players*/
306 #define ANONGAME_MAX_LEVEL 100
307
308 /***************************************************************/
309 /* platform dependent features */
310
311 /* conditionally enabled features */
312
313 #if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGADDSET)
314 # define DO_POSIXSIG
315 #endif
316
317 #if defined(HAVE_FORK) && defined(HAVE_PIPE)
318 # define DO_SUBPROC
319 #endif
320
321 #if defined(HAVE_FORK) && defined(HAVE_CHDIR) && (defined(HAVE_SETPGID) || defined(HAVE_SETPGRP))
322 # define DO_DAEMONIZE
323 #endif
324
325
326 /* GCC attributes */
327
328 /* enable format mismatch warnings from gcc */
329 #if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
330 # if __GNUC__ == 2 && __GNUC_MINOR__ < 7
331 /* namespace clean versions were available starting in 2.6.4 */
332 # define __format__ format
333 # define __printf__ printf
334 # endif
335 # define PRINTF_ATTR(FMTARG,VARG) __attribute__((__format__(printf,FMTARG,VARG)))
336 #else
337 # define PRINTF_ATTR(FMTARG,VARG)
338 #endif
339
340 /* type attributes */
341
342 /* set GCC machine storage mode */
343 #if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
344 # define MODE_ATTR(M) __attribute__((__mode__(M)))
345 # define HAVE_MODE_ATTR
346 #else
347 # define MODE_ATTR(M)
348 #endif
349
350 /* avoid using padding on GCC, for other compilers you need alternate solutions */
351 #if defined(__GNUC__)
352 # define PACKED_ATTR() __attribute__((__packed__))
353 #else
354 # define PACKED_ATTR()
355 #endif
356
357 /* default maxim number of sockets in the fdwatch pool */
358 #define BNETD_MAX_SOCKETS 1000
359
360 /* Used for FDSETSIZE redefine (only on WIN32 so so far) */
361 #define BNETD_MAX_SOCKVAL 8192
362
363 /*
364 * select() hackery... works most places, need to add autoconf checks
365 * because some systems may redefine FD_SETSIZE, have it as a variable,
366 * or not have the concept of such a value.
367 * dizzy: this is a total hack. only WIN32 so far specifies this as beeing
368 * "legal"; in UNIX in general it should be NOT because the kernel interface
369 * of select will never notice your userland changes to the fd_sets
370 */
371 /* Win32 defaults to 64, BSD and Linux default to 1024 */
372 /* FIXME: how big can this be before things break? */
373 #ifdef WIN32
374 # define FD_SETSIZE BNETD_MAX_SOCKVAL
375 #endif
376
377 #ifdef HAVE_EPOLL_CREATE
378 # define HAVE_EPOLL 1
379 #endif
380
381 #if defined(WITH_SQL_MYSQL) || defined(WITH_SQL_PGSQL)
382 #define WITH_SQL 1
383 #endif
384
385 #endif

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1