]> jfr.im git - irc/gameservirc.git/blob - gameserv/extern.h
Redid the midnight code to use struct tm's tm_mday integer var instead of doing calcu...
[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 8 // 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
28 E int day;
29 E void save_day();
30 E void load_day();
31
32 // The socket
33 E int sock;
34
35
36 // Random configuration stuff
37 E void load_config_file(char *config = "gameserv.conf");
38 E void unload_config_file();
39 E char *s_GameServ;
40 E char *c_Forest;
41 E char *c_ForestTopic;
42 E char *gshost;
43 E char *gsident;
44
45 #if defined(P10)
46 E char *gsnum;
47 #endif
48
49 E char *servername;
50 E char *remoteserver;
51 E char *remoteport;
52 E char *remotepass;
53 E char *playerdata;
54 E char *logfile;
55 E char *monsterdata;
56 E char *adminpass;
57 E char *VERSION;
58 E char *PACKAGE;
59 E char *welcomemsg;
60
61 E int welcomedelay;
62 E int updateperiod;
63 E int forestfights;
64
65 E List<aClient> clients;
66 E List<aClient> players;
67
68 /** List search functions **/
69 E aClient *find(char *nick);
70 E aClient *find(const char *nick);
71 E aClient *findbynick(char *nick);
72 E aClient *findbynick(const char *nick);
73 E aClient *findbyrealnick(char *realnick);
74 E aClient *findplayer(const char *name);
75 E aClient *findIRCplayer(const char *nick);
76 #ifdef P10
77 E aClient *findbyrealnick(char *realnick);
78 #endif
79
80 /** Sock writing functions **/
81 E void notice(const char *source, const char *dest, const char *fmt, ...);
82 E void raw(const char *fmt, ...);
83
84 /** gameserv.cpp **/
85 E void gameserv(char *source, char *buf);
86 E Monster *monsters[LEVELS][MONSTERS];
87
88 /** forest.cpp **/
89 E void forest(char *source, char *buf);
90
91 /** functions.cpp **/
92
93 E bool is_playing(char *u);
94 E bool is_playing(aClient *user);
95
96 E bool is_fighting(char *u);
97 E bool is_fighting(aClient *user);
98
99 E bool player_fight(char *u);
100 E bool player_fight(aClient *user);
101
102 E bool master_fight(char *u);
103 E bool master_fight(aClient *user);
104
105 #ifndef HAVE_STRTOK
106 E char *strtok(char *str, const char *delim);
107 #endif
108
109 E char *spaces(int len, char *seperator);
110 E void display_monster(char *u);
111 E void display_players(char *u);
112 E int stricmp(const char *s1, const char *s2);
113 E int strnicmp(const char *s1, const char *s2, size_t len);
114 E long int chartoint(char ch);
115 E int isstringnum(char *num);
116 E long int pow (int x, int y);
117 E long int stringtoint(char *number);
118 E void init_masters();
119 E void init_monsters();
120 E bool load_monsters();
121 E void delete_monsters();
122 E void delete_masters();
123 E Monster *getNewMonster(Monster *m);
124 E void deleteMonster(Monster *m);
125 E void refresh(Player *p);
126 E void refreshall();
127 E void reset(Player *p);
128 E void resetall();
129
130 E void do_attack(char *u);
131 E void do_bank(char *u);
132 E void do_fight(char *u);
133 E void do_forest(char *u);
134 E void do_heal(char *u);
135 E void do_identify(char *u);
136 E void do_invenory(char *u);
137 E void do_list(char *u);
138 E void do_play(char *u);
139 E void do_quitg(char *u);
140 E void do_refresh(char *u);
141 E void do_register(char *u);
142 E void do_reset(char *u);
143 E void do_run(char *u);
144 E void do_stats(char *u);
145 E void do_store(char *u);
146 E void do_tavern(char *u);
147 E void do_use(char *u);
148 E void see_mystic(char *u);
149
150 E void showstats(const char *u, const char *nick);
151 E void showinventory(aClient *from, aClient *to = NULL);
152 /* Database saving stuff */
153
154 E int save_gs_dbase();
155 E int load_gs_dbase();
156
157 // Log File Stuff
158 E void log(const char *fmt, ...);
159
160 #endif