]>
Commit | Line | Data |
---|---|---|
85ce9d3e | 1 | #ifndef EXTERN_H |
2 | #define EXTERN_H | |
3 | ||
4 | #define E extern | |
5 | ||
ab4f4ec0 | 6 | #define LEVELS 12 // Levels in the game |
1579dfa2 | 7 | #define REALLEVELS 9 // Levels to load from monsters.dat |
ab4f4ec0 | 8 | #define MONSTERS 12 // Monsters per level |
9 | ||
85ce9d3e | 10 | #include <stdarg.h> |
11 | #include "player.h" | |
12 | #include "list.h" | |
44ea29f7 | 13 | #include "config.h" |
e1c41a84 | 14 | #include "options.h" |
44ea29f7 | 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 | ||
abbfcdb9 | 28 | E int day; |
29 | E void save_day(); | |
30 | E void load_day(); | |
85ce9d3e | 31 | |
32 | // The socket | |
33 | E int sock; | |
34 | ||
9d057db5 | 35 | |
85ce9d3e | 36 | // Random configuration stuff |
624c0352 | 37 | E int load_config_file(char *config = "gameserv.conf"); |
85ce9d3e | 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; | |
529f5e31 | 44 | E char *pidfile; |
e1c41a84 | 45 | |
46 | #if defined(P10) | |
47 | E char *gsnum; | |
48 | #endif | |
49 | ||
85ce9d3e | 50 | E char *servername; |
51 | E char *remoteserver; | |
52 | E char *remoteport; | |
53 | E char *remotepass; | |
54 | E char *playerdata; | |
c62d75be | 55 | E char *logfile; |
4dde2ed9 | 56 | E char *monsterdata; |
45a84400 | 57 | E char *adminpass; |
173302fe | 58 | E char *VERSION; |
59 | E char *PACKAGE; | |
bf2cabcd | 60 | E char *welcomemsg; |
61 | ||
922daad7 | 62 | E int welcomedelay; |
63 | E int updateperiod; | |
20d5d721 | 64 | E int forestfights; |
85ce9d3e | 65 | |
66 | E List<aClient> clients; | |
67 | E List<aClient> players; | |
425d7369 | 68 | E Monster boss; |
85ce9d3e | 69 | |
70 | /** List search functions **/ | |
71 | E aClient *find(char *nick); | |
72 | E aClient *find(const char *nick); | |
73 | E aClient *findbynick(char *nick); | |
74 | E aClient *findbynick(const char *nick); | |
4e5760fd | 75 | E aClient *findbyrealnick(char *realnick); |
0a1518fa | 76 | E aClient *findplayer(const char *name); |
ee38284f | 77 | E aClient *findIRCplayer(const char *nick); |
ce61cdfa | 78 | #ifdef P10 |
79 | E aClient *findbyrealnick(char *realnick); | |
80 | #endif | |
85ce9d3e | 81 | |
82 | /** Sock writing functions **/ | |
83 | E void notice(const char *source, const char *dest, const char *fmt, ...); | |
84 | E void raw(const char *fmt, ...); | |
85 | ||
86 | /** gameserv.cpp **/ | |
87 | E void gameserv(char *source, char *buf); | |
ab4f4ec0 | 88 | E Monster *monsters[LEVELS][MONSTERS]; |
85ce9d3e | 89 | |
90 | /** forest.cpp **/ | |
91 | E void forest(char *source, char *buf); | |
92 | ||
93 | /** functions.cpp **/ | |
94 | ||
85ce9d3e | 95 | E bool is_playing(char *u); |
1af35752 | 96 | E bool is_playing(aClient *user); |
97 | ||
85ce9d3e | 98 | E bool is_fighting(char *u); |
1af35752 | 99 | E bool is_fighting(aClient *user); |
100 | ||
85ce9d3e | 101 | E bool player_fight(char *u); |
1af35752 | 102 | E bool player_fight(aClient *user); |
103 | ||
85ce9d3e | 104 | E bool master_fight(char *u); |
1af35752 | 105 | E bool master_fight(aClient *user); |
106 | ||
653c4f62 | 107 | #ifndef HAVE_STRTOK |
85ce9d3e | 108 | E char *strtok(char *str, const char *delim); |
653c4f62 | 109 | #endif |
110 | ||
85ce9d3e | 111 | E char *spaces(int len, char *seperator); |
85ce9d3e | 112 | E void display_monster(char *u); |
113 | E void display_players(char *u); | |
114 | E int stricmp(const char *s1, const char *s2); | |
115 | E int strnicmp(const char *s1, const char *s2, size_t len); | |
116 | E long int chartoint(char ch); | |
117 | E int isstringnum(char *num); | |
118 | E long int pow (int x, int y); | |
119 | E long int stringtoint(char *number); | |
120 | E void init_masters(); | |
121 | E void init_monsters(); | |
4dde2ed9 | 122 | E bool load_monsters(); |
c8ada07e | 123 | E void delete_monsters(); |
124 | E void delete_masters(); | |
125 | E Monster *getNewMonster(Monster *m); | |
126 | E void deleteMonster(Monster *m); | |
44ea29f7 | 127 | E void refresh(Player *p); |
85ce9d3e | 128 | E void refreshall(); |
ee38284f | 129 | E void reset(Player *p); |
130 | E void resetall(); | |
85ce9d3e | 131 | |
9cda831c | 132 | E void do_attack(char *u); |
133 | E void do_bank(char *u); | |
134 | E void do_fight(char *u); | |
135 | E void do_forest(char *u); | |
136 | E void do_heal(char *u); | |
85ce9d3e | 137 | E void do_identify(char *u); |
9cda831c | 138 | E void do_invenory(char *u); |
139 | E void do_list(char *u); | |
85ce9d3e | 140 | E void do_play(char *u); |
141 | E void do_quitg(char *u); | |
9cda831c | 142 | E void do_refresh(char *u); |
143 | E void do_register(char *u); | |
85ce9d3e | 144 | E void do_reset(char *u); |
85ce9d3e | 145 | E void do_run(char *u); |
85ce9d3e | 146 | E void do_stats(char *u); |
9cda831c | 147 | E void do_store(char *u); |
148 | E void do_tavern(char *u); | |
83cf716f | 149 | E void do_use(char *u); |
85ce9d3e | 150 | E void see_mystic(char *u); |
85ce9d3e | 151 | |
9cda831c | 152 | E void showstats(const char *u, const char *nick); |
153 | E void showinventory(aClient *from, aClient *to = NULL); | |
85ce9d3e | 154 | /* Database saving stuff */ |
155 | ||
156 | E int save_gs_dbase(); | |
157 | E int load_gs_dbase(); | |
158 | ||
c62d75be | 159 | // Log File Stuff |
160 | E void log(const char *fmt, ...); | |
161 | ||
85ce9d3e | 162 | #endif |