X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/c62d75be7b442b76e9aaecbb6150ab0c91b5a645..6f727d4c9eb5c886f14598577f40da583577444e:/gameserv/extern.h diff --git a/gameserv/extern.h b/gameserv/extern.h index 4918c68..2c6b780 100644 --- a/gameserv/extern.h +++ b/gameserv/extern.h @@ -4,13 +4,14 @@ #define E extern #define LEVELS 12 // Levels in the game -#define REALLEVELS 8 // Levels to load from monsters.dat +#define REALLEVELS 9 // Levels to load from monsters.dat #define MONSTERS 12 // Monsters per level #include #include "player.h" #include "list.h" #include "config.h" +#include "options.h" #if TIME_WITH_SYS_TIME # include @@ -23,25 +24,35 @@ # endif #endif +// Hash.cpp stuff start +#define U_TABLE_SIZE 1999 +E unsigned long sHASH(const unsigned char *name); +E unsigned long iHASH(const unsigned char *name); +// hash.cpp stuff end -// The timestamp from load time to be compared against the current midnight time. -E long timestamp; -E void save_timestamp(); -E void load_timestamp(); -E long int midnight(long int offset = 8); + +E int day; +E void save_day(); +E void load_day(); // The socket E int sock; -// Random configuration stuff -E void load_config_file(char *config = "gameserv.conf"); +/* config.cpp start */ +E int load_config_file(char *config = "gameserv.conf"); E void unload_config_file(); E char *s_GameServ; E char *c_Forest; E char *c_ForestTopic; E char *gshost; E char *gsident; +E char *pidfile; + +#if defined(P10) +E char *gsnum; +#endif + E char *servername; E char *remoteserver; E char *remoteport; @@ -53,21 +64,40 @@ E char *adminpass; E char *VERSION; E char *PACKAGE; E char *welcomemsg; +E char *ignoreserverslist; +E long configflags; +E bool shuttingdown; E int welcomedelay; E int updateperiod; E int forestfights; +E int maxafightdistance; +E int maxbfightdistance; +E int maxidletime; +E int idlecheckperiod; -E List clients; -E List players; +/* config.cpp end */ + +E List players[U_TABLE_SIZE]; +E List clients[U_TABLE_SIZE]; +E Monster boss; + +/** tcpclient.cpp **/ +E void check_idles(); /** List search functions **/ E aClient *find(char *nick); E aClient *find(const char *nick); E aClient *findbynick(char *nick); E aClient *findbynick(const char *nick); +E aClient *findbyrealnick(char *realnick); E aClient *findplayer(const char *name); E aClient *findIRCplayer(const char *nick); +#ifdef P10 +E aClient *findbyrealnick(char *realnick); +#endif + +/** tcpclient.cpp **/ /** Sock writing functions **/ E void notice(const char *source, const char *dest, const char *fmt, ...); @@ -116,6 +146,9 @@ E Monster *getNewMonster(Monster *m); E void deleteMonster(Monster *m); E void refresh(Player *p); E void refreshall(); +E void updateTS(Player *p); +E bool timedOut(Player *p); +E void timeOutEvent(Player *p); E void reset(Player *p); E void resetall(); @@ -127,6 +160,7 @@ E void do_heal(char *u); E void do_identify(char *u); E void do_invenory(char *u); E void do_list(char *u); +E void do_logout(char *u); E void do_play(char *u); E void do_quitg(char *u); E void do_refresh(char *u); @@ -139,6 +173,7 @@ E void do_tavern(char *u); E void do_use(char *u); E void see_mystic(char *u); +E void logout(aClient *user); // log a user off the game E void showstats(const char *u, const char *nick); E void showinventory(aClient *from, aClient *to = NULL); /* Database saving stuff */