mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(net): support adding events to the NetClient event queue
This commit is contained in:
parent
066e650958
commit
cf6bc34657
2 changed files with 25 additions and 1 deletions
|
|
@ -21,7 +21,26 @@ void InitializePropContext() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes) {
|
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) {
|
void NetClient::AuthChallengeHandler(WowConnection* conn, CDataStore* msg) {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,11 @@ struct AuthenticationChallenge {
|
||||||
|
|
||||||
class NETEVENTQUEUENODE : public TSLinkedNode<NETEVENTQUEUENODE> {
|
class NETEVENTQUEUENODE : public TSLinkedNode<NETEVENTQUEUENODE> {
|
||||||
public:
|
public:
|
||||||
|
// Member variables
|
||||||
|
EVENTID m_eventId;
|
||||||
|
uint32_t m_timeReceived;
|
||||||
|
void* m_data;
|
||||||
|
uint32_t m_dataSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NETEVENTQUEUE {
|
class NETEVENTQUEUE {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue