feat(net): support adding events to the NetClient event queue

This commit is contained in:
fallenoak 2023-02-25 13:56:08 -06:00
parent 066e650958
commit cf6bc34657
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 25 additions and 1 deletions

View File

@ -21,7 +21,26 @@ void InitializePropContext() {
}
void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes) {
// TODO
this->m_critSect.Enter();
auto node = this->m_eventQueue.NewNode(2, 0, 0x0);
node->m_eventId = eventId;
if (bytes) {
node->m_data = SMemAlloc(bytes, __FILE__, __LINE__, 0x0);
memcpy(node->m_data, data, bytes);
node->m_dataSize = bytes;
} else {
node->m_data = nullptr;
node->m_dataSize = 0;
}
node->m_timeReceived = OsGetAsyncTimeMsPrecise();
// TODO SInterlockedIncremement(client->uint2E44);
this->m_critSect.Leave();
}
void NetClient::AuthChallengeHandler(WowConnection* conn, CDataStore* msg) {

View File

@ -22,6 +22,11 @@ struct AuthenticationChallenge {
class NETEVENTQUEUENODE : public TSLinkedNode<NETEVENTQUEUENODE> {
public:
// Member variables
EVENTID m_eventId;
uint32_t m_timeReceived;
void* m_data;
uint32_t m_dataSize;
};
class NETEVENTQUEUE {