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