/[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.1.1.1 - (show annotations) (vendor branch)
Tue Jun 6 03:41:38 2006 UTC (19 years, 9 months ago) by sysadm
Branch: GNU
CVS Tags: arelease
Changes since 1.1: +0 -0 lines
Content type: text/x-chdr
Error occurred while calculating annotation data.
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 #define BNETD_COMMAND_GROUPS_FILE "conf/command_groups.conf"
156 #define BNETD_TOURNAMENT_FILE "conf/tournament.conf"
157 #define BNETD_ALIASFILE "conf/bnalias.conf"
158 /* ADDED BY UNDYING SOULZZ 4/9/02 */
159 /* default identify timeout value */
160 #define W3_IDENTTIMEOUT 15 /* seconds */
161 /* Added by Soar */
162 /* time limit for new member as newer(whom cannot be promoted) in clan, (hrs) */
163 #define CLAN_NEWER_TIME 168
164 #define CLAN_MAX_MEMBERS 50
165
166 /* moved from account.h */
167 #define MAX_FRIENDS 20
168
169 /* maximum ammount of bytes sent in a single server.c/sd_tcpoutput call */
170 #define BNETD_MAX_OUTBURST 16384
171
172 /* default files relative to FILE_DIR */
173 #define BNETD_TOS_FILE "tos.txt"
174 #define BNETD_ICON_FILE "icons.bni"
175 #define BNETD_WAR3_ICON_FILE "icons-WAR3.bni"
176 #define BNETD_STAR_ICON_FILE "icons_STAR.bni"
177 #define BNETD_MPQ_FILE "autoupdate"
178
179 /* other default configuration values */
180 #define BNETD_LOG_LEVELS "warn,error"
181 #define BNETD_SERV_ADDRS ":" /* this means "all" */
182 #define BNETD_SERV_PORT 6112
183 #define BNETD_W3ROUTE_ADDR "0.0.0.0"
184 #define BNETD_W3ROUTE_PORT 6200
185 #define BNETD_IRC_ADDRS "" /* this means none */
186 #define BNETD_IRC_PORT 6667 /* used if port not specified */
187 #define BNETD_TRACK_ADDRS "track.pvpgn.org"
188 #define BNETD_TRACK_PORT 6114 /* use this port if not specified */
189 #define BNETD_DEF_TEST_PORT 6112 /* default guess for UDP test port */
190 #define BNETD_MIN_TEST_PORT 6112
191 #define BNETD_MAX_TEST_PORT 6500
192 #define BNETD_USERSYNC 300 /* s */
193 #define BNETD_USERFLUSH 1000
194 #define BNETD_USERSTEP 100 /* check 100 users per call in accountlist_save() */
195 #define BNETD_LATENCY 600 /* s */
196 #define BNETD_IRC_LATENCY 180 /* s */ /* Ping timeout for IRC connections */
197 #define BNETD_DEF_NULLMSG 120 /* s */
198 #define BNETD_TRACK_TIME 0
199 #define BNETD_POLL_INTERVAL 20 /* 20 ms */
200 #define BNETD_JIFFIES 50 /* 50 ms jiffies time quantum */
201 #define BNETD_SHUTDELAY 300 /* s */
202 #define BNETD_SHUTDECR 60 /* s */
203 #define BNETD_DEFAULT_OWNER "PvPGN"
204 #define BNETD_DEFAULT_KEY "3310541526205"
205 #define BNETD_DEFAULT_HOST "localhost"
206 #define BNETD_QUOTA_DOBAE 7 /* lines */
207 #define BNETD_QUOTA_LINES 5 /* lines */
208 #define BNETD_QUOTA_TIME 5 /* s */
209 #define BNETD_QUOTA_WLINE 40 /* chars */
210 #define BNETD_QUOTA_MLINE 200 /* chars */
211 #define BNETD_LADDER_INIT_RAT 1000
212 #define BNETD_MAIL_SUPPORT 0
213 #define BNETD_MAIL_QUOTA 5
214 #define BNETD_LOG_NOTICE "*** Please note this channel is logged! ***"
215 #define BNETD_HASHTABLE_SIZE 61
216 #define BNETD_REALM_PORT 6113 /* where D2CS listens */
217 #define BNETD_TELNET_ADDRS "" /* this means none */
218 #define BNETD_TELNET_PORT 23 /* used if port not specified */
219 #define BNETD_EXEINFO_MATCH "exact"
220 #define PVPGN_VERSION_TIMEDIV 0 /* no timediff check by default */
221 #define PVPGN_CACHE_MEMLIMIT 5000000 /* bytes */
222 #define PVPGN_DEFAULT_SYMB "-_[]"
223
224 /***************************************************************/
225 /* default values for the tracking server */
226
227 #define BNTRACKD_EXPIRE 600
228 #define BNTRACKD_UPDATE 150
229 #define BNTRACKD_GRANULARITY 5
230 #define BNTRACKD_SERVER_PORT 6114
231 #define BNTRACKD_PIDFILE "" /* this means "none" */
232 #define BNTRACKD_OUTFILE "pvpgnlist.txt"
233 #ifdef WIN32
234 #define BNTRACKD_PROCESS "process.pl"
235 #define BNTRACKD_LOGFILE "bntrackd.log"
236 #else
237 #define BNTRACKD_PROCESS "scripts/process.pl"
238 #define BNTRACKD_LOGFILE "logs/bntrackd.log"
239 #endif
240
241 /***************************************************************/
242 /* default values for W3XP anongameinfo packet */
243
244 #define PVPGN_DEFAULT_URL "www.pvpgn.org"
245
246 #define PVPGN_PG_1V1_DESC "Solo Games"
247 #define PVPGN_AT_2V2_DESC "2 player team"
248 #define PVPGN_AT_3V3_DESC "3 player team"
249 #define PVPGN_AT_4V4_DESC "4 player team"
250 #define PVPGN_PG_TEAM_DESC "Team Games"
251 #define PVPGN_PG_FFA_DESC "Free for All Games"
252 #define PVPGN_CLAN_1V1_DESC "Solo Games"
253 #define PVPGN_CLAN_2V2_DESC "2 player team"
254 #define PVPGN_CLAN_3V3_DESC "3 player team"
255 #define PVPGN_CLAN_4V4_DESC "4 player team"
256
257 #define PVPGN_1V1_GT_DESC "One vs. One"
258 #define PVPGN_1V1_GT_LONG "Two players fight to the death"
259
260 #define PVPGN_2V2_GT_DESC "Two vs. Two"
261 #define PVPGN_2V2_GT_LONG "Two teams of two vie for dominance"
262
263 #define PVPGN_3V3_GT_DESC "Three vs. Three"
264 #define PVPGN_3V3_GT_LONG "Two teams of three face off on the battlefield"
265
266 #define PVPGN_4V4_GT_DESC "Four vs. Four"
267 #define PVPGN_4V4_GT_LONG "Two teams of four head to battle"
268
269 #define PVPGN_5V5_GT_DESC "Five vs. Five"
270 #define PVPGN_5V5_GT_LONG "Two teams of five - who will prevail?"
271
272 #define PVPGN_6V6_GT_DESC "Six vs. Six"
273 #define PVPGN_6V6_GT_LONG "Two teams of six - get ready to rumble!"
274
275 #define PVPGN_SFFA_GT_DESC "Small Free for All"
276 #define PVPGN_SFFA_GT_LONG "Can you defeat 3-5 opponents alone?"
277
278 #define PVPGN_TFFA_GT_DESC "Team Free for All"
279 #define PVPGN_TFFA_GT_LONG "Can your team defeat 1-2 others?"
280
281 #define PVPGN_2V2V2_GT_DESC "Two vs. Two vs. Two"
282 #define PVPGN_2V2V2_GT_LONG "Three teams of two, can you handle it?"
283
284 #define PVPGN_3V3V3_GT_DESC "Three vs. Three vs. Three"
285 #define PVPGN_3V3V3_GT_LONG "Three teams of three battle each other "
286
287 #define PVPGN_4V4V4_GT_DESC "Four vs. Four vs. Four"
288 #define PVPGN_4V4V4_GT_LONG "Three teams of four - things getting crowded?"
289
290 #define PVPGN_2V2V2V2_GT_DESC "Two vs. Two vs. Two vs. Two"
291 #define PVPGN_2V2V2V2_GT_LONG "Four teams of two, is this a challenge?"
292
293 #define PVPGN_3V3V3V3_GT_DESC "Three vs. Three vs. Three vs. Three"
294 #define PVPGN_3V3V3V3_GT_LONG "Four teams of three, the ultimate challenge!"
295
296 #define PVPGN_AINFO_FILE "conf/anongame_infos.conf"
297
298 /* max number of players in an anongame match [Omega] */
299 #define ANONGAME_MAX_GAMECOUNT 12
300
301 /* max level of players*/
302 #define ANONGAME_MAX_LEVEL 100
303
304 /***************************************************************/
305 /* platform dependent features */
306
307 /* conditionally enabled features */
308
309 #if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGADDSET)
310 # define DO_POSIXSIG
311 #endif
312
313 #if defined(HAVE_FORK) && defined(HAVE_PIPE)
314 # define DO_SUBPROC
315 #endif
316
317 #if defined(HAVE_FORK) && defined(HAVE_CHDIR) && (defined(HAVE_SETPGID) || defined(HAVE_SETPGRP))
318 # define DO_DAEMONIZE
319 #endif
320
321
322 /* GCC attributes */
323
324 /* enable format mismatch warnings from gcc */
325 #if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
326 # if __GNUC__ == 2 && __GNUC_MINOR__ < 7
327 /* namespace clean versions were available starting in 2.6.4 */
328 # define __format__ format
329 # define __printf__ printf
330 # endif
331 # define PRINTF_ATTR(FMTARG,VARG) __attribute__((__format__(printf,FMTARG,VARG)))
332 #else
333 # define PRINTF_ATTR(FMTARG,VARG)
334 #endif
335
336 /* type attributes */
337
338 /* set GCC machine storage mode */
339 #if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
340 # define MODE_ATTR(M) __attribute__((__mode__(M)))
341 # define HAVE_MODE_ATTR
342 #else
343 # define MODE_ATTR(M)
344 #endif
345
346 /* avoid using padding on GCC, for other compilers you need alternate solutions */
347 #if defined(__GNUC__)
348 # define PACKED_ATTR() __attribute__((__packed__))
349 #else
350 # define PACKED_ATTR()
351 #endif
352
353 /* default maxim number of sockets in the fdwatch pool */
354 #define BNETD_MAX_SOCKETS 1000
355
356 /* Used for FDSETSIZE redefine (only on WIN32 so so far) */
357 #define BNETD_MAX_SOCKVAL 8192
358
359 /*
360 * select() hackery... works most places, need to add autoconf checks
361 * because some systems may redefine FD_SETSIZE, have it as a variable,
362 * or not have the concept of such a value.
363 * dizzy: this is a total hack. only WIN32 so far specifies this as beeing
364 * "legal"; in UNIX in general it should be NOT because the kernel interface
365 * of select will never notice your userland changes to the fd_sets
366 */
367 /* Win32 defaults to 64, BSD and Linux default to 1024 */
368 /* FIXME: how big can this be before things break? */
369 #ifdef WIN32
370 # define FD_SETSIZE BNETD_MAX_SOCKVAL
371 #endif
372
373 #ifdef HAVE_EPOLL_CREATE
374 # define HAVE_EPOLL 1
375 #endif
376
377 #if defined(WITH_SQL_MYSQL) || defined(WITH_SQL_PGSQL)
378 #define WITH_SQL 1
379 #endif
380
381 #endif

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