From 55b708c9feb57735e1c1ce20f3a4760b8772b3c7 Mon Sep 17 00:00:00 2001 From: IcePixelx <41352111+PixieCore@users.noreply.github.com> Date: Mon, 17 Jan 2022 03:41:27 +0100 Subject: [PATCH] Comment regarding persistence and hardcoded variables. --- r5dev/ebisusdk/EbisuSDK.cpp | 2 ++ r5dev/launcher/IApplication.cpp | 5 +++-- r5dev/server/IVEngineServer.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/r5dev/ebisusdk/EbisuSDK.cpp b/r5dev/ebisusdk/EbisuSDK.cpp index b361d25b..fdf0ac82 100644 --- a/r5dev/ebisusdk/EbisuSDK.cpp +++ b/r5dev/ebisusdk/EbisuSDK.cpp @@ -9,6 +9,8 @@ void HEbisuSDK_Init() { #ifdef DEDICATED + // TODO: Don't hardcode! + // Also add cross-season support? *(char*)g_bEbisuSDKInitialized = (char)0x1; // <- 1st EbisuSDK *(char*)g_bEbisuSDKCvarInitialized = (char)0x1; // <- 2nd EbisuSDK *(char*)g_qEbisuSDKCvarInitialized = (char)0x1; // <- 3rd EbisuSDK diff --git a/r5dev/launcher/IApplication.cpp b/r5dev/launcher/IApplication.cpp index e545e12d..ddeae038 100644 --- a/r5dev/launcher/IApplication.cpp +++ b/r5dev/launcher/IApplication.cpp @@ -3,7 +3,7 @@ #include "ebisusdk/EbisuSDK.h" //----------------------------------------------------------------------------- -// Purpose: +// Purpose: //----------------------------------------------------------------------------- void* HIApplication_Main(void* a1, void* a2) { @@ -12,12 +12,13 @@ void* HIApplication_Main(void* a1, void* a2) } //----------------------------------------------------------------------------- -// Purpose: +// Purpose: //----------------------------------------------------------------------------- bool HIApplication_Create(void* a1) { #ifdef DEDICATED // TODO: Don't hardcode! + // Also add cross-season support? * (uintptr_t*)0x162C61208 = 0x1; // g_bDedicated #endif // DEDICATED return IAppSystem_Create(a1); diff --git a/r5dev/server/IVEngineServer.cpp b/r5dev/server/IVEngineServer.cpp index ef250cae..296aa29f 100644 --- a/r5dev/server/IVEngineServer.cpp +++ b/r5dev/server/IVEngineServer.cpp @@ -15,6 +15,14 @@ //----------------------------------------------------------------------------- bool HIVEngineServer_PersistenceAvailable(void* entidx, int clientidx) { + /* I don't know if permanently setting persistence to ready is a solution + * We might wanna re-think that and handle persistence properly by also removing it on client disconnect. + * Doing it for when we kick someone or ban someone is already a good start. Though we need to figure out how to handle timeouts? + * Maybe NetChan::Shutdown gets called then anyway. + * Then we might need to check ReturnAddress to make sure its not a local disconnect due to local server usage. + * A lot of things to be considered.. + * - Pix + */ CClient* pClient = g_pClient->GetClientInstance(clientidx); // Get client instance. *(char*)((std::uintptr_t)pClient + g_dwPersistenceVar) = (char)0x5; // Set the client instance to 'ready'.