]>
Commit | Line | Data |
---|---|---|
1 | #include "extern.h" | |
2 | #include "options.h" | |
3 | #include "aClient.h" | |
4 | #include "player.h" | |
5 | #include "flags.h" | |
6 | ||
7 | void do_refresh(char *u) | |
8 | { | |
9 | char *name = strtok(NULL, " "); | |
10 | aClient *user; | |
11 | Player *p; | |
12 | ||
13 | if (!(user = find(u))) | |
14 | { | |
15 | notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin"); | |
16 | log("Error: aClient not found: %s", u); | |
17 | return; | |
18 | } | |
19 | else if (isIgnore(user)) | |
20 | { | |
21 | #ifdef DEBUGMODE | |
22 | log("Ignoring %s.", user->getNick()); | |
23 | #endif | |
24 | return; | |
25 | } | |
26 | else if (!isAdmin(user)) | |
27 | { | |
28 | notice(s_GameServ, u, "You must be a <S admin to use this command!"); | |
29 | return; | |
30 | } | |
31 | if (!name) | |
32 | { | |
33 | notice(s_GameServ, u, "SYNTAX: REFRESH {ALL | NICK}"); | |
34 | return; | |
35 | } | |
36 | else if (stricmp(name, "ALL") == 0) | |
37 | { | |
38 | notice(s_GameServ, u, "Refreshing everyone's stats!"); | |
39 | refreshall(); | |
40 | } | |
41 | else if ((p = findplayer(name))) | |
42 | { | |
43 | notice(s_GameServ, u, "Refreshing %s.", p->getName().c_str()); | |
44 | refresh(p); | |
45 | } | |
46 | else | |
47 | { | |
48 | notice(s_GameServ, u, "Player %s not found.", name); | |
49 | return; | |
50 | } | |
51 | } |