mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-19 03:20:11 +03:00
feat(net): add initial handling for SMSG_AUTH_CHALLENGE
This commit is contained in:
parent
50a597a341
commit
066e650958
@ -36,7 +36,7 @@ enum EVENTID {
|
||||
EVENT_ID_26 = 26,
|
||||
EVENT_ID_27 = 27,
|
||||
EVENT_ID_28 = 28,
|
||||
EVENT_ID_29 = 29,
|
||||
EVENT_ID_NET_AUTH_CHALLENGE = 29,
|
||||
EVENT_ID_30 = 30,
|
||||
EVENT_ID_31 = 31,
|
||||
EVENT_ID_32 = 32,
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <new>
|
||||
#include <common/DataStore.hpp>
|
||||
#include <common/Prop.hpp>
|
||||
#include <common/SHA1.hpp>
|
||||
#include <common/Time.hpp>
|
||||
#include <storm/Error.hpp>
|
||||
#include <storm/String.hpp>
|
||||
@ -24,7 +25,24 @@ void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, con
|
||||
}
|
||||
|
||||
void NetClient::AuthChallengeHandler(WowConnection* conn, CDataStore* msg) {
|
||||
auto challenge = static_cast<AuthenticationChallenge*>(SMemAlloc(sizeof(AuthenticationChallenge), __FILE__, __LINE__, 0x0));
|
||||
|
||||
uint32_t v14;
|
||||
msg->Get(v14);
|
||||
|
||||
msg->Get(challenge->uint0);
|
||||
|
||||
// TODO calculate client seed?
|
||||
|
||||
if (conn == this->m_serverConnection) {
|
||||
this->m_netEventQueue->AddEvent(EVENT_ID_NET_AUTH_CHALLENGE, conn, this, challenge, sizeof(AuthenticationChallenge));
|
||||
} else if (conn == this->m_redirectConnection) {
|
||||
// TODO
|
||||
} else {
|
||||
conn->Disconnect();
|
||||
}
|
||||
|
||||
delete challenge;
|
||||
}
|
||||
|
||||
void NetClient::Connect(const char* addrStr) {
|
||||
|
@ -14,6 +14,12 @@ class WowConnection;
|
||||
|
||||
typedef int32_t (*MESSAGE_HANDLER)(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
|
||||
struct AuthenticationChallenge {
|
||||
uint32_t uint0;
|
||||
uint32_t uint4;
|
||||
uint64_t uint8;
|
||||
};
|
||||
|
||||
class NETEVENTQUEUENODE : public TSLinkedNode<NETEVENTQUEUENODE> {
|
||||
public:
|
||||
};
|
||||
@ -45,6 +51,7 @@ class NetClient : public WowConnectionResponse {
|
||||
void* m_handlerParams[NUM_MSG_TYPES];
|
||||
NETEVENTQUEUE* m_netEventQueue = nullptr;
|
||||
WowConnection* m_serverConnection = nullptr;
|
||||
WowConnection* m_redirectConnection = nullptr;
|
||||
uint32_t m_pingSent = 0;
|
||||
uint32_t m_pingSequence = 0;
|
||||
uint32_t m_latency[16];
|
||||
|
Loading…
Reference in New Issue
Block a user