mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-08-12 02:02:43 +03:00
Compare commits
1 Commits
2e0f37810b
...
4f3d9ac2d1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4f3d9ac2d1 |
@ -39,7 +39,6 @@ target_link_libraries(client
|
|||||||
console
|
console
|
||||||
db
|
db
|
||||||
event
|
event
|
||||||
gameui
|
|
||||||
gx
|
gx
|
||||||
model
|
model
|
||||||
net
|
net
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include "async/AsyncFile.hpp"
|
#include "async/AsyncFile.hpp"
|
||||||
#include "client/ClientServices.hpp"
|
#include "client/ClientServices.hpp"
|
||||||
#include "client/CmdLine.hpp"
|
#include "client/CmdLine.hpp"
|
||||||
#include "client/ClientHandlers.hpp"
|
|
||||||
#include "console/CVar.hpp"
|
#include "console/CVar.hpp"
|
||||||
#include "console/Client.hpp"
|
#include "console/Client.hpp"
|
||||||
#include "console/Device.hpp"
|
#include "console/Device.hpp"
|
||||||
@ -10,7 +9,6 @@
|
|||||||
#include "console/Command.hpp"
|
#include "console/Command.hpp"
|
||||||
#include "db/Db.hpp"
|
#include "db/Db.hpp"
|
||||||
#include "glue/CGlueMgr.hpp"
|
#include "glue/CGlueMgr.hpp"
|
||||||
#include "gameui/CGGameUI.hpp"
|
|
||||||
#include "gx/Screen.hpp"
|
#include "gx/Screen.hpp"
|
||||||
#include "gx/Texture.hpp"
|
#include "gx/Texture.hpp"
|
||||||
#include "model/Model2.hpp"
|
#include "model/Model2.hpp"
|
||||||
@ -664,13 +662,3 @@ void WowClientInit() {
|
|||||||
|
|
||||||
EventRegister(EVENT_ID_POLL, &PollNet);
|
EventRegister(EVENT_ID_POLL, &PollNet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientInitializeGame(int32_t continentID, const C3Vector& position) {
|
|
||||||
// TODO
|
|
||||||
CGGameUI::InitializeGame();
|
|
||||||
|
|
||||||
ClientServices::SetMessageHandler(SMSG_NEW_WORLD, &NewWorldHandler, nullptr);
|
|
||||||
ClientServices::SetMessageHandler(SMSG_LOGIN_VERIFY_WORLD, &LoginVerifyWorldHandler, nullptr);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#define CLIENT_CLIENT_HPP
|
#define CLIENT_CLIENT_HPP
|
||||||
|
|
||||||
#include "event/Event.hpp"
|
#include "event/Event.hpp"
|
||||||
#include "tempest/Vector.hpp"
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class CVar;
|
class CVar;
|
||||||
@ -28,6 +27,4 @@ void StormInitialize();
|
|||||||
|
|
||||||
void WowClientInit();
|
void WowClientInit();
|
||||||
|
|
||||||
void ClientInitializeGame(int32_t continentID, const C3Vector& position);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
#include "client/ClientHandlers.hpp"
|
|
||||||
|
|
||||||
#include <storm/Error.hpp>
|
|
||||||
#include <common/DataStore.hpp>
|
|
||||||
|
|
||||||
#include "console/Line.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t s_newZoneID = 0;
|
|
||||||
C3Vector s_newPosition;
|
|
||||||
float s_newFacing = 0.0f;
|
|
||||||
const char* s_newMapname = nullptr;
|
|
||||||
|
|
||||||
|
|
||||||
int32_t NewWorldHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
|
||||||
STORM_ASSERT(msgId == SMSG_NEW_WORLD);
|
|
||||||
|
|
||||||
msg->Get(s_newZoneID);
|
|
||||||
msg->Get(s_newPosition.x);
|
|
||||||
msg->Get(s_newPosition.y);
|
|
||||||
msg->Get(s_newPosition.z);
|
|
||||||
msg->Get(s_newFacing);
|
|
||||||
|
|
||||||
if (msg->IsRead()) {
|
|
||||||
// TODO
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
ConsoleWrite("Bad SMSG_NEW_WORLD\n", DEFAULT_COLOR);
|
|
||||||
msg->Reset();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t LoginVerifyWorldHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
|
||||||
STORM_ASSERT(msgId == SMSG_LOGIN_VERIFY_WORLD);
|
|
||||||
|
|
||||||
uint32_t zoneID;
|
|
||||||
msg->Get(zoneID);
|
|
||||||
|
|
||||||
C3Vector position;
|
|
||||||
msg->Get(position.x);
|
|
||||||
msg->Get(position.y);
|
|
||||||
msg->Get(position.z);
|
|
||||||
|
|
||||||
float facing;
|
|
||||||
msg->Get(facing);
|
|
||||||
// zoneID != ClntObjMgrGetMapID()
|
|
||||||
if (false) {
|
|
||||||
s_newFacing = facing;
|
|
||||||
s_newPosition = position;
|
|
||||||
s_newZoneID = zoneID;
|
|
||||||
//if (zoneID < dword_AD4170 || zoneID > dword_AD416C || (v0 = *(_DWORD*)(dword_AD4180 + 4 * (zoneID - dword_AD4170))) == 0) {
|
|
||||||
// ConsoleWrite("Bad SMSG_NEW_WORLD zoneID\n", 0);
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
//s_newMapname = *(_DWORD*)(v0 + 4);
|
|
||||||
//LoadNewWorld(0, 0);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef CLIENT_CLIENTHANDLERS_HPP
|
|
||||||
#define CLIENT_CLIENTHANDLERS_HPP
|
|
||||||
|
|
||||||
#include "net/Types.hpp"
|
|
||||||
|
|
||||||
class CDataStore;
|
|
||||||
|
|
||||||
|
|
||||||
int32_t NewWorldHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
|
||||||
int32_t LoginVerifyWorldHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CLIENT_CLIENTHANDLERS_HPP
|
|
@ -65,12 +65,6 @@ ClientServices* ClientServices::GetInstance() {
|
|||||||
|
|
||||||
return ClientServices::s_instance;
|
return ClientServices::s_instance;
|
||||||
}
|
}
|
||||||
void ClientServices::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param) {
|
|
||||||
STORM_ASSERT(ClientServices::s_currentConnection);
|
|
||||||
STORM_ASSERT(handler);
|
|
||||||
s_currentConnection->SetMessageHandler(msgId, handler, param);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ClientServices::GetRealmList() {
|
void ClientServices::GetRealmList() {
|
||||||
// TODO
|
// TODO
|
||||||
@ -80,10 +74,6 @@ void ClientServices::GetCharacterList() {
|
|||||||
ClientServices::s_currentConnection->GetCharacterList();
|
ClientServices::s_currentConnection->GetCharacterList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientServices::CharacterLogin(uint64_t id, const C3Vector& position) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
REALM_INFO* ClientServices::GetRealmInfoByIndex(int32_t index) {
|
REALM_INFO* ClientServices::GetRealmInfoByIndex(int32_t index) {
|
||||||
if (index >= ClientServices::GetInstance()->m_realmList.Count()) {
|
if (index >= ClientServices::GetInstance()->m_realmList.Count()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#define CLIENT_CLIENT_SERVICES_HPP
|
#define CLIENT_CLIENT_SERVICES_HPP
|
||||||
|
|
||||||
#include "net/login/LoginResponse.hpp"
|
#include "net/login/LoginResponse.hpp"
|
||||||
#include "net/connection/NetClient.hpp"
|
|
||||||
#include "tempest/Vector.hpp"
|
|
||||||
|
|
||||||
class ClientConnection;
|
class ClientConnection;
|
||||||
class CVar;
|
class CVar;
|
||||||
@ -35,10 +33,8 @@ class ClientServices : public LoginResponse {
|
|||||||
static void ConnectToSelectedServer();
|
static void ConnectToSelectedServer();
|
||||||
static ClientConnection* Connection();
|
static ClientConnection* Connection();
|
||||||
static ClientServices* GetInstance();
|
static ClientServices* GetInstance();
|
||||||
static void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);
|
|
||||||
static void GetRealmList();
|
static void GetRealmList();
|
||||||
static void GetCharacterList();
|
static void GetCharacterList();
|
||||||
static void CharacterLogin(uint64_t id, const C3Vector& position);
|
|
||||||
static REALM_INFO* GetRealmInfoByIndex(int32_t index);
|
static REALM_INFO* GetRealmInfoByIndex(int32_t index);
|
||||||
static const char* GetSelectedRealmName();
|
static const char* GetSelectedRealmName();
|
||||||
static const REALM_INFO* GetSelectedRealm();
|
static const REALM_INFO* GetSelectedRealm();
|
||||||
|
@ -77,8 +77,6 @@ int32_t CGlueMgr::m_surveyDownload;
|
|||||||
int32_t CGlueMgr::m_patchDownload;
|
int32_t CGlueMgr::m_patchDownload;
|
||||||
bool CGlueMgr::m_deleteLocalPatch;
|
bool CGlueMgr::m_deleteLocalPatch;
|
||||||
|
|
||||||
CHARACTER_INFO* CGlueMgr::m_characterInfo = nullptr;
|
|
||||||
|
|
||||||
|
|
||||||
float CalculateAspectRatio() {
|
float CalculateAspectRatio() {
|
||||||
auto widescreenVar = CVar::Lookup("widescreen");
|
auto widescreenVar = CVar::Lookup("widescreen");
|
||||||
@ -302,11 +300,6 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IDLE_ENTER_WORLD: {
|
|
||||||
CGlueMgr::PollEnterWorld();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDLE_12: {
|
case IDLE_12: {
|
||||||
if (CGlueMgr::m_patchDownload) {
|
if (CGlueMgr::m_patchDownload) {
|
||||||
CGlueMgr::PatchDownloadIdle();
|
CGlueMgr::PatchDownloadIdle();
|
||||||
@ -418,20 +411,6 @@ void CGlueMgr::QuitGame() {
|
|||||||
ClientPostClose(0);
|
ClientPostClose(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGlueMgr::EnterWorld() {
|
|
||||||
// TODO: Proper implementation
|
|
||||||
if (CCharacterSelection::GetNumCharacters() < 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CGlueMgr::m_characterInfo = &CCharacterSelection::s_characterList[0].m_characterInfo;
|
|
||||||
if (!m_characterInfo || !ClientServices::Connection()->IsConnected()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGlueMgr::m_idleState = IDLE_ENTER_WORLD;
|
|
||||||
CGlueMgr::m_showedDisconnect = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op) {
|
void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op) {
|
||||||
auto login = ClientServices::LoginConnection();
|
auto login = ClientServices::LoginConnection();
|
||||||
|
|
||||||
@ -841,9 +820,9 @@ void CGlueMgr::StatusDialogClick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case IDLE_REALM_LIST:
|
case IDLE_REALM_LIST:
|
||||||
case IDLE_CREATE_CHARACTER:
|
case IDLE_5:
|
||||||
case IDLE_DELETE_CHARACTER:
|
case IDLE_6:
|
||||||
case IDLE_ENTER_WORLD: {
|
case IDLE_10: {
|
||||||
ClientServices::Connection()->Cancel(2);
|
ClientServices::Connection()->Cancel(2);
|
||||||
|
|
||||||
CGlueMgr::m_showedDisconnect = 0;
|
CGlueMgr::m_showedDisconnect = 0;
|
||||||
@ -920,29 +899,6 @@ bool CGlueMgr::HandleBattlenetDisconnect() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGlueMgr::PollEnterWorld() {
|
|
||||||
//if (!LoadingScreenDrawing())
|
|
||||||
// return;
|
|
||||||
|
|
||||||
if (CGlueMgr::m_suspended) {
|
|
||||||
CGlueMgr::m_idleState = IDLE_NONE;
|
|
||||||
CGlueMgr::m_showedDisconnect = 0;
|
|
||||||
//SI3::StopGlueMusic(3.0);
|
|
||||||
//SI3::StopGlueAmbience(-1.0);
|
|
||||||
ClientServices::CharacterLogin(CGlueMgr::m_characterInfo->guid, C3Vector());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto info = CGlueMgr::m_characterInfo;
|
|
||||||
|
|
||||||
//if (*(_BYTE*)(info + 385))
|
|
||||||
// sub_4D9660(*(_BYTE*)(info + 377), (int)v51, *(_BYTE*)(info + 376), (int)&v68);
|
|
||||||
|
|
||||||
|
|
||||||
CGlueMgr::Suspend();
|
|
||||||
ClientInitializeGame(info->mapID, info->position);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGlueMgr::SurveyDownloadStart() {
|
void CGlueMgr::SurveyDownloadStart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ class CGlueMgr {
|
|||||||
IDLE_ACCOUNT_LOGIN = 2,
|
IDLE_ACCOUNT_LOGIN = 2,
|
||||||
IDLE_CHARACTER_LIST = 3,
|
IDLE_CHARACTER_LIST = 3,
|
||||||
IDLE_REALM_LIST = 4,
|
IDLE_REALM_LIST = 4,
|
||||||
IDLE_CREATE_CHARACTER = 5,
|
IDLE_5 = 5,
|
||||||
IDLE_DELETE_CHARACTER = 6,
|
IDLE_6 = 6,
|
||||||
IDLE_7 = 7,
|
IDLE_7 = 7,
|
||||||
IDLE_8 = 8,
|
IDLE_8 = 8,
|
||||||
IDLE_9 = 9,
|
IDLE_9 = 9,
|
||||||
IDLE_ENTER_WORLD = 10,
|
IDLE_10 = 10,
|
||||||
IDLE_WORLD_LOGIN = 11,
|
IDLE_WORLD_LOGIN = 11,
|
||||||
IDLE_12 = 12,
|
IDLE_12 = 12,
|
||||||
IDLE_13 = 13
|
IDLE_13 = 13
|
||||||
@ -69,8 +69,6 @@ class CGlueMgr {
|
|||||||
static int32_t m_patchDownload;
|
static int32_t m_patchDownload;
|
||||||
static bool m_deleteLocalPatch;
|
static bool m_deleteLocalPatch;
|
||||||
|
|
||||||
static CHARACTER_INFO* m_characterInfo;
|
|
||||||
|
|
||||||
// Static functions
|
// Static functions
|
||||||
static void ChangeRealm(const REALM_INFO* realmInfo);
|
static void ChangeRealm(const REALM_INFO* realmInfo);
|
||||||
static void DisplayLoginStatus();
|
static void DisplayLoginStatus();
|
||||||
@ -83,7 +81,6 @@ class CGlueMgr {
|
|||||||
static void InitCursor();
|
static void InitCursor();
|
||||||
static void LoginServerLogin(const char* accountName, const char* password);
|
static void LoginServerLogin(const char* accountName, const char* password);
|
||||||
static void QuitGame();
|
static void QuitGame();
|
||||||
static void EnterWorld();
|
|
||||||
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
||||||
static void PollLoginServerLogin();
|
static void PollLoginServerLogin();
|
||||||
static void PollCharacterList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
static void PollCharacterList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
||||||
@ -98,8 +95,6 @@ class CGlueMgr {
|
|||||||
static void UpdateCurrentScreen(const char* screen);
|
static void UpdateCurrentScreen(const char* screen);
|
||||||
static bool HandleBattlenetDisconnect();
|
static bool HandleBattlenetDisconnect();
|
||||||
|
|
||||||
static void PollEnterWorld();
|
|
||||||
|
|
||||||
// Survey Download System
|
// Survey Download System
|
||||||
static void SurveyDownloadStart();
|
static void SurveyDownloadStart();
|
||||||
static void SurveyDownloadCancel();
|
static void SurveyDownloadCancel();
|
||||||
|
@ -141,15 +141,6 @@ void ClientConnection::GetCharacterList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientConnection::CharacterLogin(uint64_t id) {
|
|
||||||
this->Initiate(COP_LOGIN_CHARACTER, 76, nullptr);
|
|
||||||
if (this->m_connected) {
|
|
||||||
this->RequestCharacterLogin(id);
|
|
||||||
} else {
|
|
||||||
this->Cancel(4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClientConnection::Cancel(int32_t errorCode) {
|
void ClientConnection::Cancel(int32_t errorCode) {
|
||||||
this->Complete(0, errorCode);
|
this->Complete(0, errorCode);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ class ClientConnection : public RealmConnection {
|
|||||||
void AccountLogin_Finish(int32_t authResult);
|
void AccountLogin_Finish(int32_t authResult);
|
||||||
void AccountLogin_Queued();
|
void AccountLogin_Queued();
|
||||||
void GetCharacterList();
|
void GetCharacterList();
|
||||||
void CharacterLogin(uint64_t id);
|
|
||||||
void Cancel(int32_t errorCode);
|
void Cancel(int32_t errorCode);
|
||||||
void Cleanup();
|
void Cleanup();
|
||||||
void Connect();
|
void Connect();
|
||||||
|
@ -282,11 +282,3 @@ void RealmConnection::RequestCharacterEnum() {
|
|||||||
msg.Finalize();
|
msg.Finalize();
|
||||||
this->Send(&msg);
|
this->Send(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RealmConnection::RequestCharacterLogin(uint64_t id) {
|
|
||||||
CDataStore msg;
|
|
||||||
msg.Put(static_cast<uint32_t>(CMSG_PLAYER_LOGIN));
|
|
||||||
msg.Put(id);
|
|
||||||
msg.Finalize();
|
|
||||||
this->Send(&msg);
|
|
||||||
}
|
|
||||||
|
@ -43,7 +43,6 @@ class RealmConnection : public NetClient {
|
|||||||
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
void SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4);
|
void SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4);
|
||||||
void RequestCharacterEnum();
|
void RequestCharacterEnum();
|
||||||
void RequestCharacterLogin(uint64_t id);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -294,8 +294,7 @@ int32_t Script_IsConnectedToServer(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_EnterWorld(lua_State* L) {
|
int32_t Script_EnterWorld(lua_State* L) {
|
||||||
CGlueMgr::EnterWorld();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_Screenshot(lua_State* L) {
|
int32_t Script_Screenshot(lua_State* L) {
|
||||||
|
Loading…
Reference in New Issue
Block a user