mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
feat(net): handle connected callback in NetClient
This commit is contained in:
parent
0ca1c8e331
commit
8a3e37ce73
3 changed files with 28 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <cstring>
|
||||
#include <new>
|
||||
#include <common/Prop.hpp>
|
||||
#include <common/Time.hpp>
|
||||
#include <storm/Error.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
|
|
@ -17,6 +18,10 @@ void InitializePropContext() {
|
|||
}
|
||||
}
|
||||
|
||||
void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void NetClient::Connect(const char* addrStr) {
|
||||
if (this->m_netState != NS_INITIALIZED) {
|
||||
SErrDisplayAppFatal("Expected (m_netState == NS_INITIALIZED), got %d", this->m_netState);
|
||||
|
|
@ -94,7 +99,21 @@ void NetClient::WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNAD
|
|||
}
|
||||
|
||||
void NetClient::WCConnected(WowConnection* conn, WowConnection* inbound, uint32_t timeStamp, const NETCONNADDR* addr) {
|
||||
if (conn != this->m_serverConnection) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_pingLock.Enter();
|
||||
|
||||
// TODO
|
||||
|
||||
this->m_latencyStart = 0;
|
||||
this->m_latencyEnd = 0;
|
||||
this->m_pingSent = OsGetAsyncTimeMsPrecise();
|
||||
|
||||
this->m_pingLock.Leave();
|
||||
|
||||
this->m_netEventQueue->AddEvent(EVENT_ID_NET_CONNECT, conn, this, nullptr, 0);
|
||||
}
|
||||
|
||||
void NetClient::WCDataReady(WowConnection* conn, uint32_t timeStamp, uint8_t* data, int32_t len) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue