diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-15 05:06:36 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-15 05:06:36 +0000 |
commit | 57c269f6f2202ca396bcbf9b6e8fffcd93e4db7c (patch) | |
tree | c5a30ae171a14abca5ae8f80c0c2757d429a83f3 /NorthstarDedicatedTest | |
parent | 3492008d7b55f342ea2d7191ca2301d7597c5127 (diff) | |
download | NorthstarLauncher-57c269f6f2202ca396bcbf9b6e8fffcd93e4db7c.tar.gz NorthstarLauncher-57c269f6f2202ca396bcbf9b6e8fffcd93e4db7c.zip |
dedi ShowWindow patch
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r-- | NorthstarDedicatedTest/dedicated.cpp | 18 | ||||
-rw-r--r-- | NorthstarDedicatedTest/masterserver.cpp | 1 | ||||
-rw-r--r-- | NorthstarDedicatedTest/playlist.cpp | 15 |
3 files changed, 19 insertions, 15 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp index 4c263d0c..f7b6f325 100644 --- a/NorthstarDedicatedTest/dedicated.cpp +++ b/NorthstarDedicatedTest/dedicated.cpp @@ -437,6 +437,24 @@ void InitialiseDedicated(HMODULE engineAddress) CommandLine()->AppendParm("-noshaderapi", 0); } + else + { + // for dedis where we still create a window, we can at least hide the window we create + // not great since we still run renderthread etc, but better than nothing + + { + // IVideoMode::CreateGameWindow + char* ptr = (char*)engineAddress + 0x1CD146; + TempReadWrite rw(ptr); + + // nop call to ShowWindow + *ptr = (char)0x90; + *(ptr + 1) = (char)0x90; + *(ptr + 2) = (char)0x90; + *(ptr + 3) = (char)0x90; + *(ptr + 4) = (char)0x90; + } + } CDedicatedExports* dedicatedExports = new CDedicatedExports; dedicatedExports->vtable = dedicatedExports; diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp index 4798a9b5..ce078633 100644 --- a/NorthstarDedicatedTest/masterserver.cpp +++ b/NorthstarDedicatedTest/masterserver.cpp @@ -641,6 +641,7 @@ void MasterServerManager::AddSelfToServerList(int port, int authPort, char* name // heartbeat thread + // ideally this should actually be done in main thread, rather than on it's own thread, so it'd stop if server freezes std::thread heartbeatThread([this] { httplib::Client http(Cvar_ns_masterserver_hostname->m_pszString, Cvar_ns_masterserver_port->m_nValue); http.set_connection_timeout(10); diff --git a/NorthstarDedicatedTest/playlist.cpp b/NorthstarDedicatedTest/playlist.cpp index 20c76cb0..6339d3ba 100644 --- a/NorthstarDedicatedTest/playlist.cpp +++ b/NorthstarDedicatedTest/playlist.cpp @@ -47,19 +47,4 @@ void InitialisePlaylistHooks(HMODULE baseAddress) TempReadWrite rw(ptr); *((char*)ptr) = 0xC3; // jmp => ret } - - // on dedicated servers, force SetPlaylistVarOverride to always set the server's override list, irregardless of whether server is running yet - if (IsDedicated()) - { - // SetPlaylistVarOverride - void* ptr = (char*)baseAddress + 0x18ED17; - TempReadWrite rw(ptr); - - *((char*)ptr) = 0x90; // jl => nop - *((char*)ptr + 1) = 0x90; - *((char*)ptr + 2) = 0x90; - *((char*)ptr + 3) = 0x90; - *((char*)ptr + 4) = 0x90; - *((char*)ptr + 5) = 0x90; - } }
\ No newline at end of file |