tibia-client/src/protocollogin.h

39 lines
973 B
C
Raw Normal View History

2011-04-20 08:40:31 +02:00
#ifndef PROTOCOLLOGIN_H
#define PROTOCOLLOGIN_H
#include <net/protocol.h>
class ProtocolLogin;
typedef std::shared_ptr<ProtocolLogin> ProtocolLoginPtr;
2011-04-20 08:40:31 +02:00
class ProtocolLogin : public Protocol
{
public:
ProtocolLogin();
2011-07-17 08:56:57 +02:00
~ProtocolLogin();
2011-04-20 08:40:31 +02:00
static ProtocolLoginPtr create() { return ProtocolLoginPtr(new ProtocolLogin); }
2011-05-30 05:11:12 +02:00
void login(const std::string& accountName, const std::string& accountPassword);
2011-04-20 08:40:31 +02:00
void onConnect();
2011-08-01 06:28:41 +02:00
void onRecv(InputMessage& inputMessage);
2011-04-20 08:40:31 +02:00
void cancel() { /* TODO: this func */ }
2011-07-27 01:55:39 +02:00
ProtocolLoginPtr asProtocolLogin() { return std::static_pointer_cast<ProtocolLogin>(shared_from_this()); }
virtual const char* getLuaTypeName() const { return "ProtocolLogin"; }
2011-05-31 03:55:34 +02:00
2011-04-20 08:40:31 +02:00
private:
2011-08-01 06:28:41 +02:00
void sendLoginPacket();
void parseError(InputMessage& inputMessage);
void parseMOTD(InputMessage& inputMessage);
void parseCharacterList(InputMessage& inputMessage);
2011-05-30 05:11:12 +02:00
std::string m_accountName, m_accountPassword;
2011-04-20 08:40:31 +02:00
};
#endif