]> jfr.im git - irc/gameservirc.git/blame - gameserv/aClient.h
More exciting additions to FilePlayerDAO!
[irc/gameservirc.git] / gameserv / aClient.h
CommitLineData
85ce9d3e 1#ifndef ACLIENT_H
2#define ACLIENT_H
3
4#include <string.h>
ce61cdfa 5#include "options.h"
85ce9d3e 6#include "player.h"
fb37ecc7 7#include <iostream>
26b17386 8
85ce9d3e 9class Player; // forward declaration
10
c10b78ac 11class aClient
12{
13 friend ostream &operator<<( ostream &output, const aClient &c);
14
15public:
69db6f3f 16 aClient(const string &); // Constructor takes a char for the nick
c10b78ac 17
18#ifdef P10
19 aClient(char *, char *); // Constructor takes a char for the nick and realnick
20#endif
85ce9d3e 21
c10b78ac 22 bool operator==(const aClient &);
23 bool operator!=(const aClient &);
24 aClient(const aClient &); // Copy constructor
25 aClient(); // Default constructor
26 ~aClient(); // Destructor
27
28 // Sets the client's player struct data to the same thing as another aClient's
29 // player struct data
30 void setData(const aClient *);
31
32 void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick
33 char *getNick() { return nick; }; // Returns the client's nick
34
35#ifdef P10
36 void setRealNick(char *rn) { strcpy(realnick, rn);}; // Sets the client's realnick
37 char *getRealNick() { return realnick; }; // Returns the client's real text nickname
38#endif
39
40 Player *stats; // Pointer to the client's player struct
41
42 long int getFlags() { return flags; }; // Returns the Client's current flags
43
44 // Functions also return the flags after modifying them
45 long int setFlags(long int); // Sets the clients flags to a new value
46 long int addFlag(long int); // Adds a flag to the client's flags
47 long int remFlag(long int); // Removes a flag from the client's current flags
48
49private:
50#ifdef P10
51 char realnick[32]; // Client's text nickname. Not the numeric
52#endif
53 char nick[32]; // Client's current nickname. Numeric if P10 is used
54 long int flags; // Client's current flags.
85ce9d3e 55};
56
57#endif