00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TMW_ACCOUNTCONNECTION_H_
00023 #define _TMW_ACCOUNTCONNECTION_H_
00024
00025 #include "net/messageout.hpp"
00026 #include "net/connection.hpp"
00027
00028 class Character;
00029
00043 #define SYNC_BUFFER_SIZE 1024
00044 #define SYNC_BUFFER_LIMIT 20
00049 class AccountConnection : public Connection
00050 {
00051 public:
00055 AccountConnection();
00056
00060 ~AccountConnection();
00061
00066 bool start();
00067
00071 void sendCharacterData(Character *);
00072
00076 void playerReconnectAccount(int id, const std::string &magic_token);
00077
00081 void requestQuestVar(Character *, const std::string &);
00082
00086 void updateQuestVar(Character *, const std::string &name,
00087 const std::string &value);
00088
00092 void banCharacter(Character *, int);
00093
00097 void sendStatistics();
00098
00102 void sendPost(Character *, MessageIn &);
00103
00107 void getPost(Character *);
00108
00112 void changeAccountLevel(Character *, int);
00113
00121 void syncChanges(bool force = false);
00122
00133 void updateCharacterPoints(int charId, int charPoints,
00134 int corrPoints, int attribId,
00135 int attribValue);
00136
00145 void updateExperience(int charId, int skillId, int skillValue);
00146
00154 void updateOnlineStatus(int charId, bool online);
00155
00159 void sendTransaction(int id, int action, const std::string &message);
00160
00161 protected:
00165 virtual void processMessage(MessageIn &);
00166
00167 private:
00168 MessageOut* mSyncBuffer;
00169 int mSyncMessages;
00170 };
00171
00172 extern AccountConnection *accountHandler;
00173
00174 #endif // _TMW_ACCOUNTCONNECTION_H_