mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-18 03:55:25 +03:00
feat(ui): implement Script_GetCharacterListUpdate
This commit is contained in:
9 files changed
+56
-3
No files matched your search
@@ -173,6 +173,16 @@ int32_t ClientConnection::Disconnect() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ClientConnection::GetCharacterList() {
|
||||
this->Initiate(COP_GET_CHARACTERS, 43, nullptr);
|
||||
|
||||
if (this->m_connected) {
|
||||
this->RequestCharacterEnum();
|
||||
} else {
|
||||
this->Cancel(4);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t ClientConnection::HandleConnect() {
|
||||
this->Complete(1, 5);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ class ClientConnection : public RealmConnection {
|
||||
void Complete(int32_t result, int32_t errorCode);
|
||||
void Connect();
|
||||
int32_t Disconnect();
|
||||
void GetCharacterList();
|
||||
void Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)());
|
||||
int32_t IsConnected();
|
||||
int32_t PollStatus(WOWCS_OPS& op, const char** msg, int32_t& result, int32_t& errorCode);
|
||||
|
||||
@@ -278,6 +278,16 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
||||
return 1;
|
||||
}
|
||||
|
||||
void RealmConnection::RequestCharacterEnum() {
|
||||
CDataStore msg;
|
||||
|
||||
msg.Put(static_cast<uint32_t>(CMSG_ENUM_CHARACTERS));
|
||||
|
||||
msg.Finalize();
|
||||
|
||||
this->Send(&msg);
|
||||
}
|
||||
|
||||
void RealmConnection::SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4) {
|
||||
// TODO
|
||||
}
|
||||
@@ -41,6 +41,7 @@ class RealmConnection : public NetClient {
|
||||
RealmConnection(RealmResponse* realmResponse);
|
||||
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||
void RequestCharacterEnum();
|
||||
void SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user