]> jfr.im git - irc/gameservirc.git/blob - gameserv/extern.h
Added a TODO list to the cvs repository
[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 MONSTERS 12 // Monsters per level
8
9 #include <stdarg.h>
10 #include "player.h"
11 #include "list.h"
12 #include "config.h"
13
14 #if TIME_WITH_SYS_TIME
15 # include <sys/time.h>
16 # include <time.h>
17 #else
18 # if HAVE_SYS_TIME_H
19 # include <sys/time.h>
20 # else
21 # include <time.h>
22 # endif
23 #endif
24
25
26 // The timestamp from load time to be compared against the current midnight time.
27 E long timestamp;
28 E void save_timestamp();
29 E void load_timestamp();
30 E long int midnight(long int offset = 8);
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 E char *servername;
45 E char *remoteserver;
46 E char *remoteport;
47 E char *remotepass;
48 E char *playerdata;
49 E char *adminpass;
50 E char *VERSION;
51 E char *PACKAGE;
52
53 E List<aClient> clients;
54 E List<aClient> players;
55
56 /** List search functions **/
57 E aClient *find(char *nick);
58 E aClient *find(const char *nick);
59 E aClient *findbynick(char *nick);
60 E aClient *findbynick(const char *nick);
61 E aClient *findplayer(const char *name);
62
63 /** Sock writing functions **/
64 E void notice(const char *source, const char *dest, const char *fmt, ...);
65 E void raw(const char *fmt, ...);
66
67 /** gameserv.cpp **/
68 E void gameserv(char *source, char *buf);
69 E Monster *monsters[LEVELS][MONSTERS];
70
71 /** forest.cpp **/
72 E void forest(char *source, char *buf);
73
74 /** functions.cpp **/
75
76 E bool is_playing(char *u);
77 E bool is_playing(aClient *user);
78
79 E bool is_fighting(char *u);
80 E bool is_fighting(aClient *user);
81
82 E bool player_fight(char *u);
83 E bool player_fight(aClient *user);
84
85 E bool master_fight(char *u);
86 E bool master_fight(aClient *user);
87
88 E bool is_alive(char *u);
89 E bool is_alive(aClient *user);
90
91 #ifndef HAVE_STRTOK
92 E char *strtok(char *str, const char *delim);
93 #endif
94
95 E char *spaces(int len, char *seperator);
96 E void display_monster(char *u);
97 E void display_players(char *u);
98 E int stricmp(const char *s1, const char *s2);
99 E int strnicmp(const char *s1, const char *s2, size_t len);
100 E long int chartoint(char ch);
101 E int isstringnum(char *num);
102 E long int pow (int x, int y);
103 E long int stringtoint(char *number);
104 E void init_masters();
105 E void init_monsters();
106 E void delete_monsters();
107 E void delete_masters();
108 E Monster *getNewMonster(Monster *m);
109 E void deleteMonster(Monster *m);
110 E void refresh(Player *p);
111 E void refreshall();
112 E void reset(aClient *ni);
113
114 E void do_list(char *u);
115 E void do_refresh(char *u);
116 E void do_register(char *u);
117 E void do_identify(char *u);
118 E void do_play(char *u);
119 E void do_quitg(char *u);
120 E void do_reset(char *u);
121 E void do_fight(char *u);
122 E void do_store(char *u);
123 E void do_heal(char *u);
124 E void do_bank(char *u);
125 E void do_attack(char *u);
126 E void do_run(char *u);
127 E void do_visit(char *u);
128 E void do_stats(char *u);
129 E void do_forest(char *u);
130 E void see_mystic(char *u);
131 E void showstats(const char *u, const char *nick);
132
133 /* Database saving stuff */
134
135 E int save_gs_dbase();
136 E int load_gs_dbase();
137
138 #endif