]> jfr.im git - irc/gameservirc.git/blame_incremental - gameserv/extern.h
I've begun to add daily news and split up gameserv.cpp a bit
[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 "list.h"
13#include "config.h"
14#include "myString.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
34
35E int day;
36E void save_day();
37E void load_day();
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;
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 *monsterdata;
64E char *adminpass;
65E char *VERSION;
66E char *PACKAGE;
67E char *welcomemsg;
68E char *ignoreserverslist;
69
70E long configflags;
71E bool shuttingdown;
72E int welcomedelay;
73E int updateperiod;
74E int forestfights;
75E int maxafightdistance;
76E int maxbfightdistance;
77E int maxidletime;
78E int idlecheckperiod;
79
80/* config.cpp end */
81
82E List<aClient> players[U_TABLE_SIZE];
83E List<aClient> clients[U_TABLE_SIZE];
84E List<myString> todaysnews;
85E Monster boss;
86
87/** tcpclient.cpp **/
88E void check_idles();
89
90/** List search functions **/
91E aClient *find(char *nick);
92E aClient *find(const char *nick);
93E aClient *findbynick(char *nick);
94E aClient *findbynick(const char *nick);
95E aClient *findbyrealnick(char *realnick);
96E aClient *findplayer(const char *name);
97E aClient *findIRCplayer(const char *nick);
98#ifdef P10
99E aClient *findbyrealnick(char *realnick);
100#endif
101
102/** tcpclient.cpp **/
103
104/** Sock writing functions **/
105E void notice(const char *source, const char *dest, const char *fmt, ...);
106E void raw(const char *fmt, ...);
107
108/** news.cpp **/
109E void addNews(List<myString> &news, const char *fmt, ...);
110E void showNews(char *nick, List<myString> &news);
111
112/** gameserv.cpp **/
113E void gameserv(char *source, char *buf);
114E Monster *monsters[LEVELS][MONSTERS];
115
116/** forest.cpp **/
117E void forest(char *source, char *buf);
118
119/** functions.cpp **/
120
121E bool is_playing(char *u);
122E bool is_playing(aClient *user);
123
124E bool is_fighting(char *u);
125E bool is_fighting(aClient *user);
126
127E bool player_fight(char *u);
128E bool player_fight(aClient *user);
129
130E bool master_fight(char *u);
131E bool master_fight(aClient *user);
132
133#ifndef HAVE_STRTOK
134E char *strtok(char *str, const char *delim);
135#endif
136
137E char *spaces(int len, char *seperator);
138E void display_monster(char *u);
139E void display_players(char *u);
140E int stricmp(const char *s1, const char *s2);
141E int strnicmp(const char *s1, const char *s2, size_t len);
142E long int chartoint(char ch);
143E int isstringnum(char *num);
144E long int pow (int x, int y);
145E long int stringtoint(char *number);
146E void init_masters();
147E void init_monsters();
148E bool load_monsters();
149E void delete_monsters();
150E void delete_masters();
151E Monster *getNewMonster(Monster *m);
152E void deleteMonster(Monster *m);
153E void refresh(Player *p);
154E void refreshall();
155E void updateTS(Player *p);
156E bool timedOut(Player *p);
157E void timeOutEvent(Player *p);
158E void reset(Player *p);
159E void resetall();
160
161E void do_attack(char *u);
162E void do_bank(char *u);
163E void do_fight(char *u);
164E void do_forest(char *u);
165E void do_heal(char *u);
166E void do_identify(char *u);
167E void do_invenory(char *u);
168E void do_list(char *u);
169E void do_logout(char *u);
170E void do_play(char *u);
171E void do_quitg(char *u);
172E void do_refresh(char *u);
173E void do_register(char *u);
174E void do_reset(char *u);
175E void do_run(char *u);
176E void do_stats(char *u);
177E void do_store(char *u);
178E void do_tavern(char *u);
179E void do_use(char *u);
180E void see_mystic(char *u);
181
182E void logout(aClient *user); // log a user off the game
183E void showstats(const char *u, const char *nick);
184E void showinventory(aClient *from, aClient *to = NULL);
185/* Database saving stuff */
186
187E int save_gs_dbase();
188E int load_gs_dbase();
189
190// Log File Stuff
191E void log(const char *fmt, ...);
192
193#endif