]>
jfr.im git - irc/gameservirc.git/blob - gameserv/extern.h
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
16 #if TIME_WITH_SYS_TIME
17 # include <sys/time.h>
21 # include <sys/time.h>
27 // Hash.cpp stuff start
28 #define U_TABLE_SIZE 1999
29 E
unsigned long HASH(const unsigned char *name
, int size_of_table
);
41 /* config.cpp start */
42 E
int load_config_file(char *config
= "gameserv.conf");
43 E
void unload_config_file();
46 E
char *c_ForestTopic
;
71 E
int maxafightdistance
;
72 E
int maxbfightdistance
;
76 E List
<aClient
> players
[U_TABLE_SIZE
];
77 E List
<aClient
> clients
[U_TABLE_SIZE
];
80 /** List search functions **/
81 E aClient
*find(char *nick
);
82 E aClient
*find(const char *nick
);
83 E aClient
*findbynick(char *nick
);
84 E aClient
*findbynick(const char *nick
);
85 E aClient
*findbyrealnick(char *realnick
);
86 E aClient
*findplayer(const char *name
);
87 E aClient
*findIRCplayer(const char *nick
);
89 E aClient
*findbyrealnick(char *realnick
);
92 /** Sock writing functions **/
93 E
void notice(const char *source
, const char *dest
, const char *fmt
, ...);
94 E
void raw(const char *fmt
, ...);
97 E
void gameserv(char *source
, char *buf
);
98 E Monster
*monsters
[LEVELS
][MONSTERS
];
101 E
void forest(char *source
, char *buf
);
103 /** functions.cpp **/
105 E
bool is_playing(char *u
);
106 E
bool is_playing(aClient
*user
);
108 E
bool is_fighting(char *u
);
109 E
bool is_fighting(aClient
*user
);
111 E
bool player_fight(char *u
);
112 E
bool player_fight(aClient
*user
);
114 E
bool master_fight(char *u
);
115 E
bool master_fight(aClient
*user
);
118 E
char *strtok(char *str
, const char *delim
);
121 E
char *spaces(int len
, char *seperator
);
122 E
void display_monster(char *u
);
123 E
void display_players(char *u
);
124 E
int stricmp(const char *s1
, const char *s2
);
125 E
int strnicmp(const char *s1
, const char *s2
, size_t len
);
126 E
long int chartoint(char ch
);
127 E
int isstringnum(char *num
);
128 E
long int pow (int x
, int y
);
129 E
long int stringtoint(char *number
);
130 E
void init_masters();
131 E
void init_monsters();
132 E
bool load_monsters();
133 E
void delete_monsters();
134 E
void delete_masters();
135 E Monster
*getNewMonster(Monster
*m
);
136 E
void deleteMonster(Monster
*m
);
137 E
void refresh(Player
*p
);
139 E
void reset(Player
*p
);
142 E
void do_attack(char *u
);
143 E
void do_bank(char *u
);
144 E
void do_fight(char *u
);
145 E
void do_forest(char *u
);
146 E
void do_heal(char *u
);
147 E
void do_identify(char *u
);
148 E
void do_invenory(char *u
);
149 E
void do_list(char *u
);
150 E
void do_logout(char *u
);
151 E
void do_play(char *u
);
152 E
void do_quitg(char *u
);
153 E
void do_refresh(char *u
);
154 E
void do_register(char *u
);
155 E
void do_reset(char *u
);
156 E
void do_run(char *u
);
157 E
void do_stats(char *u
);
158 E
void do_store(char *u
);
159 E
void do_tavern(char *u
);
160 E
void do_use(char *u
);
161 E
void see_mystic(char *u
);
163 E
void logout(aClient
*user
); // log a user off the game
164 E
void showstats(const char *u
, const char *nick
);
165 E
void showinventory(aClient
*from
, aClient
*to
= NULL
);
166 /* Database saving stuff */
168 E
int save_gs_dbase();
169 E
int load_gs_dbase();
172 E
void log(const char *fmt
, ...);