feat(net): add send message support to NetClient

This commit is contained in:
fallenoak 2023-03-23 17:01:27 -05:00
parent d35101546e
commit 0a35f03b29
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 21 additions and 0 deletions

View File

@ -240,6 +240,26 @@ void NetClient::PongHandler(WowConnection* conn, CDataStore* msg) {
// TODO
}
void NetClient::Send(CDataStore* msg) {
if (this->m_netState != NS_CONNECTED) {
return;
}
auto v4 = msg->m_size - msg->m_read;
if (!v4) {
return;
}
if (this->m_suspended) {
// TODO
} else {
this->m_serverConnection->Send(msg, 0);
// TODO
}
}
void NetClient::SetDelete() {
this->m_deleteMe = true;
}

View File

@ -70,6 +70,7 @@ class NetClient : public WowConnectionResponse {
int32_t Initialize();
void PollEventQueue();
void PongHandler(WowConnection* conn, CDataStore* msg);
void Send(CDataStore* msg);
void SetDelete();
void SetLoginData(LoginData* loginData);
void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);