00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TMWSERV_ACCOUNTCLIENT_H_
00023 #define _TMWSERV_ACCOUNTCLIENT_H_
00024
00025 #include <enet/enet.h>
00026
00027 #include "account-server/account.hpp"
00028 #include "net/netcomputer.hpp"
00029
00030 class AccountHandler;
00031
00032 enum
00033 {
00034 CLIENT_LOGIN = 0,
00035 CLIENT_CONNECTED,
00036 CLIENT_QUEUED
00037 };
00038
00042 class AccountClient : public NetComputer
00043 {
00044 public:
00048 AccountClient(ENetPeer *peer);
00049
00053 ~AccountClient();
00054
00058 void setAccount(Account *acc);
00059
00063 void
00064 unsetAccount();
00065
00069 Account *getAccount() const
00070 { return mAccount; }
00071
00075 void updateLoginAttempt();
00076
00080 int getLastLoginAttempt() const
00081 { return lastLoginAttempt; }
00082
00083 int status;
00084
00085 private:
00087 Account *mAccount;
00088 time_t lastLoginAttempt;
00089 };
00090
00091 #endif