mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-16 01:55:21 +03:00
feat(net): add send message support to NetClient
This commit is contained in:
parent
d35101546e
commit
0a35f03b29
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user