mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-27 16:22:32 +03:00
feat(net): wire up polling loop for realm connections
This commit is contained in:
8 files changed
+178
-5
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user