]> jfr.im git - irc/gameservirc.git/blob - gameserv/do_load.cpp
Removed GameServ.suo
[irc/gameservirc.git] / gameserv / do_load.cpp
1 #include "extern.h"
2 #include "aClient.h"
3 #include "flags.h"
4 #include "options.h"
5
6 void do_load(char *u)
7 {
8 aClient *user;
9
10 if (!(user = find(u)))
11 {
12 notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
13 log("Error: aClient not found: %s", u);
14 }
15 else if (!isAdmin(user))
16 {
17 notice(s_GameServ, u, "You must be a <S admin to use this command!");
18 }
19 else
20 {
21 char *cmd2 = strtok(NULL, " ");
22 if (!cmd2)
23 {
24 notice(s_GameServ, u, "Loading player data from %s", playerdata);
25 load_gs_dbase();
26 }
27 else if (stricmp(cmd2, "MONSTERS") == 0)
28 {
29 notice(s_GameServ, u, "Loading monster data");
30 load_monsters();
31 }
32 else if (stricmp(cmd2, "SCRIPTS") == 0)
33 {
34 // Testing scripts for now
35 script scr;
36 notice(s_GameServ, u, "Loading scripts");
37
38 if (scr.loadScript("test.txt"))
39 scr.executeScript(user->stats);
40 }
41 else
42 {
43 display_help(u, "load");
44 }
45 }
46 }