mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-02-04 17:19:09 +00:00
feat(net): wire up polling loop for realm connections
This commit is contained in:
parent
cf6bc34657
commit
5e2c1e7769
8 changed files with 178 additions and 5 deletions
|
|
@ -1,11 +1,24 @@
|
|||
#include "net/connection/RealmConnection.hpp"
|
||||
#include "net/Types.hpp"
|
||||
|
||||
SCritSect RealmConnection::s_AllRealmConnectionsCrit;
|
||||
STORM_LIST(RealmConnection::REALMCONNECTIONNODE) RealmConnection::s_AllRealmConnections;
|
||||
|
||||
int32_t RealmConnection::MessageHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RealmConnection::PollNet() {
|
||||
RealmConnection::s_AllRealmConnectionsCrit.Enter();
|
||||
|
||||
for (auto node = RealmConnection::s_AllRealmConnections.Head(); node; node = RealmConnection::s_AllRealmConnections.Next(node)) {
|
||||
node->connection->PollEventQueue();
|
||||
}
|
||||
|
||||
RealmConnection::s_AllRealmConnectionsCrit.Leave();
|
||||
}
|
||||
|
||||
RealmConnection::RealmConnection(RealmResponse* realmResponse) {
|
||||
this->m_realmResponse = realmResponse;
|
||||
|
||||
|
|
@ -25,7 +38,15 @@ RealmConnection::RealmConnection(RealmResponse* realmResponse) {
|
|||
this->SetMessageHandler(SMSG_DELETE_CHAR, &RealmConnection::MessageHandler, this);
|
||||
this->SetMessageHandler(SMSG_CACHE_VERSION, &RealmConnection::MessageHandler, this);
|
||||
|
||||
RealmConnection::s_AllRealmConnectionsCrit.Enter();
|
||||
auto node = RealmConnection::s_AllRealmConnections.NewNode(2, 0, 0x0);
|
||||
node->connection = this;
|
||||
RealmConnection::s_AllRealmConnectionsCrit.Leave();
|
||||
}
|
||||
|
||||
int32_t RealmConnection::HandleAuthChallenge(AuthenticationChallenge* challenge) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
void RealmConnection::SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue