feat(client): add ClientInitializeGameTime

This commit is contained in:
fallenoak 2026-01-29 07:52:43 -06:00
parent 50a24e8564
commit 6e7c267d3e
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 42 additions and 0 deletions

View File

@ -80,6 +80,16 @@ int32_t ClientGameTimeTickHandler(const void* data, void* param) {
return 1; return 1;
} }
void ClientInitializeGameTime() {
ClientServices::SetMessageHandler(SMSG_GAME_SPEED_SET, &ReceiveNewGameSpeed, nullptr);
ClientServices::SetMessageHandler(SMSG_LOGIN_SET_TIME_SPEED, &ReceiveNewTimeSpeed, nullptr);
ClientServices::SetMessageHandler(SMSG_GAME_TIME_UPDATE, &ReceiveGameTimeUpdate, nullptr);
ClientServices::SetMessageHandler(SMSG_SERVERTIME, &ReceiveServerTime, nullptr);
ClientServices::SetMessageHandler(SMSG_GAME_TIME_SET, &ReceiveNewGameTime, nullptr);
// TODO initialize s_forcedChangeCallbacks
}
int32_t ClientIdle(const void* data, void* param) { int32_t ClientIdle(const void* data, void* param) {
ClientGameTimeTickHandler(data, nullptr); ClientGameTimeTickHandler(data, nullptr);
@ -101,6 +111,7 @@ void ClientInitializeGame(uint32_t mapId, C3Vector position) {
// TODO // TODO
EventRegister(EVENT_ID_IDLE, ClientIdle); EventRegister(EVENT_ID_IDLE, ClientIdle);
ClientInitializeGameTime();
// TODO // TODO

View File

@ -2,6 +2,7 @@
#include "console/Console.hpp" #include "console/Console.hpp"
#include "db/Db.hpp" #include "db/Db.hpp"
#include "object/Client.hpp" #include "object/Client.hpp"
#include "util/Unimplemented.hpp"
#include "world/World.hpp" #include "world/World.hpp"
#include <common/DataStore.hpp> #include <common/DataStore.hpp>
#include <tempest/Vector.hpp> #include <tempest/Vector.hpp>
@ -77,6 +78,26 @@ int32_t PlayedTimeHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataSto
return 0; return 0;
} }
int32_t ReceiveGameTimeUpdate(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
WHOA_UNIMPLEMENTED(0);
}
int32_t ReceiveNewGameSpeed(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
WHOA_UNIMPLEMENTED(0);
}
int32_t ReceiveNewGameTime(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
WHOA_UNIMPLEMENTED(0);
}
int32_t ReceiveNewTimeSpeed(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
WHOA_UNIMPLEMENTED(0);
}
int32_t ReceiveServerTime(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
WHOA_UNIMPLEMENTED(0);
}
int32_t TransferAbortedHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) { int32_t TransferAbortedHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
// TODO // TODO

View File

@ -14,6 +14,16 @@ int32_t NotifyHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore*
int32_t PlayedTimeHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg); int32_t PlayedTimeHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t ReceiveGameTimeUpdate(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t ReceiveNewGameSpeed(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t ReceiveNewGameTime(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t ReceiveNewTimeSpeed(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t ReceiveServerTime(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t TransferAbortedHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg); int32_t TransferAbortedHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
int32_t TransferPendingHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg); int32_t TransferPendingHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);