]> jfr.im git - irc/gameservirc.git/blob - gameserv/do_stats.cpp
Removed GameServ.suo
[irc/gameservirc.git] / gameserv / do_stats.cpp
1 #include "extern.h"
2 #include "aClient.h"
3 #include "flags.h"
4 #include "options.h"
5
6 void do_stats(char *u)
7 {
8 char *nick;
9 aClient *user;
10
11 nick = strtok(NULL, " ");
12
13 if (!(user = find(u)))
14 {
15 log("Fatal Error: %s not found in client list", u);
16 return;
17 }
18 else if (isIgnore(user))
19 {
20 #ifdef DEBUGMODE
21 log("Ignoring %s.", user->getNick());
22 #endif
23 return;
24 }
25 else if (!nick)
26 {
27 if (!is_playing(user))
28 {
29 notice(s_GameServ, u, "You're not playing, so you have no stats!");
30 return;
31 }
32 else
33 {
34 if (!is_fighting(user))
35 updateTS(user->stats);
36 showstats(u, user->stats->getName().c_str());
37 }
38 }
39 else
40 showstats(u, nick);
41 }