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