2023-01-02 13:17:18 -06:00
|
|
|
#ifndef NET_CONNECTION_REALM_CONNECTION_HPP
|
|
|
|
|
#define NET_CONNECTION_REALM_CONNECTION_HPP
|
|
|
|
|
|
|
|
|
|
#include "net/connection/NetClient.hpp"
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
class CDataStore;
|
|
|
|
|
class RealmResponse;
|
|
|
|
|
|
|
|
|
|
class RealmConnection : public NetClient {
|
|
|
|
|
public:
|
2023-02-25 15:59:30 -06:00
|
|
|
// Types
|
|
|
|
|
struct REALMCONNECTIONNODE : TSLinkedNode<REALMCONNECTIONNODE> {
|
|
|
|
|
RealmConnection* connection;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Static variables
|
|
|
|
|
SCritSect static s_AllRealmConnectionsCrit;
|
|
|
|
|
STORM_LIST(REALMCONNECTIONNODE) static s_AllRealmConnections;
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
// Static functions
|
|
|
|
|
int32_t static MessageHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
2023-02-25 15:59:30 -06:00
|
|
|
void static PollNet();
|
2023-01-02 13:17:18 -06:00
|
|
|
|
|
|
|
|
// Member variables
|
|
|
|
|
RealmResponse* m_realmResponse;
|
2025-03-29 23:37:24 +04:00
|
|
|
TSFixedArray<CHARACTER_INFO> m_characterList;
|
2023-04-03 18:00:18 -05:00
|
|
|
uint8_t m_authenticated = 0;
|
|
|
|
|
uint32_t m_queuePosition = 0;
|
|
|
|
|
uint32_t m_freeCharacterMigration = 0;
|
|
|
|
|
uint32_t m_billingTimeRemaining = 0;
|
|
|
|
|
uint32_t m_billingTimeRested = 0;
|
|
|
|
|
uint8_t m_billingFlags = 0;
|
|
|
|
|
uint8_t m_accountExpansion = 0;
|
2023-01-02 13:17:18 -06:00
|
|
|
|
2023-02-25 15:59:30 -06:00
|
|
|
// Virtual member functions
|
|
|
|
|
virtual int32_t HandleAuthChallenge(AuthenticationChallenge* challenge);
|
2025-03-29 23:37:24 +04:00
|
|
|
virtual void Complete(int32_t result, int32_t errorCode) = 0;
|
2023-02-25 15:59:30 -06:00
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
// Member functions
|
|
|
|
|
RealmConnection(RealmResponse* realmResponse);
|
2023-04-03 18:00:18 -05:00
|
|
|
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
2025-03-29 23:37:24 +04:00
|
|
|
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
2025-04-17 01:32:37 +04:00
|
|
|
int32_t HandleCharacterDelete(uint32_t msgId, uint32_t time, CDataStore* msg);
|
2023-02-11 20:46:32 -06:00
|
|
|
void SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4);
|
2025-03-29 23:37:24 +04:00
|
|
|
void RequestCharacterEnum();
|
2025-03-30 00:02:58 +04:00
|
|
|
void RequestCharacterLogin(uint64_t id);
|
2023-01-02 13:17:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|