]> jfr.im git - irc/gameservirc.git/blame_incremental - gameserv/extern.h
Added everything necessary to save overtop of the old dragon when someone beats the...
[irc/gameservirc.git] / gameserv / extern.h
... / ...
CommitLineData
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#define WNA 16 // Weapons and armor
10
11#include <stdarg.h>
12#include "player.h"
13#include "level.h"
14#include "list.h"
15#include "config.h"
16#include "options.h"
17
18#if TIME_WITH_SYS_TIME
19# include <sys/time.h>
20# include <time.h>
21#else
22# if HAVE_SYS_TIME_H
23# include <sys/time.h>
24# else
25# include <time.h>
26# endif
27#endif
28
29// Hash.cpp stuff start
30#define U_TABLE_SIZE 1999
31E unsigned long sHASH(const unsigned char *name);
32E unsigned long iHASH(const unsigned char *name);
33// hash.cpp stuff end
34
35E long lastrefresh;
36E void save_lastrefresh();
37E void load_lastrefresh();
38
39// The socket
40E int sock;
41
42
43/* config.cpp start */
44E int load_config_file(char *config = "gameserv.conf");
45E void unload_config_file();
46E char *s_GameServ;
47E char *c_Forest;
48E char *c_ForestTopic;
49E char *gshost;
50E char *gsident;
51E char *pidfile;
52E char *newsdata;
53E char *nsname;
54E char *nspass;
55E Monster dragon;
56
57#if defined(P10)
58E char *gsnum;
59#endif
60
61E char *servername;
62E char *remoteserver;
63E char *remoteport;
64E char *remotepass;
65E char *playerdata;
66E char *dragondata;
67E char *masterdata;
68E char *logfile;
69E char *adminpass;
70E char *VERSION;
71E char *PACKAGE;
72E char *welcomemsg;
73E char *ignoreserverslist;
74
75E long configflags;
76E long refreshperiod;
77E int level1expire;
78E int defaultexpire;
79E bool shuttingdown;
80E int welcomedelay;
81E int updateperiod;
82E int forestfights;
83E int maxafightdistance;
84E int maxbfightdistance;
85E int maxidletime;
86E int idlecheckperiod;
87
88/* config.cpp end */
89
90E List<aClient> players[U_TABLE_SIZE];
91E List<aClient> clients[U_TABLE_SIZE];
92E List<string> todaysnews;
93
94/** tcpclient.cpp **/
95E void check_idles();
96
97/** List search functions **/
98E aClient *find(char *nick);
99E aClient *find(const char *nick);
100E aClient *findbynick(char *nick);
101E aClient *findbynick(const char *nick);
102E aClient *findbyrealnick(char *realnick);
103E aClient *findplayer(const char *name);
104E aClient *findIRCplayer(const char *nick);
105#ifdef P10
106E aClient *findbyrealnick(char *realnick);
107#endif
108
109/** tcpclient.cpp **/
110
111/** Sock writing functions **/
112E void notice(const char *source, const char *dest, const char *fmt, ...);
113E void raw(const char *fmt, ...);
114
115/** news.cpp **/
116E void addNews(List<string> &news, const char *fmt, ...);
117E void do_news(char *u);
118E void clearNews(List<string> &news);
119E void loadNews(char *filename, List<string> &news);
120E void saveNews(char *filename, List<string> &news);
121E void showNews(char *nick, List<string> &news);
122
123/** gameserv.cpp **/
124E char *weapons[WNA];
125E char *armors[WNA];
126E int prices[WNA - 1];
127E int hpbonus[LEVELS - 1];
128E int strbonus[LEVELS - 1];
129E int defbonus[LEVELS - 1];
130E int webonus[WNA];
131E int arbonus[WNA];
132E void gameserv(char *source, char *buf);
133E Level levels[LEVELS];
134
135/** forest.cpp **/
136E void forest(char *source, char *buf);
137
138/** functions.cpp **/
139
140E bool is_playing(char *u);
141E bool is_playing(aClient *user);
142
143E bool is_fighting(char *u);
144E bool is_fighting(aClient *user);
145
146E bool player_fight(char *u);
147E bool player_fight(aClient *user);
148
149E bool dragon_fight(aClient *user);
150
151E bool master_fight(char *u);
152E bool master_fight(aClient *user);
153
154#ifndef HAVE_STRTOK
155E char *strtok(char *str, const char *delim);
156#endif
157
158E char *spaces(int len, char *seperator);
159E void display_monster(char *u);
160E void display_players(char *u);
161E void display_players(aClient *user);
162E int stricmp(const char *s1, const char *s2);
163E int strnicmp(const char *s1, const char *s2, size_t len);
164E long int chartoint(char ch);
165E int isstringnum(char *num);
166E long int pow (int x, int y);
167E long int stringtoint(char *number);
168E bool load_masters();
169E bool load_monsters();
170E bool load_levels();
171E void delete_monsters();
172E void delete_masters();
173E Monster *getNewMonster(Monster *m);
174E void deleteMonster(Monster *m);
175E void refresh(Player *p);
176E void refreshall();
177E void updateTS(Player *p);
178E bool timedOut(Player *p);
179E void timeOutEvent(Player *p);
180E void reset(Player *p);
181E void resetall();
182
183E void do_attack(char *u);
184E void do_bank(char *u);
185E void do_check(char *u);
186E void do_fight(char *u);
187E void do_forest(char *u);
188E void do_heal(char *u);
189E void do_identify(char *u);
190E void do_invenory(char *u);
191E void do_list(char *u);
192E void do_logout(char *u);
193E void do_play(char *u);
194E void do_quitg(char *u);
195E void do_refresh(char *u);
196E void do_register(char *u);
197E void do_reset(char *u);
198E void do_run(char *u);
199E void do_set(char *u);
200E void do_stats(char *u);
201E void do_store(char *u);
202E void do_tavern(char *u);
203E void do_use(char *u);
204E void see_mystic(char *u);
205
206E void logout(aClient *user); // log a user off the game
207E void showstats(const char *u, const char *nick);
208E void showinventory(aClient *from, aClient *to = NULL);
209/* Database saving stuff */
210
211E int save_gs_dbase();
212E int load_gs_dbase();
213E int load_dragon();
214E int save_dragon();
215
216// Log File Stuff
217E void log(const char *fmt, ...);
218
219#endif