From eee2986220949f43c01409bcc264862d9aa1bcc0 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 5 Jan 2026 22:49:58 -0600 Subject: [PATCH] feat(object): add ClntObjMgrInitializeStd --- src/client/Client.cpp | 5 +++++ src/object/client/ObjMgr.cpp | 22 ++++++++++++++++++++++ src/object/client/ObjMgr.hpp | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index b2c50be..a243c64 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -14,6 +14,7 @@ #include "gx/Texture.hpp" #include "model/Model2.hpp" #include "net/Poll.hpp" +#include "object/Client.hpp" #include "sound/Interface.hpp" #include "ui/FrameScript.hpp" #include "ui/FrameXML.hpp" @@ -79,6 +80,10 @@ int32_t ClientIdle(const void* data, void* param) { void ClientInitializeGame(uint32_t mapId, C3Vector position) { // TODO + ClntObjMgrInitializeStd(mapId); + + // TODO + EventRegister(EVENT_ID_IDLE, ClientIdle); // TODO diff --git a/src/object/client/ObjMgr.cpp b/src/object/client/ObjMgr.cpp index 7824950..754ac9b 100644 --- a/src/object/client/ObjMgr.cpp +++ b/src/object/client/ObjMgr.cpp @@ -1,4 +1,7 @@ #include "object/client/ObjMgr.hpp" +#include "client/ClientServices.hpp" +#include "net/Connection.hpp" +#include #if defined(WHOA_SYSTEM_WIN) static thread_local ClntObjMgr* s_curMgr; @@ -16,6 +19,21 @@ uint32_t ClntObjMgrGetMapID() { return s_curMgr->m_mapID; } +void ClntObjMgrInitializeStd(uint32_t mapID) { + // TODO last instance time + + auto mgr = STORM_NEW(ClntObjMgr); + + g_clientConnection->SetObjMgr(mgr); + mgr->m_net = g_clientConnection; + + s_curMgr = mgr; + + ClntObjMgrSetHandlers(); + + mgr->m_mapID = mapID; +} + void ClntObjMgrPop() { if (!s_savMgr) { return; @@ -33,3 +51,7 @@ void ClntObjMgrPush(ClntObjMgr* mgr) { s_savMgr = s_curMgr; s_curMgr = mgr; } + +void ClntObjMgrSetHandlers() { + // TODO +} diff --git a/src/object/client/ObjMgr.hpp b/src/object/client/ObjMgr.hpp index db38b0d..b401f86 100644 --- a/src/object/client/ObjMgr.hpp +++ b/src/object/client/ObjMgr.hpp @@ -6,8 +6,12 @@ uint32_t ClntObjMgrGetMapID(); +void ClntObjMgrInitializeStd(uint32_t mapID); + void ClntObjMgrPop(); void ClntObjMgrPush(ClntObjMgr* mgr); +void ClntObjMgrSetHandlers(); + #endif