mirror of
https://github.com/HikikoMarmy/Champions-Reborn-Server.git
synced 2026-04-04 16:49:47 -03:00
Reorganized and cleaned up the solution.
This commit is contained in:
43
Include/Network/Event/RequestLogin.hpp
Normal file
43
Include/Network/Event/RequestLogin.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "../GenericNetRequest.hpp"
|
||||
#include "../GenericNetResponse.hpp"
|
||||
|
||||
class RequestLogin : public GenericRequest
|
||||
{
|
||||
private:
|
||||
enum LOGIN_REPLY {
|
||||
SUCCESS = 0,
|
||||
FATAL_ERROR,
|
||||
ACCOUNT_INVALID = 4,
|
||||
};
|
||||
|
||||
std::wstring m_username;
|
||||
std::wstring m_password;
|
||||
std::wstring m_sessionId;
|
||||
|
||||
public:
|
||||
static std::unique_ptr< RequestLogin > Create()
|
||||
{
|
||||
return std::make_unique< RequestLogin >();
|
||||
}
|
||||
|
||||
sptr_generic_response ProcessRequest( sptr_socket socket, sptr_byte_stream stream ) override;
|
||||
void Deserialize( sptr_byte_stream stream ) override;
|
||||
|
||||
sptr_generic_response ProcessLoginCON( sptr_user user );
|
||||
sptr_generic_response ProcessLoginRTA( sptr_user user );
|
||||
};
|
||||
|
||||
class ResultLogin : public GenericResponse {
|
||||
private:
|
||||
std::wstring m_sessionId;
|
||||
int32_t m_reply;
|
||||
|
||||
public:
|
||||
ResultLogin( GenericRequest *request, int32_t reply, std::wstring sessionId );
|
||||
void Serialize( ByteBuffer &out ) const;
|
||||
};
|
||||
Reference in New Issue
Block a user