You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
969 B

13 years ago
#ifndef PROTOCOLLOGIN_H
#define PROTOCOLLOGIN_H
#include <net/protocol.h>
class ProtocolLogin;
typedef std::shared_ptr<ProtocolLogin> ProtocolLoginPtr;
13 years ago
class ProtocolLogin : public Protocol
{
public:
ProtocolLogin();
~ProtocolLogin();
13 years ago
static ProtocolLoginPtr create() { return ProtocolLoginPtr(new ProtocolLogin); }
void login(const std::string& accountName, const std::string& accountPassword);
13 years ago
void onConnect();
void sendPacket();
void onRecv(InputMessage *inputMessage);
13 years ago
void cancel() { /* TODO: this func */ }
13 years ago
ProtocolLoginPtr asProtocolLogin() { return std::static_pointer_cast<ProtocolLogin>(shared_from_this()); }
virtual const char* getLuaTypeName() const { return "ProtocolLogin"; }
13 years ago
private:
void parseError(InputMessage *inputMessage);
void parseMOTD(InputMessage *inputMessage);
void parseCharacterList(InputMessage *inputMessage);
std::string m_accountName, m_accountPassword;
13 years ago
};
#endif