]> jfr.im git - irc/gameservirc.git/blob - gameserv/extern.h
Updated the Config script to reflect true version requirments
[irc/gameservirc.git] / gameserv / extern.h
1 #ifndef EXTERN_H
2 #define EXTERN_H
3
4 #define E extern
5
6 #define LEVELS 12 // Levels in the game
7 #define REALLEVELS 12 // Levels to load from monsters.dat
8 #define MONSTERS 12 // Monsters per level
9
10 #include <stdarg.h>
11 #include "player.h"
12 #include "list.h"
13 #include "config.h"
14 #include "options.h"
15
16 #if TIME_WITH_SYS_TIME
17 # include <sys/time.h>
18 # include <time.h>
19 #else
20 # if HAVE_SYS_TIME_H
21 # include <sys/time.h>
22 # else
23 # include <time.h>
24 # endif
25 #endif
26
27 // Hash.cpp stuff start
28 #define U_TABLE_SIZE 1999
29 E unsigned long sHASH(const unsigned char *name);
30 E unsigned long iHASH(const unsigned char *name);
31 // hash.cpp stuff end
32
33
34 E int day;
35 E void save_day();
36 E void load_day();
37
38 // The socket
39 E int sock;
40
41
42 /* config.cpp start */
43 E int load_config_file(char *config = "gameserv.conf");
44 E void unload_config_file();
45 E char *s_GameServ;
46 E char *c_Forest;
47 E char *c_ForestTopic;
48 E char *gshost;
49 E char *gsident;
50 E char *pidfile;
51
52 #if defined(P10)
53 E char *gsnum;
54 #endif
55
56 E char *servername;
57 E char *remoteserver;
58 E char *remoteport;
59 E char *remotepass;
60 E char *playerdata;
61 E char *logfile;
62 E char *monsterdata;
63 E char *adminpass;
64 E char *VERSION;
65 E char *PACKAGE;
66 E char *welcomemsg;
67 E char *ignoreserverslist;
68
69 E long configflags;
70 E bool shuttingdown;
71 E int welcomedelay;
72 E int updateperiod;
73 E int forestfights;
74 E int maxafightdistance;
75 E int maxbfightdistance;
76 E int maxidletime;
77 E int idlecheckperiod;
78
79 /* config.cpp end */
80
81 E List<aClient> players[U_TABLE_SIZE];
82 E List<aClient> clients[U_TABLE_SIZE];
83 E Monster boss;
84
85 /** tcpclient.cpp **/
86 E void check_idles();
87
88 /** List search functions **/
89 E aClient *find(char *nick);
90 E aClient *find(const char *nick);
91 E aClient *findbynick(char *nick);
92 E aClient *findbynick(const char *nick);
93 E aClient *findbyrealnick(char *realnick);
94 E aClient *findplayer(const char *name);
95 E aClient *findIRCplayer(const char *nick);
96 #ifdef P10
97 E aClient *findbyrealnick(char *realnick);
98 #endif
99
100 /** tcpclient.cpp **/
101
102 /** Sock writing functions **/
103 E void notice(const char *source, const char *dest, const char *fmt, ...);
104 E void raw(const char *fmt, ...);
105
106 /** gameserv.cpp **/
107 E void gameserv(char *source, char *buf);
108 E Monster *monsters[LEVELS][MONSTERS];
109
110 /** forest.cpp **/
111 E void forest(char *source, char *buf);
112
113 /** functions.cpp **/
114
115 E bool is_playing(char *u);
116 E bool is_playing(aClient *user);
117
118 E bool is_fighting(char *u);
119 E bool is_fighting(aClient *user);
120
121 E bool player_fight(char *u);
122 E bool player_fight(aClient *user);
123
124 E bool master_fight(char *u);
125 E bool master_fight(aClient *user);
126
127 #ifndef HAVE_STRTOK
128 E char *strtok(char *str, const char *delim);
129 #endif
130
131 E char *spaces(int len, char *seperator);
132 E void display_monster(char *u);
133 E void display_players(char *u);
134 E int stricmp(const char *s1, const char *s2);
135 E int strnicmp(const char *s1, const char *s2, size_t len);
136 E long int chartoint(char ch);
137 E int isstringnum(char *num);
138 E long int pow (int x, int y);
139 E long int stringtoint(char *number);
140 E void init_masters();
141 E void init_monsters();
142 E bool load_monsters();
143 E void delete_monsters();
144 E void delete_masters();
145 E Monster *getNewMonster(Monster *m);
146 E void deleteMonster(Monster *m);
147 E void refresh(Player *p);
148 E void refreshall();
149 E void updateTS(Player *p);
150 E bool timedOut(Player *p);
151 E void timeOutEvent(Player *p);
152 E void reset(Player *p);
153 E void resetall();
154
155 E void do_attack(char *u);
156 E void do_bank(char *u);
157 E void do_fight(char *u);
158 E void do_forest(char *u);
159 E void do_heal(char *u);
160 E void do_identify(char *u);
161 E void do_invenory(char *u);
162 E void do_list(char *u);
163 E void do_logout(char *u);
164 E void do_play(char *u);
165 E void do_quitg(char *u);
166 E void do_refresh(char *u);
167 E void do_register(char *u);
168 E void do_reset(char *u);
169 E void do_run(char *u);
170 E void do_stats(char *u);
171 E void do_store(char *u);
172 E void do_tavern(char *u);
173 E void do_use(char *u);
174 E void see_mystic(char *u);
175
176 E void logout(aClient *user); // log a user off the game
177 E void showstats(const char *u, const char *nick);
178 E void showinventory(aClient *from, aClient *to = NULL);
179 /* Database saving stuff */
180
181 E int save_gs_dbase();
182 E int load_gs_dbase();
183
184 // Log File Stuff
185 E void log(const char *fmt, ...);
186
187 #endif