diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-12-28 14:51:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 14:51:45 +0000 |
commit | 3b63cf5c83b9f68952195e62e202dd557f7ca6af (patch) | |
tree | bd977e3f566a635ab4c734f2c12621614d44ce83 | |
parent | 0b507aa3eb55c2d06f314a46998cf9415f6a064a (diff) | |
parent | f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287 (diff) | |
download | NorthstarLauncher-3b63cf5c83b9f68952195e62e202dd557f7ca6af.tar.gz NorthstarLauncher-3b63cf5c83b9f68952195e62e202dd557f7ca6af.zip |
Merge branch 'main' into cmake-format
-rw-r--r-- | .clang-format | 1 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 10 | ||||
-rw-r--r-- | .github/workflows/merge-conflict-auto-label.yml | 16 | ||||
-rw-r--r-- | .github/workflows/release.yml | 6 | ||||
-rw-r--r-- | .gitmodules | 6 | ||||
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | NorthstarDLL/client/r2client.h | 11 | ||||
-rw-r--r-- | NorthstarDLL/core/tier0.cpp | 36 | ||||
-rw-r--r-- | NorthstarDLL/core/tier0.h | 68 | ||||
-rw-r--r-- | NorthstarDLL/engine/hoststate.h | 45 | ||||
-rw-r--r-- | NorthstarDLL/engine/r2engine.h | 264 | ||||
-rw-r--r-- | NorthstarDLL/server/r2server.h | 110 | ||||
-rw-r--r-- | NorthstarDLL/shared/maxplayers.h | 7 | ||||
-rw-r--r-- | NorthstarDLL/util/utils.h | 6 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | cmake/Findminhook.cmake | 8 | ||||
-rw-r--r-- | cmake/Findspdlog.cmake | 8 | ||||
-rw-r--r-- | primedev/CMakeLists.txt | 3 | ||||
-rw-r--r-- | primedev/Launcher.cmake (renamed from NorthstarLauncher/CMakeLists.txt) | 4 | ||||
-rw-r--r-- | primedev/Northstar.cmake (renamed from NorthstarDLL/CMakeLists.txt) | 5 | ||||
-rw-r--r-- | primedev/WSockProxy.cmake (renamed from loader_wsock32_proxy/CMakeLists.txt) | 12 | ||||
-rw-r--r-- | primedev/client/audio.cpp (renamed from NorthstarDLL/client/audio.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/audio.h (renamed from NorthstarDLL/client/audio.h) | 6 | ||||
-rw-r--r-- | primedev/client/chatcommand.cpp (renamed from NorthstarDLL/client/chatcommand.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/clientauthhooks.cpp (renamed from NorthstarDLL/client/clientauthhooks.cpp) | 4 | ||||
-rw-r--r-- | primedev/client/clientruihooks.cpp (renamed from NorthstarDLL/client/clientruihooks.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/clientvideooverrides.cpp (renamed from NorthstarDLL/client/clientvideooverrides.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/debugoverlay.cpp (renamed from NorthstarDLL/client/debugoverlay.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/demofixes.cpp (renamed from NorthstarDLL/client/demofixes.cpp) | 6 | ||||
-rw-r--r-- | primedev/client/diskvmtfixes.cpp (renamed from NorthstarDLL/client/diskvmtfixes.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/languagehooks.cpp (renamed from NorthstarDLL/client/languagehooks.cpp) | 2 | ||||
-rw-r--r-- | primedev/client/latencyflex.cpp (renamed from NorthstarDLL/client/latencyflex.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/localchatwriter.cpp (renamed from NorthstarDLL/client/localchatwriter.cpp) | 12 | ||||
-rw-r--r-- | primedev/client/localchatwriter.h (renamed from NorthstarDLL/client/localchatwriter.h) | 6 | ||||
-rw-r--r-- | primedev/client/modlocalisation.cpp (renamed from NorthstarDLL/client/modlocalisation.cpp) | 0 | ||||
-rw-r--r-- | primedev/client/r2client.cpp (renamed from NorthstarDLL/client/r2client.cpp) | 12 | ||||
-rw-r--r-- | primedev/client/r2client.h | 7 | ||||
-rw-r--r-- | primedev/client/rejectconnectionfixes.cpp (renamed from NorthstarDLL/client/rejectconnectionfixes.cpp) | 2 | ||||
-rw-r--r-- | primedev/cmake/Findlibcurl.cmake (renamed from cmake/Findlibcurl.cmake) | 4 | ||||
-rw-r--r-- | primedev/cmake/Findminhook.cmake | 7 | ||||
-rw-r--r-- | primedev/cmake/Findminizip.cmake (renamed from cmake/Findminizip.cmake) | 4 | ||||
-rw-r--r-- | primedev/cmake/Findspdlog.cmake | 7 | ||||
-rw-r--r-- | primedev/cmake/utils.cmake (renamed from cmake/utils.cmake) | 0 | ||||
-rw-r--r-- | primedev/config/profile.cpp (renamed from NorthstarDLL/config/profile.cpp) | 0 | ||||
-rw-r--r-- | primedev/config/profile.h (renamed from NorthstarDLL/config/profile.h) | 0 | ||||
-rw-r--r-- | primedev/core/convar/concommand.cpp (renamed from NorthstarDLL/core/convar/concommand.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/convar/concommand.h (renamed from NorthstarDLL/core/convar/concommand.h) | 10 | ||||
-rw-r--r-- | primedev/core/convar/convar.cpp (renamed from NorthstarDLL/core/convar/convar.cpp) | 6 | ||||
-rw-r--r-- | primedev/core/convar/convar.h (renamed from NorthstarDLL/core/convar/convar.h) | 2 | ||||
-rw-r--r-- | primedev/core/convar/cvar.cpp (renamed from NorthstarDLL/core/convar/cvar.cpp) | 8 | ||||
-rw-r--r-- | primedev/core/convar/cvar.h (renamed from NorthstarDLL/core/convar/cvar.h) | 12 | ||||
-rw-r--r-- | primedev/core/filesystem/filesystem.cpp (renamed from NorthstarDLL/core/filesystem/filesystem.cpp) | 54 | ||||
-rw-r--r-- | primedev/core/filesystem/filesystem.h (renamed from NorthstarDLL/core/filesystem/filesystem.h) | 14 | ||||
-rw-r--r-- | primedev/core/filesystem/rpakfilesystem.cpp (renamed from NorthstarDLL/core/filesystem/rpakfilesystem.cpp) | 4 | ||||
-rw-r--r-- | primedev/core/filesystem/rpakfilesystem.h (renamed from NorthstarDLL/core/filesystem/rpakfilesystem.h) | 4 | ||||
-rw-r--r-- | primedev/core/hooks.cpp (renamed from NorthstarDLL/core/hooks.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/hooks.h (renamed from NorthstarDLL/core/hooks.h) | 16 | ||||
-rw-r--r-- | primedev/core/macros.h (renamed from NorthstarDLL/core/macros.h) | 0 | ||||
-rw-r--r-- | primedev/core/math/bitbuf.h (renamed from NorthstarDLL/core/math/bitbuf.h) | 20 | ||||
-rw-r--r-- | primedev/core/math/bits.cpp (renamed from NorthstarDLL/core/math/bits.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/math/bits.h (renamed from NorthstarDLL/core/math/bits.h) | 0 | ||||
-rw-r--r-- | primedev/core/math/color.cpp (renamed from NorthstarDLL/core/math/color.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/math/color.h (renamed from NorthstarDLL/core/math/color.h) | 4 | ||||
-rw-r--r-- | primedev/core/math/vector.h (renamed from NorthstarDLL/core/math/vector.h) | 0 | ||||
-rw-r--r-- | primedev/core/memalloc.cpp (renamed from NorthstarDLL/core/memalloc.cpp) | 2 | ||||
-rw-r--r-- | primedev/core/memalloc.h (renamed from NorthstarDLL/core/memalloc.h) | 2 | ||||
-rw-r--r-- | primedev/core/memory.cpp (renamed from NorthstarDLL/core/memory.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/memory.h (renamed from NorthstarDLL/core/memory.h) | 10 | ||||
-rw-r--r-- | primedev/core/sourceinterface.cpp (renamed from NorthstarDLL/core/sourceinterface.cpp) | 0 | ||||
-rw-r--r-- | primedev/core/sourceinterface.h (renamed from NorthstarDLL/core/sourceinterface.h) | 4 | ||||
-rw-r--r-- | primedev/core/structs.h (renamed from NorthstarDLL/core/structs.h) | 0 | ||||
-rw-r--r-- | primedev/core/tier0.cpp | 30 | ||||
-rw-r--r-- | primedev/core/tier0.h | 63 | ||||
-rw-r--r-- | primedev/core/vanilla.h (renamed from NorthstarDLL/core/vanilla.h) | 4 | ||||
-rw-r--r-- | primedev/dedicated/dedicated.cpp (renamed from NorthstarDLL/dedicated/dedicated.cpp) | 32 | ||||
-rw-r--r-- | primedev/dedicated/dedicated.h (renamed from NorthstarDLL/dedicated/dedicated.h) | 0 | ||||
-rw-r--r-- | primedev/dedicated/dedicatedlogtoclient.cpp (renamed from NorthstarDLL/dedicated/dedicatedlogtoclient.cpp) | 14 | ||||
-rw-r--r-- | primedev/dedicated/dedicatedlogtoclient.h (renamed from NorthstarDLL/dedicated/dedicatedlogtoclient.h) | 2 | ||||
-rw-r--r-- | primedev/dedicated/dedicatedmaterialsystem.cpp (renamed from NorthstarDLL/dedicated/dedicatedmaterialsystem.cpp) | 2 | ||||
-rw-r--r-- | primedev/dllmain.cpp (renamed from NorthstarDLL/dllmain.cpp) | 0 | ||||
-rw-r--r-- | primedev/dllmain.h (renamed from NorthstarDLL/dllmain.h) | 0 | ||||
-rw-r--r-- | primedev/engine/host.cpp (renamed from NorthstarDLL/engine/host.cpp) | 4 | ||||
-rw-r--r-- | primedev/engine/hoststate.cpp (renamed from NorthstarDLL/engine/hoststate.cpp) | 33 | ||||
-rw-r--r-- | primedev/engine/hoststate.h | 41 | ||||
-rw-r--r-- | primedev/engine/r2engine.cpp (renamed from NorthstarDLL/engine/r2engine.cpp) | 30 | ||||
-rw-r--r-- | primedev/engine/r2engine.h | 260 | ||||
-rw-r--r-- | primedev/engine/runframe.cpp (renamed from NorthstarDLL/engine/runframe.cpp) | 2 | ||||
-rw-r--r-- | primedev/logging/crashhandler.cpp (renamed from NorthstarDLL/logging/crashhandler.cpp) | 0 | ||||
-rw-r--r-- | primedev/logging/crashhandler.h (renamed from NorthstarDLL/logging/crashhandler.h) | 4 | ||||
-rw-r--r-- | primedev/logging/logging.cpp (renamed from NorthstarDLL/logging/logging.cpp) | 0 | ||||
-rw-r--r-- | primedev/logging/logging.h (renamed from NorthstarDLL/logging/logging.h) | 10 | ||||
-rw-r--r-- | primedev/logging/loghooks.cpp (renamed from NorthstarDLL/logging/loghooks.cpp) | 2 | ||||
-rw-r--r-- | primedev/logging/loghooks.h (renamed from NorthstarDLL/logging/loghooks.h) | 0 | ||||
-rw-r--r-- | primedev/logging/sourceconsole.cpp (renamed from NorthstarDLL/logging/sourceconsole.cpp) | 0 | ||||
-rw-r--r-- | primedev/logging/sourceconsole.h (renamed from NorthstarDLL/logging/sourceconsole.h) | 12 | ||||
-rw-r--r-- | primedev/masterserver/masterserver.cpp (renamed from NorthstarDLL/masterserver/masterserver.cpp) | 12 | ||||
-rw-r--r-- | primedev/masterserver/masterserver.h (renamed from NorthstarDLL/masterserver/masterserver.h) | 20 | ||||
-rw-r--r-- | primedev/mods/autodownload/moddownloader.cpp (renamed from NorthstarDLL/mods/autodownload/moddownloader.cpp) | 0 | ||||
-rw-r--r-- | primedev/mods/autodownload/moddownloader.h (renamed from NorthstarDLL/mods/autodownload/moddownloader.h) | 4 | ||||
-rw-r--r-- | primedev/mods/compiled/kb_act.cpp (renamed from NorthstarDLL/mods/compiled/kb_act.cpp) | 2 | ||||
-rw-r--r-- | primedev/mods/compiled/modkeyvalues.cpp (renamed from NorthstarDLL/mods/compiled/modkeyvalues.cpp) | 2 | ||||
-rw-r--r-- | primedev/mods/compiled/modpdef.cpp (renamed from NorthstarDLL/mods/compiled/modpdef.cpp) | 2 | ||||
-rw-r--r-- | primedev/mods/compiled/modscriptsrson.cpp (renamed from NorthstarDLL/mods/compiled/modscriptsrson.cpp) | 2 | ||||
-rw-r--r-- | primedev/mods/modmanager.cpp (renamed from NorthstarDLL/mods/modmanager.cpp) | 6 | ||||
-rw-r--r-- | primedev/mods/modmanager.h (renamed from NorthstarDLL/mods/modmanager.h) | 26 | ||||
-rw-r--r-- | primedev/mods/modsavefiles.cpp (renamed from NorthstarDLL/mods/modsavefiles.cpp) | 4 | ||||
-rw-r--r-- | primedev/mods/modsavefiles.h (renamed from NorthstarDLL/mods/modsavefiles.h) | 4 | ||||
-rw-r--r-- | primedev/ns_version.h (renamed from NorthstarDLL/ns_version.h) | 0 | ||||
-rw-r--r-- | primedev/pch.h (renamed from NorthstarDLL/pch.h) | 0 | ||||
-rw-r--r-- | primedev/plugins/plugin_abi.h (renamed from NorthstarDLL/plugins/plugin_abi.h) | 0 | ||||
-rw-r--r-- | primedev/plugins/pluginbackend.cpp (renamed from NorthstarDLL/plugins/pluginbackend.cpp) | 0 | ||||
-rw-r--r-- | primedev/plugins/pluginbackend.h (renamed from NorthstarDLL/plugins/pluginbackend.h) | 6 | ||||
-rw-r--r-- | primedev/plugins/plugins.cpp (renamed from NorthstarDLL/plugins/plugins.cpp) | 0 | ||||
-rw-r--r-- | primedev/plugins/plugins.h (renamed from NorthstarDLL/plugins/plugins.h) | 10 | ||||
-rw-r--r-- | primedev/primelauncher/main.cpp (renamed from NorthstarLauncher/main.cpp) | 0 | ||||
-rw-r--r-- | primedev/primelauncher/ns_icon.ico (renamed from NorthstarLauncher/ns_icon.ico) | bin | 1441814 -> 1441814 bytes | |||
-rw-r--r-- | primedev/primelauncher/resource1.h (renamed from NorthstarDLL/resource1.h) | 0 | ||||
-rw-r--r-- | primedev/primelauncher/resources.rc (renamed from NorthstarLauncher/resources.rc) | 2 | ||||
-rw-r--r-- | primedev/resource1.h (renamed from NorthstarLauncher/resource1.h) | 0 | ||||
-rw-r--r-- | primedev/resources.rc (renamed from NorthstarDLL/resources.rc) | 2 | ||||
-rw-r--r-- | primedev/scripts/client/clientchathooks.cpp (renamed from NorthstarDLL/scripts/client/clientchathooks.cpp) | 2 | ||||
-rw-r--r-- | primedev/scripts/client/cursorposition.cpp (renamed from NorthstarDLL/scripts/client/cursorposition.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/client/scriptbrowserhooks.cpp (renamed from NorthstarDLL/scripts/client/scriptbrowserhooks.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/client/scriptmainmenupromos.cpp (renamed from NorthstarDLL/scripts/client/scriptmainmenupromos.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/client/scriptmodmenu.cpp (renamed from NorthstarDLL/scripts/client/scriptmodmenu.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/client/scriptoriginauth.cpp (renamed from NorthstarDLL/scripts/client/scriptoriginauth.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/client/scriptserverbrowser.cpp (renamed from NorthstarDLL/scripts/client/scriptserverbrowser.cpp) | 14 | ||||
-rw-r--r-- | primedev/scripts/client/scriptservertoclientstringcommand.cpp (renamed from NorthstarDLL/scripts/client/scriptservertoclientstringcommand.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/scriptdatatables.cpp (renamed from NorthstarDLL/scripts/scriptdatatables.cpp) | 8 | ||||
-rw-r--r-- | primedev/scripts/scripthttprequesthandler.cpp (renamed from NorthstarDLL/scripts/scripthttprequesthandler.cpp) | 6 | ||||
-rw-r--r-- | primedev/scripts/scripthttprequesthandler.h (renamed from NorthstarDLL/scripts/scripthttprequesthandler.h) | 4 | ||||
-rw-r--r-- | primedev/scripts/scriptjson.cpp (renamed from NorthstarDLL/scripts/scriptjson.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/scriptjson.h (renamed from NorthstarDLL/scripts/scriptjson.h) | 0 | ||||
-rw-r--r-- | primedev/scripts/scriptutility.cpp (renamed from NorthstarDLL/scripts/scriptutility.cpp) | 4 | ||||
-rw-r--r-- | primedev/scripts/server/miscserverfixes.cpp (renamed from NorthstarDLL/scripts/server/miscserverfixes.cpp) | 0 | ||||
-rw-r--r-- | primedev/scripts/server/miscserverscript.cpp (renamed from NorthstarDLL/scripts/server/miscserverscript.cpp) | 18 | ||||
-rw-r--r-- | primedev/scripts/server/scriptuserinfo.cpp (renamed from NorthstarDLL/scripts/server/scriptuserinfo.cpp) | 20 | ||||
-rw-r--r-- | primedev/server/alltalk.cpp (renamed from NorthstarDLL/server/alltalk.cpp) | 4 | ||||
-rw-r--r-- | primedev/server/auth/bansystem.cpp (renamed from NorthstarDLL/server/auth/bansystem.cpp) | 8 | ||||
-rw-r--r-- | primedev/server/auth/bansystem.h (renamed from NorthstarDLL/server/auth/bansystem.h) | 4 | ||||
-rw-r--r-- | primedev/server/auth/serverauthentication.cpp (renamed from NorthstarDLL/server/auth/serverauthentication.cpp) | 46 | ||||
-rw-r--r-- | primedev/server/auth/serverauthentication.h (renamed from NorthstarDLL/server/auth/serverauthentication.h) | 20 | ||||
-rw-r--r-- | primedev/server/buildainfile.cpp (renamed from NorthstarDLL/server/buildainfile.cpp) | 6 | ||||
-rw-r--r-- | primedev/server/r2server.cpp (renamed from NorthstarDLL/server/r2server.cpp) | 10 | ||||
-rw-r--r-- | primedev/server/r2server.h | 106 | ||||
-rw-r--r-- | primedev/server/serverchathooks.cpp (renamed from NorthstarDLL/server/serverchathooks.cpp) | 12 | ||||
-rw-r--r-- | primedev/server/serverchathooks.h (renamed from NorthstarDLL/server/serverchathooks.h) | 0 | ||||
-rw-r--r-- | primedev/server/servernethooks.cpp (renamed from NorthstarDLL/server/servernethooks.cpp) | 6 | ||||
-rw-r--r-- | primedev/server/serverpresence.cpp (renamed from NorthstarDLL/server/serverpresence.cpp) | 0 | ||||
-rw-r--r-- | primedev/server/serverpresence.h (renamed from NorthstarDLL/server/serverpresence.h) | 8 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/exploitfixes.cpp (renamed from NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp) | 24 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/exploitfixes_lzss.cpp (renamed from NorthstarDLL/shared/exploit_fixes/exploitfixes_lzss.cpp) | 0 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp (renamed from NorthstarDLL/shared/exploit_fixes/exploitfixes_utf8parser.cpp) | 0 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/ns_limits.cpp (renamed from NorthstarDLL/shared/exploit_fixes/ns_limits.cpp) | 56 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/ns_limits.h (renamed from NorthstarDLL/shared/exploit_fixes/ns_limits.h) | 16 | ||||
-rw-r--r-- | primedev/shared/keyvalues.cpp (renamed from NorthstarDLL/shared/keyvalues.cpp) | 2 | ||||
-rw-r--r-- | primedev/shared/keyvalues.h (renamed from NorthstarDLL/shared/keyvalues.h) | 6 | ||||
-rw-r--r-- | primedev/shared/maxplayers.cpp (renamed from NorthstarDLL/shared/maxplayers.cpp) | 16 | ||||
-rw-r--r-- | primedev/shared/maxplayers.h | 3 | ||||
-rw-r--r-- | primedev/shared/misccommands.cpp (renamed from NorthstarDLL/shared/misccommands.cpp) | 30 | ||||
-rw-r--r-- | primedev/shared/misccommands.h (renamed from NorthstarDLL/shared/misccommands.h) | 0 | ||||
-rw-r--r-- | primedev/shared/playlist.cpp (renamed from NorthstarDLL/shared/playlist.cpp) | 2 | ||||
-rw-r--r-- | primedev/shared/playlist.h (renamed from NorthstarDLL/shared/playlist.h) | 0 | ||||
-rw-r--r-- | primedev/squirrel/squirrel.cpp (renamed from NorthstarDLL/squirrel/squirrel.cpp) | 10 | ||||
-rw-r--r-- | primedev/squirrel/squirrel.h (renamed from NorthstarDLL/squirrel/squirrel.h) | 8 | ||||
-rw-r--r-- | primedev/squirrel/squirrelautobind.cpp (renamed from NorthstarDLL/squirrel/squirrelautobind.cpp) | 0 | ||||
-rw-r--r-- | primedev/squirrel/squirrelautobind.h (renamed from NorthstarDLL/squirrel/squirrelautobind.h) | 4 | ||||
-rw-r--r-- | primedev/squirrel/squirrelclasstypes.h (renamed from NorthstarDLL/squirrel/squirrelclasstypes.h) | 8 | ||||
-rw-r--r-- | primedev/squirrel/squirreldatatypes.h (renamed from NorthstarDLL/squirrel/squirreldatatypes.h) | 0 | ||||
m--------- | primedev/thirdparty/libcurl (renamed from thirdparty/libcurl) | 0 | ||||
m--------- | primedev/thirdparty/minhook (renamed from thirdparty/minhook) | 0 | ||||
m--------- | primedev/thirdparty/minizip (renamed from thirdparty/minizip) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/allocators.h (renamed from thirdparty/rapidjson/allocators.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/document.h (renamed from thirdparty/rapidjson/document.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/encodedstream.h (renamed from thirdparty/rapidjson/encodedstream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/encodings.h (renamed from thirdparty/rapidjson/encodings.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/error/en.h (renamed from thirdparty/rapidjson/error/en.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/error/error.h (renamed from thirdparty/rapidjson/error/error.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/filereadstream.h (renamed from thirdparty/rapidjson/filereadstream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/filewritestream.h (renamed from thirdparty/rapidjson/filewritestream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/fwd.h (renamed from thirdparty/rapidjson/fwd.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/biginteger.h (renamed from thirdparty/rapidjson/internal/biginteger.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/diyfp.h (renamed from thirdparty/rapidjson/internal/diyfp.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/dtoa.h (renamed from thirdparty/rapidjson/internal/dtoa.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/ieee754.h (renamed from thirdparty/rapidjson/internal/ieee754.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/itoa.h (renamed from thirdparty/rapidjson/internal/itoa.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/meta.h (renamed from thirdparty/rapidjson/internal/meta.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/pow10.h (renamed from thirdparty/rapidjson/internal/pow10.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/regex.h (renamed from thirdparty/rapidjson/internal/regex.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/stack.h (renamed from thirdparty/rapidjson/internal/stack.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/strfunc.h (renamed from thirdparty/rapidjson/internal/strfunc.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/strtod.h (renamed from thirdparty/rapidjson/internal/strtod.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/internal/swap.h (renamed from thirdparty/rapidjson/internal/swap.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/istreamwrapper.h (renamed from thirdparty/rapidjson/istreamwrapper.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/memorybuffer.h (renamed from thirdparty/rapidjson/memorybuffer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/memorystream.h (renamed from thirdparty/rapidjson/memorystream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/msinttypes/inttypes.h (renamed from thirdparty/rapidjson/msinttypes/inttypes.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/msinttypes/stdint.h (renamed from thirdparty/rapidjson/msinttypes/stdint.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/ostreamwrapper.h (renamed from thirdparty/rapidjson/ostreamwrapper.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/pointer.h (renamed from thirdparty/rapidjson/pointer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/prettywriter.h (renamed from thirdparty/rapidjson/prettywriter.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/rapidjson.h (renamed from thirdparty/rapidjson/rapidjson.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/reader.h (renamed from thirdparty/rapidjson/reader.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/schema.h (renamed from thirdparty/rapidjson/schema.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/stream.h (renamed from thirdparty/rapidjson/stream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/stringbuffer.h (renamed from thirdparty/rapidjson/stringbuffer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/rapidjson/writer.h (renamed from thirdparty/rapidjson/writer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/async.h (renamed from thirdparty/spdlog/async.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/async_logger-inl.h (renamed from thirdparty/spdlog/async_logger-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/async_logger.h (renamed from thirdparty/spdlog/async_logger.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/cfg/argv.h (renamed from thirdparty/spdlog/cfg/argv.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/cfg/env.h (renamed from thirdparty/spdlog/cfg/env.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/cfg/helpers-inl.h (renamed from thirdparty/spdlog/cfg/helpers-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/cfg/helpers.h (renamed from thirdparty/spdlog/cfg/helpers.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/common-inl.h (renamed from thirdparty/spdlog/common-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/common.h (renamed from thirdparty/spdlog/common.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/backtracer-inl.h (renamed from thirdparty/spdlog/details/backtracer-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/backtracer.h (renamed from thirdparty/spdlog/details/backtracer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/circular_q.h (renamed from thirdparty/spdlog/details/circular_q.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/console_globals.h (renamed from thirdparty/spdlog/details/console_globals.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/file_helper-inl.h (renamed from thirdparty/spdlog/details/file_helper-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/file_helper.h (renamed from thirdparty/spdlog/details/file_helper.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/fmt_helper.h (renamed from thirdparty/spdlog/details/fmt_helper.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/log_msg-inl.h (renamed from thirdparty/spdlog/details/log_msg-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/log_msg.h (renamed from thirdparty/spdlog/details/log_msg.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/log_msg_buffer-inl.h (renamed from thirdparty/spdlog/details/log_msg_buffer-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/log_msg_buffer.h (renamed from thirdparty/spdlog/details/log_msg_buffer.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/mpmc_blocking_q.h (renamed from thirdparty/spdlog/details/mpmc_blocking_q.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/null_mutex.h (renamed from thirdparty/spdlog/details/null_mutex.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/os-inl.h (renamed from thirdparty/spdlog/details/os-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/os.h (renamed from thirdparty/spdlog/details/os.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/periodic_worker-inl.h (renamed from thirdparty/spdlog/details/periodic_worker-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/periodic_worker.h (renamed from thirdparty/spdlog/details/periodic_worker.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/registry-inl.h (renamed from thirdparty/spdlog/details/registry-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/registry.h (renamed from thirdparty/spdlog/details/registry.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/synchronous_factory.h (renamed from thirdparty/spdlog/details/synchronous_factory.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/tcp_client-windows.h (renamed from thirdparty/spdlog/details/tcp_client-windows.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/tcp_client.h (renamed from thirdparty/spdlog/details/tcp_client.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/thread_pool-inl.h (renamed from thirdparty/spdlog/details/thread_pool-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/thread_pool.h (renamed from thirdparty/spdlog/details/thread_pool.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/details/windows_include.h (renamed from thirdparty/spdlog/details/windows_include.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bin_to_hex.h (renamed from thirdparty/spdlog/fmt/bin_to_hex.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/LICENSE.rst (renamed from thirdparty/spdlog/fmt/bundled/LICENSE.rst) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/chrono.h (renamed from thirdparty/spdlog/fmt/bundled/chrono.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/color.h (renamed from thirdparty/spdlog/fmt/bundled/color.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/compile.h (renamed from thirdparty/spdlog/fmt/bundled/compile.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/core.h (renamed from thirdparty/spdlog/fmt/bundled/core.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/format-inl.h (renamed from thirdparty/spdlog/fmt/bundled/format-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/format.h (renamed from thirdparty/spdlog/fmt/bundled/format.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/locale.h (renamed from thirdparty/spdlog/fmt/bundled/locale.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/os.h (renamed from thirdparty/spdlog/fmt/bundled/os.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/ostream.h (renamed from thirdparty/spdlog/fmt/bundled/ostream.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/posix.h (renamed from thirdparty/spdlog/fmt/bundled/posix.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/printf.h (renamed from thirdparty/spdlog/fmt/bundled/printf.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/bundled/ranges.h (renamed from thirdparty/spdlog/fmt/bundled/ranges.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/chrono.h (renamed from thirdparty/spdlog/fmt/chrono.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/fmt.h (renamed from thirdparty/spdlog/fmt/fmt.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fmt/ostr.h (renamed from thirdparty/spdlog/fmt/ostr.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/formatter.h (renamed from thirdparty/spdlog/formatter.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/fwd.h (renamed from thirdparty/spdlog/fwd.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/logger-inl.h (renamed from thirdparty/spdlog/logger-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/logger.h (renamed from thirdparty/spdlog/logger.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/pattern_formatter-inl.h (renamed from thirdparty/spdlog/pattern_formatter-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/pattern_formatter.h (renamed from thirdparty/spdlog/pattern_formatter.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/android_sink.h (renamed from thirdparty/spdlog/sinks/android_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/ansicolor_sink-inl.h (renamed from thirdparty/spdlog/sinks/ansicolor_sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/ansicolor_sink.h (renamed from thirdparty/spdlog/sinks/ansicolor_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/base_sink-inl.h (renamed from thirdparty/spdlog/sinks/base_sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/base_sink.h (renamed from thirdparty/spdlog/sinks/base_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/basic_file_sink-inl.h (renamed from thirdparty/spdlog/sinks/basic_file_sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/basic_file_sink.h (renamed from thirdparty/spdlog/sinks/basic_file_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/daily_file_sink.h (renamed from thirdparty/spdlog/sinks/daily_file_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/dist_sink.h (renamed from thirdparty/spdlog/sinks/dist_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/dup_filter_sink.h (renamed from thirdparty/spdlog/sinks/dup_filter_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/hourly_file_sink.h (renamed from thirdparty/spdlog/sinks/hourly_file_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/msvc_sink.h (renamed from thirdparty/spdlog/sinks/msvc_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/null_sink.h (renamed from thirdparty/spdlog/sinks/null_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/ostream_sink.h (renamed from thirdparty/spdlog/sinks/ostream_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/ringbuffer_sink.h (renamed from thirdparty/spdlog/sinks/ringbuffer_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/rotating_file_sink-inl.h (renamed from thirdparty/spdlog/sinks/rotating_file_sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/rotating_file_sink.h (renamed from thirdparty/spdlog/sinks/rotating_file_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/sink-inl.h (renamed from thirdparty/spdlog/sinks/sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/sink.h (renamed from thirdparty/spdlog/sinks/sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/stdout_color_sinks-inl.h (renamed from thirdparty/spdlog/sinks/stdout_color_sinks-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/stdout_color_sinks.h (renamed from thirdparty/spdlog/sinks/stdout_color_sinks.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/stdout_sinks-inl.h (renamed from thirdparty/spdlog/sinks/stdout_sinks-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/stdout_sinks.h (renamed from thirdparty/spdlog/sinks/stdout_sinks.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/syslog_sink.h (renamed from thirdparty/spdlog/sinks/syslog_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/systemd_sink.h (renamed from thirdparty/spdlog/sinks/systemd_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/tcp_sink.h (renamed from thirdparty/spdlog/sinks/tcp_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/win_eventlog_sink.h (renamed from thirdparty/spdlog/sinks/win_eventlog_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/wincolor_sink-inl.h (renamed from thirdparty/spdlog/sinks/wincolor_sink-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/sinks/wincolor_sink.h (renamed from thirdparty/spdlog/sinks/wincolor_sink.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/spdlog-inl.h (renamed from thirdparty/spdlog/spdlog-inl.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/spdlog.h (renamed from thirdparty/spdlog/spdlog.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/stopwatch.h (renamed from thirdparty/spdlog/stopwatch.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/tweakme.h (renamed from thirdparty/spdlog/tweakme.h) | 0 | ||||
-rw-r--r-- | primedev/thirdparty/spdlog/version.h (renamed from thirdparty/spdlog/version.h) | 0 | ||||
-rw-r--r-- | primedev/util/printcommands.cpp (renamed from NorthstarDLL/util/printcommands.cpp) | 24 | ||||
-rw-r--r-- | primedev/util/printcommands.h (renamed from NorthstarDLL/util/printcommands.h) | 0 | ||||
-rw-r--r-- | primedev/util/printmaps.cpp (renamed from NorthstarDLL/util/printmaps.cpp) | 10 | ||||
-rw-r--r-- | primedev/util/printmaps.h (renamed from NorthstarDLL/util/printmaps.h) | 0 | ||||
-rw-r--r-- | primedev/util/utils.cpp (renamed from NorthstarDLL/util/utils.cpp) | 2 | ||||
-rw-r--r-- | primedev/util/utils.h | 3 | ||||
-rw-r--r-- | primedev/util/version.cpp (renamed from NorthstarDLL/util/version.cpp) | 0 | ||||
-rw-r--r-- | primedev/util/version.h (renamed from NorthstarDLL/util/version.h) | 0 | ||||
-rw-r--r-- | primedev/util/wininfo.cpp (renamed from NorthstarDLL/util/wininfo.cpp) | 0 | ||||
-rw-r--r-- | primedev/util/wininfo.h (renamed from NorthstarDLL/util/wininfo.h) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/dllmain.cpp (renamed from loader_wsock32_proxy/dllmain.cpp) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/loader.cpp (renamed from loader_wsock32_proxy/loader.cpp) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/loader.h (renamed from loader_wsock32_proxy/loader.h) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/pch.h (renamed from loader_wsock32_proxy/pch.h) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/wsock32.asm (renamed from loader_wsock32_proxy/wsock32.asm) | 0 | ||||
-rw-r--r-- | primedev/wsockproxy/wsock32.def (renamed from loader_wsock32_proxy/wsock32.def) | 0 |
314 files changed, 998 insertions, 1069 deletions
diff --git a/.clang-format b/.clang-format index cb98dfc0..2ad2ec20 100644 --- a/.clang-format +++ b/.clang-format @@ -3,6 +3,7 @@ Standard: Cpp11 IndentWidth: 4 TabWidth: 4 UseCRLF: false +AccessModifierOffset: -4 AlignTrailingComments: false AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff5b9cd7..917a84bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,10 @@ jobs: - name: Setup resource file version shell: bash run: | - sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarLauncher/resources.rc - sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarDLL/resources.rc + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' primedev/primelauncher/resources.rc + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' primedev/resources.rc FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]') - sed -i "s/0,0,0,1/${FILEVERSION}/g" NorthstarDLL/ns_version.h + sed -i "s/0,0,0,1/${FILEVERSION}/g" primedev/ns_version.h - name: Build run: cmake --build . - name: Extract Short Commit Hash @@ -43,8 +43,8 @@ jobs: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.16.2 with: - source: 'NorthstarDLL NorthstarLauncher' - exclude: 'NorthstarDLL/include loader_launcher_proxy loader_wsock32_proxy' + source: 'primedev' + exclude: 'primedev/include primedev/thirdparty primedev/wsockproxy' extensions: 'h,cpp' clangFormatVersion: 16 style: file diff --git a/.github/workflows/merge-conflict-auto-label.yml b/.github/workflows/merge-conflict-auto-label.yml new file mode 100644 index 00000000..e237726a --- /dev/null +++ b/.github/workflows/merge-conflict-auto-label.yml @@ -0,0 +1,16 @@ +name: Merge Conflict Auto Label +on: + push: + branches: + - main + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: mschilde/auto-label-merge-conflicts@master + with: + CONFLICT_LABEL_NAME: "merge conflicts" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAX_RETRIES: 5 + WAIT_MS: 5000 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8aebf495..e6dd8cc3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,10 +25,10 @@ jobs: - name: Setup resource file version shell: bash run: | - sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarLauncher/resources.rc - sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarDLL/resources.rc + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' primedev/primelauncher/resources.rc + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' primedev/resources.rc FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]') - sed -i "s/0,0,0,1/${FILEVERSION}/g" NorthstarDLL/ns_version.h + sed -i "s/0,0,0,1/${FILEVERSION}/g" primedev/ns_version.h - name: Build run: cmake --build . - name: Upload launcher build as artifact diff --git a/.gitmodules b/.gitmodules index c4cfc0a1..41f118e3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,11 @@ [submodule "thirdparty/libcurl"] - path = thirdparty/libcurl + path = primedev/thirdparty/libcurl url = https://github.com/curl/curl ignore = untracked [submodule "thirdparty/minhook"] - path = thirdparty/minhook + path = primedev/thirdparty/minhook url = https://github.com/TsudaKageyu/minhook ignore = untracked [submodule "thirdparty/minizip"] - path = thirdparty/minizip + path = primedev/thirdparty/minizip url = https://github.com/zlib-ng/minizip-ng.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 83c38a56..9bea0ce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,11 @@ set(NS_BINARY_DIR ${CMAKE_BINARY_DIR}/game) message(STATUS "NS: Building to ${NS_BINARY_DIR}") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/primedev/cmake") include(utils) +include_directories(primedev) +include_directories(primedev/thirdparty) + # Targets -add_subdirectory(loader_wsock32_proxy) -add_subdirectory(NorthstarDLL) -add_subdirectory(NorthstarLauncher) +add_subdirectory(primedev) diff --git a/NorthstarDLL/client/r2client.h b/NorthstarDLL/client/r2client.h deleted file mode 100644 index 64ed6c61..00000000 --- a/NorthstarDLL/client/r2client.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// use the R2 namespace for game funcs -namespace R2 -{ - extern char* g_pLocalPlayerUserID; - extern char* g_pLocalPlayerOriginToken; - - typedef void* (*GetBaseLocalClientType)(); - extern GetBaseLocalClientType GetBaseLocalClient; -} // namespace R2 diff --git a/NorthstarDLL/core/tier0.cpp b/NorthstarDLL/core/tier0.cpp deleted file mode 100644 index 16709384..00000000 --- a/NorthstarDLL/core/tier0.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "tier0.h" - -// use the Tier0 namespace for tier0 funcs -namespace Tier0 -{ - IMemAlloc* g_pMemAllocSingleton = nullptr; - - ErrorType Error; - CommandLineType CommandLine; - Plat_FloatTimeType Plat_FloatTime; - ThreadInServerFrameThreadType ThreadInServerFrameThread; -} // namespace Tier0 - -typedef Tier0::IMemAlloc* (*CreateGlobalMemAllocType)(); -CreateGlobalMemAllocType CreateGlobalMemAlloc; - -// needs to be a seperate function, since memalloc.cpp calls it -void TryCreateGlobalMemAlloc() -{ - // init memalloc stuff - CreateGlobalMemAlloc = - reinterpret_cast<CreateGlobalMemAllocType>(GetProcAddress(GetModuleHandleA("tier0.dll"), "CreateGlobalMemAlloc")); - Tier0::g_pMemAllocSingleton = CreateGlobalMemAlloc(); // if it already exists, this returns the preexisting IMemAlloc instance -} - -ON_DLL_LOAD("tier0.dll", Tier0GameFuncs, (CModule module)) -{ - // shouldn't be necessary, but do this just in case - TryCreateGlobalMemAlloc(); - - // setup tier0 funcs - Tier0::Error = module.GetExport("Error").RCast<Tier0::ErrorType>(); - Tier0::CommandLine = module.GetExport("CommandLine").RCast<Tier0::CommandLineType>(); - Tier0::Plat_FloatTime = module.GetExport("Plat_FloatTime").RCast<Tier0::Plat_FloatTimeType>(); - Tier0::ThreadInServerFrameThread = module.GetExport("ThreadInServerFrameThread").RCast<Tier0::ThreadInServerFrameThreadType>(); -} diff --git a/NorthstarDLL/core/tier0.h b/NorthstarDLL/core/tier0.h deleted file mode 100644 index eebe98f2..00000000 --- a/NorthstarDLL/core/tier0.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once -namespace Tier0 -{ - class IMemAlloc - { - public: - struct VTable - { - void* unknown[1]; // alloc debug - void* (*Alloc)(IMemAlloc* memAlloc, size_t nSize); - void* unknown2[1]; // realloc debug - void* (*Realloc)(IMemAlloc* memAlloc, void* pMem, size_t nSize); - void* unknown3[1]; // free #1 - void (*Free)(IMemAlloc* memAlloc, void* pMem); - void* unknown4[2]; // nullsubs, maybe CrtSetDbgFlag - size_t (*GetSize)(IMemAlloc* memAlloc, void* pMem); - void* unknown5[9]; // they all do literally nothing - void (*DumpStats)(IMemAlloc* memAlloc); - void (*DumpStatsFileBase)(IMemAlloc* memAlloc, const char* pchFileBase); - void* unknown6[4]; - int (*heapchk)(IMemAlloc* memAlloc); - }; - - VTable* m_vtable; - }; - - class CCommandLine - { - public: - // based on the defs in the 2013 source sdk, but for some reason has an extra function (may be another CreateCmdLine overload?) - // these seem to line up with what they should be though - virtual void CreateCmdLine(const char* commandline) = 0; - virtual void CreateCmdLine(int argc, char** argv) = 0; - virtual void unknown() = 0; - virtual const char* GetCmdLine(void) const = 0; - - virtual const char* CheckParm(const char* psz, const char** ppszValue = 0) const = 0; - virtual void RemoveParm() const = 0; - virtual void AppendParm(const char* pszParm, const char* pszValues) = 0; - - virtual const char* ParmValue(const char* psz, const char* pDefaultVal = 0) const = 0; - virtual int ParmValue(const char* psz, int nDefaultVal) const = 0; - virtual float ParmValue(const char* psz, float flDefaultVal) const = 0; - - virtual int ParmCount() const = 0; - virtual int FindParm(const char* psz) const = 0; - virtual const char* GetParm(int nIndex) const = 0; - virtual void SetParm(int nIndex, char const* pParm) = 0; - - // virtual const char** GetParms() const {} - }; - - extern IMemAlloc* g_pMemAllocSingleton; - - typedef void (*ErrorType)(const char* fmt, ...); - extern ErrorType Error; - - typedef CCommandLine* (*CommandLineType)(); - extern CommandLineType CommandLine; - - typedef double (*Plat_FloatTimeType)(); - extern Plat_FloatTimeType Plat_FloatTime; - - typedef bool (*ThreadInServerFrameThreadType)(); - extern ThreadInServerFrameThreadType ThreadInServerFrameThread; -} // namespace Tier0 - -void TryCreateGlobalMemAlloc(); diff --git a/NorthstarDLL/engine/hoststate.h b/NorthstarDLL/engine/hoststate.h deleted file mode 100644 index a77385ef..00000000 --- a/NorthstarDLL/engine/hoststate.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -// use the R2 namespace for game funxcs -namespace R2 -{ - enum class HostState_t - { - HS_NEW_GAME = 0, - HS_LOAD_GAME, - HS_CHANGE_LEVEL_SP, - HS_CHANGE_LEVEL_MP, - HS_RUN, - HS_GAME_SHUTDOWN, - HS_SHUTDOWN, - HS_RESTART, - }; - - struct CHostState - { - public: - HostState_t m_iCurrentState; - HostState_t m_iNextState; - - float m_vecLocation[3]; - float m_angLocation[3]; - - char m_levelName[32]; - char m_mapGroupName[32]; - char m_landmarkName[32]; - char m_saveName[32]; - float m_flShortFrameTime; // run a few one-tick frames to avoid large timesteps while loading assets - - bool m_activeGame; - bool m_bRememberLocation; - bool m_bBackgroundLevel; - bool m_bWaitingForConnection; - bool m_bLetToolsOverrideLoadGameEnts; // During a load game, this tells Foundry to override ents that are selected in Hammer. - bool m_bSplitScreenConnect; - bool m_bGameHasShutDownAndFlushedMemory; // This is false once we load a map into memory, and set to true once the map is unloaded - // and all memory flushed - bool m_bWorkshopMapDownloadPending; - }; - - extern CHostState* g_pHostState; -} // namespace R2 diff --git a/NorthstarDLL/engine/r2engine.h b/NorthstarDLL/engine/r2engine.h deleted file mode 100644 index df0cda74..00000000 --- a/NorthstarDLL/engine/r2engine.h +++ /dev/null @@ -1,264 +0,0 @@ -#pragma once -#include "shared/keyvalues.h" - -// use the R2 namespace for game funcs -namespace R2 -{ - // Cbuf - enum class ECommandTarget_t - { - CBUF_FIRST_PLAYER = 0, - CBUF_LAST_PLAYER = 1, // MAX_SPLITSCREEN_CLIENTS - 1, MAX_SPLITSCREEN_CLIENTS = 2 - CBUF_SERVER = CBUF_LAST_PLAYER + 1, - - CBUF_COUNT, - }; - - enum class cmd_source_t - { - // Added to the console buffer by gameplay code. Generally unrestricted. - kCommandSrcCode, - - // Sent from code via engine->ClientCmd, which is restricted to commands visible - // via FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS. - kCommandSrcClientCmd, - - // Typed in at the console or via a user key-bind. Generally unrestricted, although - // the client will throttle commands sent to the server this way to 16 per second. - kCommandSrcUserInput, - - // Came in over a net connection as a clc_stringcmd - // host_client will be valid during this state. - // - // Restricted to FCVAR_GAMEDLL commands (but not convars) and special non-ConCommand - // server commands hardcoded into gameplay code (e.g. "joingame") - kCommandSrcNetClient, - - // Received from the server as the client - // - // Restricted to commands with FCVAR_SERVER_CAN_EXECUTE - kCommandSrcNetServer, - - // Being played back from a demo file - // - // Not currently restricted by convar flag, but some commands manually ignore calls - // from this source. FIXME: Should be heavily restricted as demo commands can come - // from untrusted sources. - kCommandSrcDemoFile, - - // Invalid value used when cleared - kCommandSrcInvalid = -1 - }; - - typedef ECommandTarget_t (*Cbuf_GetCurrentPlayerType)(); - extern Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer; - - typedef void (*Cbuf_AddTextType)(ECommandTarget_t eTarget, const char* text, cmd_source_t source); - extern Cbuf_AddTextType Cbuf_AddText; - - typedef void (*Cbuf_ExecuteType)(); - extern Cbuf_ExecuteType Cbuf_Execute; - - extern bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, R2::cmd_source_t commandSource); - - // CEngine - - enum EngineQuitState - { - QUIT_NOTQUITTING = 0, - QUIT_TODESKTOP, - QUIT_RESTART - }; - - enum class EngineState_t - { - DLL_INACTIVE = 0, // no dll - DLL_ACTIVE, // engine is focused - DLL_CLOSE, // closing down dll - DLL_RESTART, // engine is shutting down but will restart right away - DLL_PAUSED, // engine is paused, can become active from this state - }; - - class CEngine - { - public: - virtual void unknown() = 0; // unsure if this is where - virtual bool Load(bool dedicated, const char* baseDir) = 0; - virtual void Unload() = 0; - virtual void SetNextState(EngineState_t iNextState) = 0; - virtual EngineState_t GetState() = 0; - virtual void Frame() = 0; - virtual double GetFrameTime() = 0; - virtual float GetCurTime() = 0; - - EngineQuitState m_nQuitting; - EngineState_t m_nDllState; - EngineState_t m_nNextDllState; - double m_flCurrentTime; - float m_flFrameTime; - double m_flPreviousTime; - float m_flFilteredTime; - float m_flMinFrameTime; // Expected duration of a frame, or zero if it is unlimited. - }; - - extern CEngine* g_pEngine; - - extern void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...); - -#pragma once - typedef enum - { - NA_NULL = 0, - NA_LOOPBACK, - NA_IP, - } netadrtype_t; - -#pragma pack(push, 1) - typedef struct netadr_s - { - netadrtype_t type; - unsigned char ip[16]; // IPv6 - // IPv4's 127.0.0.1 is [::ffff:127.0.0.1], that is: - // 00 00 00 00 00 00 00 00 00 00 FF FF 7F 00 00 01 - unsigned short port; - } netadr_t; -#pragma pack(pop) - -#pragma pack(push, 1) - typedef struct netpacket_s - { - netadr_t adr; // sender address - // int source; // received source - char unk[10]; - double received_time; - unsigned char* data; // pointer to raw packet data - void* message; // easy bitbuf data access // 'inpacket.message' etc etc (pointer) - char unk2[16]; - int size; - - // bf_read message; // easy bitbuf data access // 'inpacket.message' etc etc (pointer) - // int size; // size in bytes - // int wiresize; // size in bytes before decompression - // bool stream; // was send as stream - // struct netpacket_s* pNext; // for internal use, should be NULL in public - } netpacket_t; -#pragma pack(pop) - - // #56169 $DB69 PData size - // #512 $200 Trailing data - // #100 $64 Safety buffer - const int PERSISTENCE_MAX_SIZE = 0xDDCD; - - // note: NOT_READY and READY are the only entries we have here that are defined by the vanilla game - // entries after this are custom and used to determine the source of persistence, e.g. whether it is local or remote - enum class ePersistenceReady : char - { - NOT_READY, - READY = 3, - READY_INSECURE = 3, - READY_REMOTE - }; - - enum class eSignonState : int - { - NONE = 0, // no state yet; about to connect - CHALLENGE = 1, // client challenging server; all OOB packets - CONNECTED = 2, // client is connected to server; netchans ready - NEW = 3, // just got serverinfo and string tables - PRESPAWN = 4, // received signon buffers - GETTINGDATA = 5, // respawn-defined signonstate, assumedly this is for persistence - SPAWN = 6, // ready to receive entity packets - FIRSTSNAP = 7, // another respawn-defined one - FULL = 8, // we are fully connected; first non-delta packet received - CHANGELEVEL = 9, // server is changing level; please wait - }; - - // clang-format off - OFFSET_STRUCT(CBaseClient) - { - STRUCT_SIZE(0x2D728) - FIELD(0x16, char m_Name[64]) - FIELD(0x258, KeyValues* m_ConVars) - FIELD(0x2A0, eSignonState m_Signon) - FIELD(0x358, char m_ClanTag[16]) - FIELD(0x484, bool m_bFakePlayer) - FIELD(0x4A0, ePersistenceReady m_iPersistenceReady) - FIELD(0x4FA, char m_PersistenceBuffer[PERSISTENCE_MAX_SIZE]) - FIELD(0xF500, char m_UID[32]) - }; - // clang-format on - - extern CBaseClient* g_pClientArray; - - enum server_state_t - { - ss_dead = 0, // Dead - ss_loading, // Spawning - ss_active, // Running - ss_paused, // Running, but paused - }; - - extern server_state_t* g_pServerState; - - extern char* g_pModName; - - // clang-format off - OFFSET_STRUCT(CGlobalVars) - { - FIELD(0x0, - // Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time - // perf clock, but not that it doesn't obey host_timescale/host_framerate) - double m_flRealTime); - - FIELDS(0x8, - // Absolute frame counter - continues to increase even if game is paused - int m_nFrameCount; - - // Non-paused frametime - float m_flAbsoluteFrameTime; - - // Current time - // - // On the client, this (along with tickcount) takes a different meaning based on what - // piece of code you're in: - // - // - While receiving network packets (like in PreDataUpdate/PostDataUpdate and proxies), - // this is set to the SERVER TICKCOUNT for that packet. There is no interval between - // the server ticks. - // [server_current_Tick * tick_interval] - // - // - While rendering, this is the exact client clock - // [client_current_tick * tick_interval + interpolation_amount] - // - // - During prediction, this is based on the client's current tick: - // [client_current_tick * tick_interval] - float m_flCurTime; - ) - - FIELDS(0x30, - // Time spent on last server or client frame (has nothing to do with think intervals) - float m_flFrameTime; - - // current maxplayers setting - int m_nMaxClients; - ) - - FIELDS(0x3C, - // Simulation ticks - does not increase when game is paused - uint32_t m_nTickCount; // this is weird and doesn't seem to increase once per frame? - - // Simulation tick interval - float m_flTickInterval; - ) - - FIELDS(0x60, - const char* m_pMapName; - int m_nMapVersion; - ) - - //FIELD(0x98, double m_flRealTime); // again? - }; - // clang-format on - - extern CGlobalVars* g_pGlobals; -} // namespace R2 diff --git a/NorthstarDLL/server/r2server.h b/NorthstarDLL/server/r2server.h deleted file mode 100644 index 8fde7b9d..00000000 --- a/NorthstarDLL/server/r2server.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once - -#include "core/math/vector.h" - -// use the R2 namespace for game funcs -namespace R2 -{ - // server entity stuff - class CBaseEntity; - extern CBaseEntity* (*Server_GetEntityByIndex)(int index); - - // clang-format off - OFFSET_STRUCT(CBasePlayer) - { - FIELD(0x58, uint32_t m_nPlayerIndex) - - FIELD(0x23E8, bool m_grappleActive) - FIELD(0x1D08, uint32_t m_platformUserId) - FIELD(0x1D10, int32_t m_classModsActive) - FIELD(0x1D8C, int32_t m_posClassModsActive) - FIELD(0x1DCC, bool m_passives) - FIELD(0x4948, int32_t m_selectedOffhand) - FIELD(0x1358, int32_t m_selectedOffhandPendingHybridAction) - FIELD(0x1E88, int32_t m_playerFlags) - FIELD(0x26A8, int32_t m_lastUCmdSimulationTicks) - FIELD(0x26AC, float m_lastUCmdSimulationRemainderTime) - FIELD(0x1F04, int32_t m_remoteTurret) - FIELD(0x414, int32_t m_hGroundEntity) - FIELD(0x13B8, int32_t m_titanSoul) - FIELD(0x2054, int32_t m_petTitan) - FIELD(0x4D4, int32_t m_iHealth) - FIELD(0x4D0, int32_t m_iMaxHealth) - FIELD(0x4F1, int32_t m_lifeState) - FIELD(0x50C, float m_flMaxspeed) - FIELD(0x298, int32_t m_fFlags) - FIELD(0x1F64, int32_t m_iObserverMode) - FIELD(0x1F6C, int32_t m_hObserverTarget) - FIELD(0x2098, int32_t m_hViewModel) - FIELD(0x27E4, int32_t m_ubEFNointerpParity) - FIELD(0x1FA4, int32_t m_activeBurnCardIndex) - FIELD(0x1B68, int32_t m_hColorCorrectionCtrl) - FIELD(0x19E0, int32_t m_PlayerFog__m_hCtrl) - FIELD(0x26BC, bool m_bShouldDrawPlayerWhileUsingViewEntity) - FIELD(0x2848, char m_title[32]) - FIELD(0x2964, bool m_useCredit) - FIELD(0x1F40, float m_damageImpulseNoDecelEndTime) - FIELD(0x1E8C, bool m_hasMic) - FIELD(0x1E8D, bool m_inPartyChat) - FIELD(0x1E90, float m_playerMoveSpeedScale) - FIELD(0x1F58, float m_flDeathTime) - FIELD(0x25A8, bool m_iSpawnParity) - FIELD(0x102284, Vector3 m_upDir) - FIELD(0x259C, float m_lastDodgeTime) - FIELD(0x22E0, bool m_wallHanging) - FIELD(0x22EC, int32_t m_traversalType) - FIELD(0x22F0, int32_t m_traversalState) - FIELD(0x2328, Vector3 m_traversalRefPos) - FIELD(0x231C, Vector3 m_traversalForwardDir) - FIELD(0x2354, float m_traversalYawDelta) - FIELD(0x2358, int32_t m_traversalYawPoseParameter) - FIELD(0x2050, int32_t m_grappleHook) - FIELD(0x27C0, int32_t m_autoSprintForced) - FIELD(0x27C4, bool m_fIsSprinting) - FIELD(0x27CC, float m_sprintStartedTime) - FIELD(0x27D0, float m_sprintStartedFrac) - FIELD(0x27D4, float m_sprintEndedTime) - FIELD(0x27D8, float m_sprintEndedFrac) - FIELD(0x27DC, float m_stickySprintStartTime) - FIELD(0x2998, float m_smartAmmoPreviousHighestLockOnMeFractionValue) - FIELD(0x23FC, int32_t m_activeZipline) - FIELD(0x2400, bool m_ziplineReverse) - FIELD(0x2410, int32_t m_ziplineState) - FIELD(0x2250, int32_t m_duckState) - FIELD(0x2254, Vector3 m_StandHullMin) - FIELD(0x2260, Vector3 m_StandHullMax) - FIELD(0x226C, Vector3 m_DuckHullMin) - FIELD(0x2278, Vector3 m_DuckHullMax) - FIELD(0x205C, int32_t m_xp) - FIELD(0x2060, int32_t m_generation) - FIELD(0x2064, int32_t m_rank) - FIELD(0x2068, int32_t m_serverForceIncreasePlayerListGenerationParity) - FIELD(0x206C, bool m_isPlayingRanked) - FIELD(0x2070, float m_skill_mu) - FIELD(0x1E80, int32_t m_titanSoulBeingRodeoed) - FIELD(0x1E84, int32_t m_entitySyncingWithMe) - FIELD(0x2078, float m_nextTitanRespawnAvailable) - FIELD(0x1C90, bool m_hasBadReputation) - FIELD(0x1C91, char m_communityName[64]) - FIELD(0x1CD1, char m_communityClanTag[16]) - FIELD(0x1CE1, char m_factionName[16]) - FIELD(0x1CF1, char m_hardwareIcon[16]) - FIELD(0x1D01, bool m_happyHourActive) - FIELD(0x1EF4, int32_t m_gestureAutoKillBitfield) - FIELD(0x2EA8, int32_t m_pilotClassIndex) - FIELD(0x100490, Vector3 m_vecAbsOrigin) - FIELD(0x25BE, bool m_isPerformingBoostAction) - FIELD(0x240C, bool m_ziplineValid3pWeaponLayerAnim) - FIELD(0x345C, int32_t m_playerScriptNetDataGlobal) - FIELD(0x1598, int32_t m_bZooming) - FIELD(0x1599, bool m_zoomToggleOn) - FIELD(0x159C, float m_zoomBaseFrac) - FIELD(0x15A0, float m_zoomBaseTime) - FIELD(0x15A4, float m_zoomFullStartTime) - FIELD(0xA04, int32_t m_camoIndex) - FIELD(0xA08, int32_t m_decalIndex) - }; - // clang-format on - - extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); -} // namespace R2 diff --git a/NorthstarDLL/shared/maxplayers.h b/NorthstarDLL/shared/maxplayers.h deleted file mode 100644 index b251f6a6..00000000 --- a/NorthstarDLL/shared/maxplayers.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -// should we use R2 for this? not sure -namespace R2 // use R2 namespace for game funcs -{ - int GetMaxPlayers(); -} // namespace R2 diff --git a/NorthstarDLL/util/utils.h b/NorthstarDLL/util/utils.h deleted file mode 100644 index 97b92f18..00000000 --- a/NorthstarDLL/util/utils.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace NS::Utils -{ - void RemoveAsciiControlSequences(char* str, bool allow_color_codes); -} @@ -9,4 +9,4 @@ Check [BUILD.md](BUILD.md) for instructions on how to compile, you can also down ## Format -This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html), make sure you run `clang-format -i --style=file NorthstarLauncher/*.cpp NorthstarLauncher/*.h NorthstarDLL/*.cpp NorthstarDLL/*.h` when opening a Pull Request. Check the tool's website for instructions on how to integrate it with your IDE. +This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html), make sure you run `clang-format -i --style=file --exclude=primedev/include primedev/*.cpp primedev/*.h` when opening a Pull Request. Check the tool's website for instructions on how to integrate it with your IDE. diff --git a/cmake/Findminhook.cmake b/cmake/Findminhook.cmake deleted file mode 100644 index 8ec2e99a..00000000 --- a/cmake/Findminhook.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -if(NOT minhook_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/thirdparty/minhook) - - add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/minhook minhook) - set(minhook_FOUND 1 PARENT_SCOPE) -endif() - diff --git a/cmake/Findspdlog.cmake b/cmake/Findspdlog.cmake deleted file mode 100644 index 38b52a53..00000000 --- a/cmake/Findspdlog.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -if(NOT spdlog_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/thirdparty/spdlog) - - add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/spdlog spdlog) - set(spdlog_FOUND 1 PARENT_SCOPE) -endif() - diff --git a/primedev/CMakeLists.txt b/primedev/CMakeLists.txt new file mode 100644 index 00000000..03f2628e --- /dev/null +++ b/primedev/CMakeLists.txt @@ -0,0 +1,3 @@ +include(Northstar.cmake) +include(Launcher.cmake) +include(WSockProxy.cmake) diff --git a/NorthstarLauncher/CMakeLists.txt b/primedev/Launcher.cmake index f4d7bcb9..9edcf0e5 100644 --- a/NorthstarLauncher/CMakeLists.txt +++ b/primedev/Launcher.cmake @@ -1,8 +1,8 @@ # NorthstarLauncher add_executable(NorthstarLauncher - "main.cpp" - "resources.rc" + "primelauncher/main.cpp" + "primelauncher/resources.rc" ) target_compile_definitions(NorthstarLauncher PRIVATE diff --git a/NorthstarDLL/CMakeLists.txt b/primedev/Northstar.cmake index d238f61f..69db3d4e 100644 --- a/NorthstarDLL/CMakeLists.txt +++ b/primedev/Northstar.cmake @@ -167,11 +167,6 @@ target_link_libraries(NorthstarDLL PRIVATE version.lib ) -target_include_directories(NorthstarDLL PRIVATE - ${CMAKE_SOURCE_DIR}/NorthstarDLL - ${CMAKE_SOURCE_DIR}/thirdparty -) - target_precompile_headers(NorthstarDLL PRIVATE pch.h) target_compile_definitions(NorthstarDLL PRIVATE diff --git a/loader_wsock32_proxy/CMakeLists.txt b/primedev/WSockProxy.cmake index 3157f6c5..84338bc7 100644 --- a/loader_wsock32_proxy/CMakeLists.txt +++ b/primedev/WSockProxy.cmake @@ -3,11 +3,11 @@ find_package(minhook REQUIRED) add_library(loader_wsock32_proxy SHARED - "dllmain.cpp" - "loader.cpp" - "loader.h" - "wsock32.asm" - "wsock32.def" + "wsockproxy/dllmain.cpp" + "wsockproxy/loader.cpp" + "wsockproxy/loader.h" + "wsockproxy/wsock32.asm" + "wsockproxy/wsock32.def" ) target_link_libraries(loader_wsock32_proxy PRIVATE @@ -31,7 +31,7 @@ target_link_libraries(loader_wsock32_proxy PRIVATE odbccp32.lib ) -target_precompile_headers(loader_wsock32_proxy PRIVATE pch.h) +target_precompile_headers(loader_wsock32_proxy PRIVATE wsockproxy/pch.h) target_compile_definitions(loader_wsock32_proxy PRIVATE UNICODE diff --git a/NorthstarDLL/client/audio.cpp b/primedev/client/audio.cpp index aa32e390..aa32e390 100644 --- a/NorthstarDLL/client/audio.cpp +++ b/primedev/client/audio.cpp diff --git a/NorthstarDLL/client/audio.h b/primedev/client/audio.h index 26cda205..15fd1a35 100644 --- a/NorthstarDLL/client/audio.h +++ b/primedev/client/audio.h @@ -14,11 +14,11 @@ enum class AudioSelectionStrategy class EventOverrideData { - public: +public: EventOverrideData(const std::string&, const fs::path&); EventOverrideData(); - public: +public: bool LoadedSuccessfully = false; std::vector<std::string> EventIds = {}; @@ -34,7 +34,7 @@ class EventOverrideData class CustomAudioManager { - public: +public: bool TryLoadAudioOverride(const fs::path&); void ClearAudioOverrides(); diff --git a/NorthstarDLL/client/chatcommand.cpp b/primedev/client/chatcommand.cpp index 9cf34e43..9cf34e43 100644 --- a/NorthstarDLL/client/chatcommand.cpp +++ b/primedev/client/chatcommand.cpp diff --git a/NorthstarDLL/client/clientauthhooks.cpp b/primedev/client/clientauthhooks.cpp index adb2ab22..35ae3aa7 100644 --- a/NorthstarDLL/client/clientauthhooks.cpp +++ b/primedev/client/clientauthhooks.cpp @@ -32,10 +32,10 @@ void, __fastcall, (void* a1)) // if player has agreed to send token and we aren't already authing, try to auth if (Cvar_ns_has_agreed_to_send_token->GetInt() == AGREED_TO_SEND_TOKEN && !g_pMasterServerManager->m_bOriginAuthWithMasterServerInProgress) - g_pMasterServerManager->AuthenticateOriginWithMasterServer(R2::g_pLocalPlayerUserID, R2::g_pLocalPlayerOriginToken); + g_pMasterServerManager->AuthenticateOriginWithMasterServer(g_pLocalPlayerUserID, g_pLocalPlayerOriginToken); // invalidate key so auth will fail - *R2::g_pLocalPlayerOriginToken = 0; + *g_pLocalPlayerOriginToken = 0; } AuthWithStryder(a1); diff --git a/NorthstarDLL/client/clientruihooks.cpp b/primedev/client/clientruihooks.cpp index ad50d11a..ad50d11a 100644 --- a/NorthstarDLL/client/clientruihooks.cpp +++ b/primedev/client/clientruihooks.cpp diff --git a/NorthstarDLL/client/clientvideooverrides.cpp b/primedev/client/clientvideooverrides.cpp index d8aa2754..d8aa2754 100644 --- a/NorthstarDLL/client/clientvideooverrides.cpp +++ b/primedev/client/clientvideooverrides.cpp diff --git a/NorthstarDLL/client/debugoverlay.cpp b/primedev/client/debugoverlay.cpp index e231054d..e231054d 100644 --- a/NorthstarDLL/client/debugoverlay.cpp +++ b/primedev/client/debugoverlay.cpp diff --git a/NorthstarDLL/client/demofixes.cpp b/primedev/client/demofixes.cpp index 65e48fc0..344764ba 100644 --- a/NorthstarDLL/client/demofixes.cpp +++ b/primedev/client/demofixes.cpp @@ -11,15 +11,15 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientDemoFixes, ConVar, (CModule modu { // change default values of demo cvars to enable them by default, but not autorecord // this is before Host_Init, the setvalue calls here will get overwritten by custom cfgs/launch options - ConVar* Cvar_demo_enableDemos = R2::g_pCVar->FindVar("demo_enabledemos"); + ConVar* Cvar_demo_enableDemos = g_pCVar->FindVar("demo_enabledemos"); Cvar_demo_enableDemos->m_pszDefaultValue = "1"; Cvar_demo_enableDemos->SetValue(true); - ConVar* Cvar_demo_writeLocalFile = R2::g_pCVar->FindVar("demo_writeLocalFile"); + ConVar* Cvar_demo_writeLocalFile = g_pCVar->FindVar("demo_writeLocalFile"); Cvar_demo_writeLocalFile->m_pszDefaultValue = "1"; Cvar_demo_writeLocalFile->SetValue(true); - ConVar* Cvar_demo_autoRecord = R2::g_pCVar->FindVar("demo_autoRecord"); + ConVar* Cvar_demo_autoRecord = g_pCVar->FindVar("demo_autoRecord"); Cvar_demo_autoRecord->m_pszDefaultValue = "0"; Cvar_demo_autoRecord->SetValue(false); } diff --git a/NorthstarDLL/client/diskvmtfixes.cpp b/primedev/client/diskvmtfixes.cpp index 4ab951c0..4ab951c0 100644 --- a/NorthstarDLL/client/diskvmtfixes.cpp +++ b/primedev/client/diskvmtfixes.cpp diff --git a/NorthstarDLL/client/languagehooks.cpp b/primedev/client/languagehooks.cpp index 4251dbbd..35ca5659 100644 --- a/NorthstarDLL/client/languagehooks.cpp +++ b/primedev/client/languagehooks.cpp @@ -57,7 +57,7 @@ char*, __fastcall, ()) bool& canOriginDictateLang = *(bool*)((char*)tier0Handle + 0xA9A90); const char* forcedLanguage; - if (Tier0::CommandLine()->CheckParm("-language", &forcedLanguage)) + if (CommandLine()->CheckParm("-language", &forcedLanguage)) { if (!CheckLangAudioExists((char*)forcedLanguage)) { diff --git a/NorthstarDLL/client/latencyflex.cpp b/primedev/client/latencyflex.cpp index 25e38c7a..25e38c7a 100644 --- a/NorthstarDLL/client/latencyflex.cpp +++ b/primedev/client/latencyflex.cpp diff --git a/NorthstarDLL/client/localchatwriter.cpp b/primedev/client/localchatwriter.cpp index 848d898f..35cc065f 100644 --- a/NorthstarDLL/client/localchatwriter.cpp +++ b/primedev/client/localchatwriter.cpp @@ -4,13 +4,13 @@ class vgui_BaseRichText_vtable; class vgui_BaseRichText { - public: +public: vgui_BaseRichText_vtable* vtable; }; class vgui_BaseRichText_vtable { - public: +public: char unknown1[1880]; void(__fastcall* InsertChar)(vgui_BaseRichText* self, wchar_t ch); @@ -49,7 +49,7 @@ class vgui_BaseRichText_vtable class CGameSettings { - public: +public: char unknown1[92]; int isChatEnabled; }; @@ -58,7 +58,7 @@ class CGameSettings // have their value at the same offset class CGameFloatVar { - public: +public: char unknown1[88]; float value; }; @@ -101,7 +101,7 @@ Color lightColors[8] = { class AnsiEscapeParser { - public: +public: explicit AnsiEscapeParser(LocalChatWriter* writer) : m_writer(writer) {} void HandleVal(unsigned long val) @@ -129,7 +129,7 @@ class AnsiEscapeParser } } - private: +private: enum class Next { ControlType, diff --git a/NorthstarDLL/client/localchatwriter.h b/primedev/client/localchatwriter.h index de9e2f9b..acf6f87e 100644 --- a/NorthstarDLL/client/localchatwriter.h +++ b/primedev/client/localchatwriter.h @@ -5,7 +5,7 @@ class vgui_BaseRichText; class CHudChat { - public: +public: static CHudChat** allHuds; char unknown1[720]; @@ -29,7 +29,7 @@ class CHudChat class LocalChatWriter { - public: +public: enum Context { NetworkContext = 0, @@ -56,7 +56,7 @@ class LocalChatWriter void InsertColorChange(Color color); void InsertSwatchColorChange(SwatchColor color); - private: +private: Context m_context; const char* ApplyAnsiEscape(const char* escape); diff --git a/NorthstarDLL/client/modlocalisation.cpp b/primedev/client/modlocalisation.cpp index 2b73876b..2b73876b 100644 --- a/NorthstarDLL/client/modlocalisation.cpp +++ b/primedev/client/modlocalisation.cpp diff --git a/NorthstarDLL/client/r2client.cpp b/primedev/client/r2client.cpp index fea97d8e..c8e59d74 100644 --- a/NorthstarDLL/client/r2client.cpp +++ b/primedev/client/r2client.cpp @@ -1,14 +1,8 @@ #include "r2client.h" -using namespace R2; - -// use the R2 namespace for game funcs -namespace R2 -{ - char* g_pLocalPlayerUserID; - char* g_pLocalPlayerOriginToken; - GetBaseLocalClientType GetBaseLocalClient; -} // namespace R2 +char* g_pLocalPlayerUserID; +char* g_pLocalPlayerOriginToken; +GetBaseLocalClientType GetBaseLocalClient; ON_DLL_LOAD("engine.dll", R2EngineClient, (CModule module)) { diff --git a/primedev/client/r2client.h b/primedev/client/r2client.h new file mode 100644 index 00000000..ea263dbc --- /dev/null +++ b/primedev/client/r2client.h @@ -0,0 +1,7 @@ +#pragma once + +extern char* g_pLocalPlayerUserID; +extern char* g_pLocalPlayerOriginToken; + +typedef void* (*GetBaseLocalClientType)(); +extern GetBaseLocalClientType GetBaseLocalClient; diff --git a/NorthstarDLL/client/rejectconnectionfixes.cpp b/primedev/client/rejectconnectionfixes.cpp index 6adde8b6..1b326a3c 100644 --- a/NorthstarDLL/client/rejectconnectionfixes.cpp +++ b/primedev/client/rejectconnectionfixes.cpp @@ -22,7 +22,7 @@ void,, (bool a1, const char* fmt, ...)) // not doing this gets our client in a pretty weird state so we need to shut it down manually here
// don't call Cbuf_Execute because we don't need this called immediately
- R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "disconnect", R2::cmd_source_t::kCommandSrcCode);
+ Cbuf_AddText(Cbuf_GetCurrentPlayer(), "disconnect", cmd_source_t::kCommandSrcCode);
}
return COM_ExplainDisconnection(a1, "%s", buf);
diff --git a/cmake/Findlibcurl.cmake b/primedev/cmake/Findlibcurl.cmake index a6f0b47c..6e158b95 100644 --- a/cmake/Findlibcurl.cmake +++ b/primedev/cmake/Findlibcurl.cmake @@ -1,7 +1,7 @@ if (NOT libcurl_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/thirdparty/libcurl) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl) set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries") set(BUILD_CURL_EXE OFF CACHE BOOL "Build curl EXE") @@ -13,6 +13,6 @@ if (NOT libcurl_FOUND) set(CURL_CA_BUNDLE "none" CACHE STRING "Disable CA Bundle") set(CURL_CA_PATH "none" CACHE STRING "Disable CA Path") - add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/libcurl libcurl) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl libcurl) set(libcurl_FOUND 1 PARENT_SCOPE) endif() diff --git a/primedev/cmake/Findminhook.cmake b/primedev/cmake/Findminhook.cmake new file mode 100644 index 00000000..aaf66c92 --- /dev/null +++ b/primedev/cmake/Findminhook.cmake @@ -0,0 +1,7 @@ + +if(NOT minhook_FOUND) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook) + + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook minhook) + set(minhook_FOUND 1) +endif() diff --git a/cmake/Findminizip.cmake b/primedev/cmake/Findminizip.cmake index 15cfa373..ab48656a 100644 --- a/cmake/Findminizip.cmake +++ b/primedev/cmake/Findminizip.cmake @@ -1,6 +1,6 @@ if(NOT minizip_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/thirdparty/minizip) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip) set(MZ_ZLIB ON CACHE BOOL "Enable ZLIB compression, needed for DEFLATE") set(MZ_BZIP2 OFF CACHE BOOL "Disable BZIP2 compression") @@ -10,7 +10,7 @@ if(NOT minizip_FOUND) set(MZ_ZSTD OFF CACHE BOOL "Disable ZSTD compression") set(MZ_SIGNING OFF CACHE BOOL "Disable zip signing support") - add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/minizip minizip) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip minizip) set(minizip_FOUND 1 PARENT_SCOPE) endif() diff --git a/primedev/cmake/Findspdlog.cmake b/primedev/cmake/Findspdlog.cmake new file mode 100644 index 00000000..81596762 --- /dev/null +++ b/primedev/cmake/Findspdlog.cmake @@ -0,0 +1,7 @@ + +if(NOT spdlog_FOUND) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog) + + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog spdlog) + set(spdlog_FOUND 1) +endif() diff --git a/cmake/utils.cmake b/primedev/cmake/utils.cmake index d8450551..d8450551 100644 --- a/cmake/utils.cmake +++ b/primedev/cmake/utils.cmake diff --git a/NorthstarDLL/config/profile.cpp b/primedev/config/profile.cpp index d5361efa..d5361efa 100644 --- a/NorthstarDLL/config/profile.cpp +++ b/primedev/config/profile.cpp diff --git a/NorthstarDLL/config/profile.h b/primedev/config/profile.h index 9f3087fb..9f3087fb 100644 --- a/NorthstarDLL/config/profile.h +++ b/primedev/config/profile.h diff --git a/NorthstarDLL/core/convar/concommand.cpp b/primedev/core/convar/concommand.cpp index 41f54c76..41f54c76 100644 --- a/NorthstarDLL/core/convar/concommand.cpp +++ b/primedev/core/convar/concommand.cpp diff --git a/NorthstarDLL/core/convar/concommand.h b/primedev/core/convar/concommand.h index c11c7ea4..71a82fec 100644 --- a/NorthstarDLL/core/convar/concommand.h +++ b/primedev/core/convar/concommand.h @@ -4,7 +4,7 @@ class ConCommandBase; class IConCommandBaseAccessor { - public: +public: // Flags is a combination of FCVAR flags in cvar.h. // hOut is filled in with a handle to the variable. virtual bool RegisterConCommandBase(ConCommandBase* pVar) = 0; @@ -12,7 +12,7 @@ class IConCommandBaseAccessor class CCommand { - public: +public: CCommand() = delete; int64_t ArgC() const; @@ -24,7 +24,7 @@ class CCommand static int MaxCommandLength(); - private: +private: enum { COMMAND_MAX_ARGC = 64, @@ -88,7 +88,7 @@ typedef int (*FnCommandCompletionCallback)(const char* partial, char commands[CO // From r5reloaded class ConCommandBase { - public: +public: bool HasFlags(int nFlags); void AddFlags(int nFlags); void RemoveFlags(int nFlags); @@ -120,7 +120,7 @@ class ConCommand : public ConCommandBase { friend class CCVar; - public: +public: ConCommand(void) {}; // !TODO: Rebuild engine constructor in SDK instead. ConCommand(const char* szName, const char* szHelpString, int nFlags, void* pCallback, void* pCommandCompletionCallback); void Init(void); diff --git a/NorthstarDLL/core/convar/convar.cpp b/primedev/core/convar/convar.cpp index 594989c2..e77ae1fd 100644 --- a/NorthstarDLL/core/convar/convar.cpp +++ b/primedev/core/convar/convar.cpp @@ -38,14 +38,14 @@ ON_DLL_LOAD("engine.dll", ConVar, (CModule module)) g_pConVar_Vtable = module.Offset(0x67FD28); g_pIConVar_Vtable = module.Offset(0x67FDC8); - R2::g_pCVarInterface = new SourceInterface<CCvar>("vstdlib.dll", "VEngineCvar007"); - R2::g_pCVar = *R2::g_pCVarInterface; + g_pCVarInterface = new SourceInterface<CCvar>("vstdlib.dll", "VEngineCvar007"); + g_pCVar = *g_pCVarInterface; g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = reinterpret_cast<PluginConVarMallocType>(conVarMalloc); g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = reinterpret_cast<PluginConVarRegisterType>(conVarRegister); g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = reinterpret_cast<void*>(g_pConVar_Vtable); g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = reinterpret_cast<void*>(g_pIConVar_Vtable); - g_pPluginCommunicationhandler->m_sEngineData.g_pCVar = reinterpret_cast<void*>(R2::g_pCVar); + g_pPluginCommunicationhandler->m_sEngineData.g_pCVar = reinterpret_cast<void*>(g_pCVar); } //----------------------------------------------------------------------------- diff --git a/NorthstarDLL/core/convar/convar.h b/primedev/core/convar/convar.h index 4b00e25f..f0366b46 100644 --- a/NorthstarDLL/core/convar/convar.h +++ b/primedev/core/convar/convar.h @@ -124,7 +124,7 @@ typedef void (*FnChangeCallback_t)(ConVar* var, const char* pOldValue, float flO //----------------------------------------------------------------------------- class ConVar { - public: +public: ConVar(void) {}; ConVar(const char* pszName, const char* pszDefaultValue, int nFlags, const char* pszHelpString); ConVar( diff --git a/NorthstarDLL/core/convar/cvar.cpp b/primedev/core/convar/cvar.cpp index 21f8d2ec..aa5f0365 100644 --- a/NorthstarDLL/core/convar/cvar.cpp +++ b/primedev/core/convar/cvar.cpp @@ -22,9 +22,5 @@ std::unordered_map<std::string, ConCommandBase*> CCvar::DumpToMap() return allConVars; } -// use the R2 namespace for game funcs -namespace R2 -{ - SourceInterface<CCvar>* g_pCVarInterface; - CCvar* g_pCVar; -} // namespace R2 +SourceInterface<CCvar>* g_pCVarInterface; +CCvar* g_pCVar; diff --git a/NorthstarDLL/core/convar/cvar.h b/primedev/core/convar/cvar.h index 3a3e1815..beaa84f4 100644 --- a/NorthstarDLL/core/convar/cvar.h +++ b/primedev/core/convar/cvar.h @@ -13,7 +13,7 @@ class ConVar; //----------------------------------------------------------------------------- class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function. { - public: +public: virtual void SetFirst(void) = 0; // 0 virtual void Next(void) = 0; // 1 virtual bool IsValid(void) = 0; // 2 @@ -25,7 +25,7 @@ class CCVarIteratorInternal // Fully reversed table, just look at the virtual fu //----------------------------------------------------------------------------- class CCvar { - public: +public: M_VMETHOD(ConCommandBase*, FindCommandBase, 14, (const char* pszCommandName), (this, pszCommandName)); M_VMETHOD(ConVar*, FindVar, 16, (const char* pszVarName), (this, pszVarName)); M_VMETHOD(ConCommand*, FindCommand, 18, (const char* pszCommandName), (this, pszCommandName)); @@ -34,9 +34,5 @@ class CCvar std::unordered_map<std::string, ConCommandBase*> DumpToMap(); }; -// use the R2 namespace for game funcs -namespace R2 -{ - extern SourceInterface<CCvar>* g_pCVarInterface; - extern CCvar* g_pCVar; -} // namespace R2 +extern SourceInterface<CCvar>* g_pCVarInterface; +extern CCvar* g_pCVar; diff --git a/NorthstarDLL/core/filesystem/filesystem.cpp b/primedev/core/filesystem/filesystem.cpp index e4da647f..b39939e4 100644 --- a/NorthstarDLL/core/filesystem/filesystem.cpp +++ b/primedev/core/filesystem/filesystem.cpp @@ -7,48 +7,42 @@ AUTOHOOK_INIT() -using namespace R2; - bool bReadingOriginalFile = false; std::string sCurrentModPath; ConVar* Cvar_ns_fs_log_reads; -// use the R2 namespace for game funcs -namespace R2 +SourceInterface<IFileSystem>* g_pFilesystem; + +std::string ReadVPKFile(const char* path) { - SourceInterface<IFileSystem>* g_pFilesystem; + // read scripts.rson file, todo: check if this can be overwritten + FileHandle_t fileHandle = (*g_pFilesystem)->m_vtable2->Open(&(*g_pFilesystem)->m_vtable2, path, "rb", "GAME", 0); - std::string ReadVPKFile(const char* path) + std::stringstream fileStream; + int bytesRead = 0; + char data[4096]; + do { - // read scripts.rson file, todo: check if this can be overwritten - FileHandle_t fileHandle = (*g_pFilesystem)->m_vtable2->Open(&(*g_pFilesystem)->m_vtable2, path, "rb", "GAME", 0); - - std::stringstream fileStream; - int bytesRead = 0; - char data[4096]; - do - { - bytesRead = (*g_pFilesystem)->m_vtable2->Read(&(*g_pFilesystem)->m_vtable2, data, (int)std::size(data), fileHandle); - fileStream.write(data, bytesRead); - } while (bytesRead == std::size(data)); + bytesRead = (*g_pFilesystem)->m_vtable2->Read(&(*g_pFilesystem)->m_vtable2, data, (int)std::size(data), fileHandle); + fileStream.write(data, bytesRead); + } while (bytesRead == std::size(data)); - (*g_pFilesystem)->m_vtable2->Close(*g_pFilesystem, fileHandle); + (*g_pFilesystem)->m_vtable2->Close(*g_pFilesystem, fileHandle); - return fileStream.str(); - } + return fileStream.str(); +} - std::string ReadVPKOriginalFile(const char* path) - { - // todo: should probably set search path to be g_pModName here also +std::string ReadVPKOriginalFile(const char* path) +{ + // todo: should probably set search path to be g_pModName here also - bReadingOriginalFile = true; - std::string ret = ReadVPKFile(path); - bReadingOriginalFile = false; + bReadingOriginalFile = true; + std::string ret = ReadVPKFile(path); + bReadingOriginalFile = false; - return ret; - } -} // namespace R2 + return ret; +} // clang-format off HOOK(AddSearchPathHook, AddSearchPath, @@ -175,7 +169,7 @@ ON_DLL_LOAD("filesystem_stdio.dll", Filesystem, (CModule module)) { AUTOHOOK_DISPATCH() - R2::g_pFilesystem = new SourceInterface<IFileSystem>("filesystem_stdio.dll", "VFileSystem017"); + g_pFilesystem = new SourceInterface<IFileSystem>("filesystem_stdio.dll", "VFileSystem017"); AddSearchPathHook.Dispatch((LPVOID)(*g_pFilesystem)->m_vtable->AddSearchPath); ReadFromCacheHook.Dispatch((LPVOID)(*g_pFilesystem)->m_vtable->ReadFromCache); diff --git a/NorthstarDLL/core/filesystem/filesystem.h b/primedev/core/filesystem/filesystem.h index ac1c5986..fcd1bb2f 100644 --- a/NorthstarDLL/core/filesystem/filesystem.h +++ b/primedev/core/filesystem/filesystem.h @@ -29,14 +29,14 @@ enum SearchPathAdd_t class CSearchPath { - public: +public: unsigned char unknown[0x18]; const char* debugPath; }; class IFileSystem { - public: +public: struct VTable { void* unknown[10]; @@ -63,11 +63,7 @@ class IFileSystem VTable2* m_vtable2; }; -// use the R2 namespace for game funcs -namespace R2 -{ - extern SourceInterface<IFileSystem>* g_pFilesystem; +extern SourceInterface<IFileSystem>* g_pFilesystem; - std::string ReadVPKFile(const char* path); - std::string ReadVPKOriginalFile(const char* path); -} // namespace R2 +std::string ReadVPKFile(const char* path); +std::string ReadVPKOriginalFile(const char* path); diff --git a/NorthstarDLL/core/filesystem/rpakfilesystem.cpp b/primedev/core/filesystem/rpakfilesystem.cpp index 8d50b07a..da72646b 100644 --- a/NorthstarDLL/core/filesystem/rpakfilesystem.cpp +++ b/primedev/core/filesystem/rpakfilesystem.cpp @@ -209,8 +209,8 @@ int, __fastcall, (char* pPath, void* unknownSingleton, int flags, void* pCallbac // dedicated only needs common, common_mp, common_sp, and sp_<map> rpaks // sp_<map> rpaks contain tutorial ghost data // sucks to have to load the entire rpak for that but sp was never meant to be done on dedi - if (IsDedicatedServer() && (Tier0::CommandLine()->CheckParm("-nopakdedi") || - strncmp(&originalPath[0], "common", 6) && strncmp(&originalPath[0], "sp_", 3))) + if (IsDedicatedServer() && + (CommandLine()->CheckParm("-nopakdedi") || strncmp(&originalPath[0], "common", 6) && strncmp(&originalPath[0], "sp_", 3))) { if (bNeedToFreePakName) delete[] pPath; diff --git a/NorthstarDLL/core/filesystem/rpakfilesystem.h b/primedev/core/filesystem/rpakfilesystem.h index 3f608dba..bcd57a73 100644 --- a/NorthstarDLL/core/filesystem/rpakfilesystem.h +++ b/primedev/core/filesystem/rpakfilesystem.h @@ -17,11 +17,11 @@ struct LoadedPak class PakLoadManager { - private: +private: std::map<int, LoadedPak> m_vLoadedPaks {}; std::unordered_map<size_t, int> m_HashToPakHandle {}; - public: +public: int LoadPakAsync(const char* pPath, const ePakLoadSource nLoadSource); void UnloadPak(const int nPakHandle); void UnloadMapPaks(); diff --git a/NorthstarDLL/core/hooks.cpp b/primedev/core/hooks.cpp index 26b3fe57..26b3fe57 100644 --- a/NorthstarDLL/core/hooks.cpp +++ b/primedev/core/hooks.cpp diff --git a/NorthstarDLL/core/hooks.h b/primedev/core/hooks.h index 01244b3d..15edbf0b 100644 --- a/NorthstarDLL/core/hooks.h +++ b/primedev/core/hooks.h @@ -25,7 +25,7 @@ enum class eDllLoadCallbackSide class __dllLoadCallback { - public: +public: __dllLoadCallback() = delete; __dllLoadCallback( eDllLoadCallbackSide side, @@ -67,7 +67,7 @@ class __autovar; class __fileAutohook { - public: +public: std::vector<__autohook*> hooks; std::vector<__autovar*> vars; @@ -91,7 +91,7 @@ uintptr_t ParseDLLOffsetString(const char* pAddrString); class __autohook { - public: +public: enum AddressResolutionMode { OFFSET_STRING, // we're using a string that of the format dllname.dll + offset @@ -111,7 +111,7 @@ class __autohook char* pModuleName; // for PROCADDRESS char* pProcName; // for PROCADDRESS - public: +public: __autohook() = delete; __autohook(__fileAutohook* autohook, const char* funcName, LPVOID absoluteAddress, LPVOID* orig, LPVOID func) @@ -250,13 +250,13 @@ class __autohook class ManualHook { - public: +public: char* pFuncName; LPVOID pHookFunc; LPVOID* ppOrigFunc; - public: +public: ManualHook() = delete; ManualHook(const char* funcName, LPVOID func); ManualHook(const char* funcName, LPVOID* orig, LPVOID func); @@ -284,11 +284,11 @@ void MakeHook(LPVOID pTarget, LPVOID pDetour, void* ppOriginal, const char* pFun class __autovar { - public: +public: char* m_pAddrString; void** m_pTarget; - public: +public: __autovar(__fileAutohook* pAutohook, const char* pAddrString, void** pTarget) { m_pTarget = pTarget; diff --git a/NorthstarDLL/core/macros.h b/primedev/core/macros.h index ae944cca..ae944cca 100644 --- a/NorthstarDLL/core/macros.h +++ b/primedev/core/macros.h diff --git a/NorthstarDLL/core/math/bitbuf.h b/primedev/core/math/bitbuf.h index 8e8e216f..5ca75455 100644 --- a/NorthstarDLL/core/math/bitbuf.h +++ b/primedev/core/math/bitbuf.h @@ -89,13 +89,13 @@ enum EBitCoordType class BitBufferBase { - protected: +protected: INLINE void SetName(const char* name) { m_BufferName = name; } - public: +public: INLINE bool IsOverflowed() { return m_Overflow; @@ -110,16 +110,16 @@ class BitBufferBase return m_BufferName; } - private: +private: const char* m_BufferName = ""; - protected: +protected: u8 m_Overflow = false; }; class BFRead : public BitBufferBase { - public: +public: BFRead() = default; INLINE BFRead(uptr data, size_t byteLength, size_t startPos = 0, const char* bufferName = 0) @@ -130,7 +130,7 @@ class BFRead : public BitBufferBase SetName(bufferName); } - public: +public: INLINE void StartReading(uptr data, size_t byteLength, size_t startPos = 0) { m_Data = reinterpret_cast<u32 const*>(data); @@ -706,7 +706,7 @@ class BFRead : public BitBufferBase return GetNumBitsLeft() >> 3; } - private: +private: size_t m_DataBits; // 0x0010 size_t m_DataBytes; // 0x0018 @@ -720,7 +720,7 @@ class BFRead : public BitBufferBase class BFWrite : public BitBufferBase { - public: +public: BFWrite() = default; INLINE BFWrite(uptr data, size_t byteLength, const char* bufferName = 0) @@ -731,7 +731,7 @@ class BFWrite : public BitBufferBase SetName(bufferName); } - public: +public: INLINE void StartWriting(uptr data, size_t byteLength) { m_Data = reinterpret_cast<u32*>(data); @@ -1131,7 +1131,7 @@ class BFWrite : public BitBufferBase WriteBitVec3Coord(tmp); }*/ - private: +private: size_t m_DataBits = 0; size_t m_DataBytes = 0; diff --git a/NorthstarDLL/core/math/bits.cpp b/primedev/core/math/bits.cpp index c879a45c..c879a45c 100644 --- a/NorthstarDLL/core/math/bits.cpp +++ b/primedev/core/math/bits.cpp diff --git a/NorthstarDLL/core/math/bits.h b/primedev/core/math/bits.h index 0532a9bd..0532a9bd 100644 --- a/NorthstarDLL/core/math/bits.h +++ b/primedev/core/math/bits.h diff --git a/NorthstarDLL/core/math/color.cpp b/primedev/core/math/color.cpp index 7b98043a..7b98043a 100644 --- a/NorthstarDLL/core/math/color.cpp +++ b/primedev/core/math/color.cpp diff --git a/NorthstarDLL/core/math/color.h b/primedev/core/math/color.h index 76cf8a47..013c4e4c 100644 --- a/NorthstarDLL/core/math/color.h +++ b/primedev/core/math/color.h @@ -57,7 +57,7 @@ struct SourceColor //----------------------------------------------------------------------------- class Color { - public: +public: Color(int r, int g, int b, int a = 255) { _color[0] = (unsigned char)r; @@ -169,7 +169,7 @@ class Color return SourceColor(_color[0], _color[1], _color[2], _color[3]); } - private: +private: unsigned char _color[4]; }; diff --git a/NorthstarDLL/core/math/vector.h b/primedev/core/math/vector.h index 8684908f..8684908f 100644 --- a/NorthstarDLL/core/math/vector.h +++ b/primedev/core/math/vector.h diff --git a/NorthstarDLL/core/memalloc.cpp b/primedev/core/memalloc.cpp index 69ce6f54..0a75bc2b 100644 --- a/NorthstarDLL/core/memalloc.cpp +++ b/primedev/core/memalloc.cpp @@ -1,8 +1,6 @@ #include "core/memalloc.h" #include "core/tier0.h" -using namespace Tier0; - // TODO: rename to malloc and free after removing statically compiled .libs extern "C" void* _malloc_base(size_t n) diff --git a/NorthstarDLL/core/memalloc.h b/primedev/core/memalloc.h index 97f60012..2f383335 100644 --- a/NorthstarDLL/core/memalloc.h +++ b/primedev/core/memalloc.h @@ -17,7 +17,7 @@ void operator delete(void* p) noexcept; class SourceAllocator { - public: +public: static const bool kNeedFree = true; void* Malloc(size_t size) { diff --git a/NorthstarDLL/core/memory.cpp b/primedev/core/memory.cpp index 3770586f..3770586f 100644 --- a/NorthstarDLL/core/memory.cpp +++ b/primedev/core/memory.cpp diff --git a/NorthstarDLL/core/memory.h b/primedev/core/memory.h index db0a38b3..a978963e 100644 --- a/NorthstarDLL/core/memory.h +++ b/primedev/core/memory.h @@ -2,10 +2,10 @@ class CMemoryAddress { - public: +public: uintptr_t m_nAddress; - public: +public: CMemoryAddress(); CMemoryAddress(const uintptr_t nAddress); CMemoryAddress(const void* pAddress); @@ -47,7 +47,7 @@ class CMemoryAddress // based on https://github.com/Mauler125/r5sdk/blob/master/r5dev/public/include/module.h class CModule : public CMemoryAddress { - public: +public: struct ModuleSections_t { ModuleSections_t(void) = default; @@ -71,7 +71,7 @@ class CModule : public CMemoryAddress ModuleSections_t m_RunTimeData; ModuleSections_t m_ReadOnlyData; - private: +private: std::string m_svModuleName; uintptr_t m_pModuleBase {}; DWORD m_nModuleSize {}; @@ -79,7 +79,7 @@ class CModule : public CMemoryAddress IMAGE_DOS_HEADER* m_pDOSHeader = nullptr; std::vector<ModuleSections_t> m_vModuleSections; - public: +public: CModule() = delete; // no default, we need a module name CModule(const HMODULE pModule); CModule(const char* pModuleName); diff --git a/NorthstarDLL/core/sourceinterface.cpp b/primedev/core/sourceinterface.cpp index 5a72beb0..5a72beb0 100644 --- a/NorthstarDLL/core/sourceinterface.cpp +++ b/primedev/core/sourceinterface.cpp diff --git a/NorthstarDLL/core/sourceinterface.h b/primedev/core/sourceinterface.h index 474e961b..7b5e81f3 100644 --- a/NorthstarDLL/core/sourceinterface.h +++ b/primedev/core/sourceinterface.h @@ -6,10 +6,10 @@ typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode); template <typename T> class SourceInterface { - private: +private: T* m_interface; - public: +public: SourceInterface(const std::string& moduleName, const std::string& interfaceName) { HMODULE handle = GetModuleHandleA(moduleName.c_str()); diff --git a/NorthstarDLL/core/structs.h b/primedev/core/structs.h index 037233a6..037233a6 100644 --- a/NorthstarDLL/core/structs.h +++ b/primedev/core/structs.h diff --git a/primedev/core/tier0.cpp b/primedev/core/tier0.cpp new file mode 100644 index 00000000..1f59722c --- /dev/null +++ b/primedev/core/tier0.cpp @@ -0,0 +1,30 @@ +#include "tier0.h" + +IMemAlloc* g_pMemAllocSingleton = nullptr; + +CommandLineType CommandLine; +Plat_FloatTimeType Plat_FloatTime; +ThreadInServerFrameThreadType ThreadInServerFrameThread; + +typedef IMemAlloc* (*CreateGlobalMemAllocType)(); +CreateGlobalMemAllocType CreateGlobalMemAlloc; + +// needs to be a seperate function, since memalloc.cpp calls it +void TryCreateGlobalMemAlloc() +{ + // init memalloc stuff + CreateGlobalMemAlloc = + reinterpret_cast<CreateGlobalMemAllocType>(GetProcAddress(GetModuleHandleA("tier0.dll"), "CreateGlobalMemAlloc")); + g_pMemAllocSingleton = CreateGlobalMemAlloc(); // if it already exists, this returns the preexisting IMemAlloc instance +} + +ON_DLL_LOAD("tier0.dll", Tier0GameFuncs, (CModule module)) +{ + // shouldn't be necessary, but do this just in case + TryCreateGlobalMemAlloc(); + + // setup tier0 funcs + CommandLine = module.GetExport("CommandLine").RCast<CommandLineType>(); + Plat_FloatTime = module.GetExport("Plat_FloatTime").RCast<Plat_FloatTimeType>(); + ThreadInServerFrameThread = module.GetExport("ThreadInServerFrameThread").RCast<ThreadInServerFrameThreadType>(); +} diff --git a/primedev/core/tier0.h b/primedev/core/tier0.h new file mode 100644 index 00000000..cc9af39e --- /dev/null +++ b/primedev/core/tier0.h @@ -0,0 +1,63 @@ +#pragma once + +class IMemAlloc +{ +public: + struct VTable + { + void* unknown[1]; // alloc debug + void* (*Alloc)(IMemAlloc* memAlloc, size_t nSize); + void* unknown2[1]; // realloc debug + void* (*Realloc)(IMemAlloc* memAlloc, void* pMem, size_t nSize); + void* unknown3[1]; // free #1 + void (*Free)(IMemAlloc* memAlloc, void* pMem); + void* unknown4[2]; // nullsubs, maybe CrtSetDbgFlag + size_t (*GetSize)(IMemAlloc* memAlloc, void* pMem); + void* unknown5[9]; // they all do literally nothing + void (*DumpStats)(IMemAlloc* memAlloc); + void (*DumpStatsFileBase)(IMemAlloc* memAlloc, const char* pchFileBase); + void* unknown6[4]; + int (*heapchk)(IMemAlloc* memAlloc); + }; + + VTable* m_vtable; +}; + +class CCommandLine +{ +public: + // based on the defs in the 2013 source sdk, but for some reason has an extra function (may be another CreateCmdLine overload?) + // these seem to line up with what they should be though + virtual void CreateCmdLine(const char* commandline) = 0; + virtual void CreateCmdLine(int argc, char** argv) = 0; + virtual void unknown() = 0; + virtual const char* GetCmdLine(void) const = 0; + + virtual const char* CheckParm(const char* psz, const char** ppszValue = 0) const = 0; + virtual void RemoveParm() const = 0; + virtual void AppendParm(const char* pszParm, const char* pszValues) = 0; + + virtual const char* ParmValue(const char* psz, const char* pDefaultVal = 0) const = 0; + virtual int ParmValue(const char* psz, int nDefaultVal) const = 0; + virtual float ParmValue(const char* psz, float flDefaultVal) const = 0; + + virtual int ParmCount() const = 0; + virtual int FindParm(const char* psz) const = 0; + virtual const char* GetParm(int nIndex) const = 0; + virtual void SetParm(int nIndex, char const* pParm) = 0; + + // virtual const char** GetParms() const {} +}; + +extern IMemAlloc* g_pMemAllocSingleton; + +typedef CCommandLine* (*CommandLineType)(); +extern CommandLineType CommandLine; + +typedef double (*Plat_FloatTimeType)(); +extern Plat_FloatTimeType Plat_FloatTime; + +typedef bool (*ThreadInServerFrameThreadType)(); +extern ThreadInServerFrameThreadType ThreadInServerFrameThread; + +void TryCreateGlobalMemAlloc(); diff --git a/NorthstarDLL/core/vanilla.h b/primedev/core/vanilla.h index fb809a1a..b0797803 100644 --- a/NorthstarDLL/core/vanilla.h +++ b/primedev/core/vanilla.h @@ -6,7 +6,7 @@ /// as well as various other small changes for compatibility class VanillaCompatibility { - public: +public: void SetVanillaCompatibility(bool isVanilla) { static bool bInitialised = false; @@ -22,7 +22,7 @@ class VanillaCompatibility return m_bIsVanillaCompatible; } - private: +private: bool m_bIsVanillaCompatible = false; }; diff --git a/NorthstarDLL/dedicated/dedicated.cpp b/primedev/dedicated/dedicated.cpp index 34282f51..df6e5787 100644 --- a/NorthstarDLL/dedicated/dedicated.cpp +++ b/primedev/dedicated/dedicated.cpp @@ -10,8 +10,6 @@ AUTOHOOK_INIT() -using namespace R2; - bool IsDedicatedServer() { static bool result = strstr(GetCommandLineA(), "-dedicated"); @@ -43,15 +41,15 @@ void Sys_Printf(CDedicatedExports* dedicated, const char* msg) void RunServer(CDedicatedExports* dedicated) { spdlog::info("CDedicatedExports::RunServer(): starting"); - spdlog::info(Tier0::CommandLine()->GetCmdLine()); + spdlog::info(CommandLine()->GetCmdLine()); // initialise engine g_pEngine->Frame(); // add +map if no map loading command is present // don't manually execute this from cbuf as users may have it in their startup args anyway, easier just to run from stuffcmds if present - if (!Tier0::CommandLine()->CheckParm("+map") && !Tier0::CommandLine()->CheckParm("+launchplaylist")) - Tier0::CommandLine()->AppendParm("+map", g_pCVar->FindVar("match_defaultMap")->GetString()); + if (!CommandLine()->CheckParm("+map") && !CommandLine()->CheckParm("+launchplaylist")) + CommandLine()->AppendParm("+map", g_pCVar->FindVar("match_defaultMap")->GetString()); // re-run commandline Cbuf_AddText(Cbuf_GetCurrentPlayer(), "stuffcmds", cmd_source_t::kCommandSrcCode); @@ -61,11 +59,11 @@ void RunServer(CDedicatedExports* dedicated) double frameTitle = 0; while (g_pEngine->m_nQuitting == EngineQuitState::QUIT_NOTQUITTING) { - double frameStart = Tier0::Plat_FloatTime(); + double frameStart = Plat_FloatTime(); g_pEngine->Frame(); std::this_thread::sleep_for( - std::chrono::duration<double, std::ratio<1>>(g_pGlobals->m_flTickInterval - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25))); + std::chrono::duration<double, std::ratio<1>>(g_pGlobals->m_flTickInterval - fmin(Plat_FloatTime() - frameStart, 0.25))); } } @@ -215,13 +213,13 @@ ON_DLL_LOAD_DEDI_RELIESON("engine.dll", DedicatedServer, ServerPresence, (CModul // make sure it still gets registered // add cmdline args that are good for dedi - Tier0::CommandLine()->AppendParm("-nomenuvid", 0); - Tier0::CommandLine()->AppendParm("-nosound", 0); - Tier0::CommandLine()->AppendParm("-windowed", 0); - Tier0::CommandLine()->AppendParm("-nomessagebox", 0); - Tier0::CommandLine()->AppendParm("+host_preload_shaders", "0"); - Tier0::CommandLine()->AppendParm("+net_usesocketsforloopback", "1"); - Tier0::CommandLine()->AppendParm("+community_frame_run", "0"); + CommandLine()->AppendParm("-nomenuvid", 0); + CommandLine()->AppendParm("-nosound", 0); + CommandLine()->AppendParm("-windowed", 0); + CommandLine()->AppendParm("-nomessagebox", 0); + CommandLine()->AppendParm("+host_preload_shaders", "0"); + CommandLine()->AppendParm("+net_usesocketsforloopback", "1"); + CommandLine()->AppendParm("+community_frame_run", "0"); // use presence reporter for console title DedicatedConsoleServerPresence* presenceReporter = new DedicatedConsoleServerPresence; @@ -231,7 +229,7 @@ ON_DLL_LOAD_DEDI_RELIESON("engine.dll", DedicatedServer, ServerPresence, (CModul RegisterCustomSink(std::make_shared<DedicatedServerLogToClientSink>()); // Disable Quick Edit mode to reduce chance of user unintentionally hanging their server by selecting something. - if (!Tier0::CommandLine()->CheckParm("-bringbackquickedit")) + if (!CommandLine()->CheckParm("-bringbackquickedit")) { HANDLE stdIn = GetStdHandle(STD_INPUT_HANDLE); DWORD mode = 0; @@ -253,7 +251,7 @@ ON_DLL_LOAD_DEDI_RELIESON("engine.dll", DedicatedServer, ServerPresence, (CModul spdlog::info("Quick Edit enabled by user request"); // create console input thread - if (!Tier0::CommandLine()->CheckParm("-noconsoleinput")) + if (!CommandLine()->CheckParm("-noconsoleinput")) consoleInputThreadHandle = CreateThread(0, 0, ConsoleInputThread, 0, 0, NULL); else spdlog::info("Console input disabled by user request"); @@ -288,7 +286,7 @@ ON_DLL_LOAD_DEDI("server.dll", DedicatedServerGameDLL, (CModule module)) { AUTOHOOK_DISPATCH_MODULE(server.dll) - if (Tier0::CommandLine()->CheckParm("-nopakdedi")) + if (CommandLine()->CheckParm("-nopakdedi")) { module.Offset(0x6BA350).Patch("C3"); // dont load skins.rson from rpak if we don't have rpaks, as loading it will cause a crash module.Offset(0x6BA300).Patch( diff --git a/NorthstarDLL/dedicated/dedicated.h b/primedev/dedicated/dedicated.h index 82806763..82806763 100644 --- a/NorthstarDLL/dedicated/dedicated.h +++ b/primedev/dedicated/dedicated.h diff --git a/NorthstarDLL/dedicated/dedicatedlogtoclient.cpp b/primedev/dedicated/dedicatedlogtoclient.cpp index a48b1b39..bf2cf77a 100644 --- a/NorthstarDLL/dedicated/dedicatedlogtoclient.cpp +++ b/primedev/dedicated/dedicatedlogtoclient.cpp @@ -1,11 +1,11 @@ #include "dedicatedlogtoclient.h" #include "engine/r2engine.h" -void (*CGameClient__ClientPrintf)(R2::CBaseClient* pClient, const char* fmt, ...); +void (*CGameClient__ClientPrintf)(CBaseClient* pClient, const char* fmt, ...); void DedicatedServerLogToClientSink::custom_sink_it_(const custom_log_msg& msg) { - if (*R2::g_pServerState == R2::server_state_t::ss_dead) + if (*g_pServerState == server_state_t::ss_dead) return; enum class eSendPrintsToClient @@ -15,17 +15,17 @@ void DedicatedServerLogToClientSink::custom_sink_it_(const custom_log_msg& msg) ALL }; - static const ConVar* Cvar_dedi_sendPrintsToClient = R2::g_pCVar->FindVar("dedi_sendPrintsToClient"); + static const ConVar* Cvar_dedi_sendPrintsToClient = g_pCVar->FindVar("dedi_sendPrintsToClient"); eSendPrintsToClient eSendPrints = static_cast<eSendPrintsToClient>(Cvar_dedi_sendPrintsToClient->GetInt()); if (eSendPrints == eSendPrintsToClient::NONE) return; std::string sLogMessage = fmt::format("[DEDICATED SERVER] [{}] {}", level_names[msg.level], msg.payload); - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) { - R2::CBaseClient* pClient = &R2::g_pClientArray[i]; + CBaseClient* pClient = &g_pClientArray[i]; - if (pClient->m_Signon >= R2::eSignonState::CONNECTED) + if (pClient->m_Signon >= eSignonState::CONNECTED) { CGameClient__ClientPrintf(pClient, sLogMessage.c_str()); @@ -44,5 +44,5 @@ void DedicatedServerLogToClientSink::flush_() {} ON_DLL_LOAD_DEDI("engine.dll", DedicatedServerLogToClient, (CModule module)) { - CGameClient__ClientPrintf = module.Offset(0x1016A0).RCast<void (*)(R2::CBaseClient*, const char*, ...)>(); + CGameClient__ClientPrintf = module.Offset(0x1016A0).RCast<void (*)(CBaseClient*, const char*, ...)>(); } diff --git a/NorthstarDLL/dedicated/dedicatedlogtoclient.h b/primedev/dedicated/dedicatedlogtoclient.h index 16f1e584..82f4c56b 100644 --- a/NorthstarDLL/dedicated/dedicatedlogtoclient.h +++ b/primedev/dedicated/dedicatedlogtoclient.h @@ -4,7 +4,7 @@ class DedicatedServerLogToClientSink : public CustomSink { - protected: +protected: void custom_sink_it_(const custom_log_msg& msg); void sink_it_(const spdlog::details::log_msg& msg) override; void flush_() override; diff --git a/NorthstarDLL/dedicated/dedicatedmaterialsystem.cpp b/primedev/dedicated/dedicatedmaterialsystem.cpp index 5bd6ea93..01078086 100644 --- a/NorthstarDLL/dedicated/dedicatedmaterialsystem.cpp +++ b/primedev/dedicated/dedicatedmaterialsystem.cpp @@ -23,7 +23,7 @@ HRESULT, __stdcall, ( // really call gpu much even with renderthread still being a thing will be using this hook for actual d3d stubbing and stuff later // note: this has been succeeded by the d3d11 and gfsdk stubs, and is only being kept around for posterity and as a fallback option - if (Tier0::CommandLine()->CheckParm("-softwared3d11")) + if (CommandLine()->CheckParm("-softwared3d11")) DriverType = 5; // D3D_DRIVER_TYPE_WARP return D3D11CreateDevice( diff --git a/NorthstarDLL/dllmain.cpp b/primedev/dllmain.cpp index 3d9bdc97..3d9bdc97 100644 --- a/NorthstarDLL/dllmain.cpp +++ b/primedev/dllmain.cpp diff --git a/NorthstarDLL/dllmain.h b/primedev/dllmain.h index 0debf379..0debf379 100644 --- a/NorthstarDLL/dllmain.h +++ b/primedev/dllmain.h diff --git a/NorthstarDLL/engine/host.cpp b/primedev/engine/host.cpp index 49cc3663..dacb8fc1 100644 --- a/NorthstarDLL/engine/host.cpp +++ b/primedev/engine/host.cpp @@ -22,9 +22,9 @@ void, __fastcall, (bool bDedicated)) // client/server autoexecs on necessary platforms // dedi needs autoexec_ns_server on boot, while non-dedi will run it on on listen server start if (bDedicated) - R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", R2::cmd_source_t::kCommandSrcCode); + Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", cmd_source_t::kCommandSrcCode); else - R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_client", R2::cmd_source_t::kCommandSrcCode); + Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec autoexec_ns_client", cmd_source_t::kCommandSrcCode); } ON_DLL_LOAD("engine.dll", Host_Init, (CModule module)) diff --git a/NorthstarDLL/engine/hoststate.cpp b/primedev/engine/hoststate.cpp index 1734a1c3..ec728afb 100644 --- a/NorthstarDLL/engine/hoststate.cpp +++ b/primedev/engine/hoststate.cpp @@ -12,13 +12,7 @@ AUTOHOOK_INIT() -using namespace R2; - -// use the R2 namespace for game funcs -namespace R2 -{ - CHostState* g_pHostState; -} // namespace R2 +CHostState* g_pHostState; std::string sLastMode; @@ -35,15 +29,14 @@ void ServerStartingOrChangingMap() memset(commandBuf, 0, sizeof(commandBuf)); CCommand tempCommand = *(CCommand*)&commandBuf; if (sLastMode.length() && - CCommand__Tokenize( - tempCommand, fmt::format("exec server/cleanup_gamemode_{}", sLastMode).c_str(), R2::cmd_source_t::kCommandSrcCode)) + CCommand__Tokenize(tempCommand, fmt::format("exec server/cleanup_gamemode_{}", sLastMode).c_str(), cmd_source_t::kCommandSrcCode)) _Cmd_Exec_f(tempCommand, false, false); memset(commandBuf, 0, sizeof(commandBuf)); if (CCommand__Tokenize( tempCommand, fmt::format("exec server/setup_gamemode_{}", sLastMode = Cvar_mp_gamemode->GetString()).c_str(), - R2::cmd_source_t::kCommandSrcCode)) + cmd_source_t::kCommandSrcCode)) { _Cmd_Exec_f(tempCommand, false, false); } @@ -73,18 +66,18 @@ void, __fastcall, (CHostState* self)) // need to do this to ensure we don't go to private match if (g_pServerAuthentication->m_bNeedLocalAuthForNewgame) - SetCurrentPlaylist("tdm"); + R2::SetCurrentPlaylist("tdm"); ServerStartingOrChangingMap(); - double dStartTime = Tier0::Plat_FloatTime(); + double dStartTime = Plat_FloatTime(); CHostState__State_NewGame(self); - spdlog::info("loading took {}s", Tier0::Plat_FloatTime() - dStartTime); + spdlog::info("loading took {}s", Plat_FloatTime() - dStartTime); // setup server presence g_pServerPresence->CreatePresence(); g_pServerPresence->SetMap(g_pHostState->m_levelName, true); - g_pServerPresence->SetPlaylist(GetCurrentPlaylistName()); + g_pServerPresence->SetPlaylist(R2::GetCurrentPlaylistName()); g_pServerPresence->SetPort(Cvar_hostport->GetInt()); g_pServerAuthentication->m_bNeedLocalAuthForNewgame = false; @@ -107,9 +100,9 @@ void, __fastcall, (CHostState* self)) g_pCVar->FindVar("net_data_block_enabled")->SetValue(true); g_pServerAuthentication->m_bStartingLocalSPGame = true; - double dStartTime = Tier0::Plat_FloatTime(); + double dStartTime = Plat_FloatTime(); CHostState__State_LoadGame(self); - spdlog::info("loading took {}s", Tier0::Plat_FloatTime() - dStartTime); + spdlog::info("loading took {}s", Plat_FloatTime() - dStartTime); // no server presence, can't do it because no map name in hoststate // and also not super important for sp saves really @@ -126,9 +119,9 @@ void, __fastcall, (CHostState* self)) ServerStartingOrChangingMap(); - double dStartTime = Tier0::Plat_FloatTime(); + double dStartTime = Plat_FloatTime(); CHostState__State_ChangeLevelMP(self); - spdlog::info("loading took {}s", Tier0::Plat_FloatTime() - dStartTime); + spdlog::info("loading took {}s", Plat_FloatTime() - dStartTime); g_pServerPresence->SetMap(g_pHostState->m_levelName); } @@ -151,7 +144,7 @@ void, __fastcall, (CHostState* self)) memset(commandBuf, 0, sizeof(commandBuf)); CCommand tempCommand = *(CCommand*)&commandBuf; if (CCommand__Tokenize( - tempCommand, fmt::format("exec server/cleanup_gamemode_{}", sLastMode).c_str(), R2::cmd_source_t::kCommandSrcCode)) + tempCommand, fmt::format("exec server/cleanup_gamemode_{}", sLastMode).c_str(), cmd_source_t::kCommandSrcCode)) { _Cmd_Exec_f(tempCommand, false, false); Cbuf_Execute(); @@ -168,7 +161,7 @@ void, __fastcall, (CHostState* self, double flCurrentTime, float flFrameTime)) { CHostState__FrameUpdate(self, flCurrentTime, flFrameTime); - if (*R2::g_pServerState == R2::server_state_t::ss_active) + if (*g_pServerState == server_state_t::ss_active) { // update server presence g_pServerPresence->RunFrame(flCurrentTime); diff --git a/primedev/engine/hoststate.h b/primedev/engine/hoststate.h new file mode 100644 index 00000000..290903ab --- /dev/null +++ b/primedev/engine/hoststate.h @@ -0,0 +1,41 @@ +#pragma once + +enum class HostState_t +{ + HS_NEW_GAME = 0, + HS_LOAD_GAME, + HS_CHANGE_LEVEL_SP, + HS_CHANGE_LEVEL_MP, + HS_RUN, + HS_GAME_SHUTDOWN, + HS_SHUTDOWN, + HS_RESTART, +}; + +struct CHostState +{ +public: + HostState_t m_iCurrentState; + HostState_t m_iNextState; + + float m_vecLocation[3]; + float m_angLocation[3]; + + char m_levelName[32]; + char m_mapGroupName[32]; + char m_landmarkName[32]; + char m_saveName[32]; + float m_flShortFrameTime; // run a few one-tick frames to avoid large timesteps while loading assets + + bool m_activeGame; + bool m_bRememberLocation; + bool m_bBackgroundLevel; + bool m_bWaitingForConnection; + bool m_bLetToolsOverrideLoadGameEnts; // During a load game, this tells Foundry to override ents that are selected in Hammer. + bool m_bSplitScreenConnect; + bool m_bGameHasShutDownAndFlushedMemory; // This is false once we load a map into memory, and set to true once the map is unloaded + // and all memory flushed + bool m_bWorkshopMapDownloadPending; +}; + +extern CHostState* g_pHostState; diff --git a/NorthstarDLL/engine/r2engine.cpp b/primedev/engine/r2engine.cpp index 67a628fd..88500376 100644 --- a/NorthstarDLL/engine/r2engine.cpp +++ b/primedev/engine/r2engine.cpp @@ -1,28 +1,22 @@ #include "r2engine.h" -using namespace R2; +Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer; +Cbuf_AddTextType Cbuf_AddText; +Cbuf_ExecuteType Cbuf_Execute; -// use the R2 namespace for game funcs -namespace R2 -{ - Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer; - Cbuf_AddTextType Cbuf_AddText; - Cbuf_ExecuteType Cbuf_Execute; - - bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, R2::cmd_source_t commandSource); +bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, cmd_source_t commandSource); - CEngine* g_pEngine; +CEngine* g_pEngine; - void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...); - CBaseClient* g_pClientArray; +void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...); +CBaseClient* g_pClientArray; - server_state_t* g_pServerState; +server_state_t* g_pServerState; - char* g_pModName = - nullptr; // we cant set this up here atm since we dont have an offset to it in engine, instead we store it in IsRespawnMod +char* g_pModName = + nullptr; // we cant set this up here atm since we dont have an offset to it in engine, instead we store it in IsRespawnMod - CGlobalVars* g_pGlobals; -} // namespace R2 +CGlobalVars* g_pGlobals; ON_DLL_LOAD("engine.dll", R2Engine, (CModule module)) { @@ -30,7 +24,7 @@ ON_DLL_LOAD("engine.dll", R2Engine, (CModule module)) Cbuf_AddText = module.Offset(0x1203B0).RCast<Cbuf_AddTextType>(); Cbuf_Execute = module.Offset(0x1204B0).RCast<Cbuf_ExecuteType>(); - CCommand__Tokenize = module.Offset(0x418380).RCast<bool (*)(CCommand&, const char*, R2::cmd_source_t)>(); + CCommand__Tokenize = module.Offset(0x418380).RCast<bool (*)(CCommand&, const char*, cmd_source_t)>(); g_pEngine = module.Offset(0x7D70C8).Deref().RCast<CEngine*>(); diff --git a/primedev/engine/r2engine.h b/primedev/engine/r2engine.h new file mode 100644 index 00000000..e3bcc37e --- /dev/null +++ b/primedev/engine/r2engine.h @@ -0,0 +1,260 @@ +#pragma once +#include "shared/keyvalues.h" + +// Cbuf +enum class ECommandTarget_t +{ + CBUF_FIRST_PLAYER = 0, + CBUF_LAST_PLAYER = 1, // MAX_SPLITSCREEN_CLIENTS - 1, MAX_SPLITSCREEN_CLIENTS = 2 + CBUF_SERVER = CBUF_LAST_PLAYER + 1, + + CBUF_COUNT, +}; + +enum class cmd_source_t +{ + // Added to the console buffer by gameplay code. Generally unrestricted. + kCommandSrcCode, + + // Sent from code via engine->ClientCmd, which is restricted to commands visible + // via FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS. + kCommandSrcClientCmd, + + // Typed in at the console or via a user key-bind. Generally unrestricted, although + // the client will throttle commands sent to the server this way to 16 per second. + kCommandSrcUserInput, + + // Came in over a net connection as a clc_stringcmd + // host_client will be valid during this state. + // + // Restricted to FCVAR_GAMEDLL commands (but not convars) and special non-ConCommand + // server commands hardcoded into gameplay code (e.g. "joingame") + kCommandSrcNetClient, + + // Received from the server as the client + // + // Restricted to commands with FCVAR_SERVER_CAN_EXECUTE + kCommandSrcNetServer, + + // Being played back from a demo file + // + // Not currently restricted by convar flag, but some commands manually ignore calls + // from this source. FIXME: Should be heavily restricted as demo commands can come + // from untrusted sources. + kCommandSrcDemoFile, + + // Invalid value used when cleared + kCommandSrcInvalid = -1 +}; + +typedef ECommandTarget_t (*Cbuf_GetCurrentPlayerType)(); +extern Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer; + +typedef void (*Cbuf_AddTextType)(ECommandTarget_t eTarget, const char* text, cmd_source_t source); +extern Cbuf_AddTextType Cbuf_AddText; + +typedef void (*Cbuf_ExecuteType)(); +extern Cbuf_ExecuteType Cbuf_Execute; + +extern bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, cmd_source_t commandSource); + +// CEngine + +enum EngineQuitState +{ + QUIT_NOTQUITTING = 0, + QUIT_TODESKTOP, + QUIT_RESTART +}; + +enum class EngineState_t +{ + DLL_INACTIVE = 0, // no dll + DLL_ACTIVE, // engine is focused + DLL_CLOSE, // closing down dll + DLL_RESTART, // engine is shutting down but will restart right away + DLL_PAUSED, // engine is paused, can become active from this state +}; + +class CEngine +{ +public: + virtual void unknown() = 0; // unsure if this is where + virtual bool Load(bool dedicated, const char* baseDir) = 0; + virtual void Unload() = 0; + virtual void SetNextState(EngineState_t iNextState) = 0; + virtual EngineState_t GetState() = 0; + virtual void Frame() = 0; + virtual double GetFrameTime() = 0; + virtual float GetCurTime() = 0; + + EngineQuitState m_nQuitting; + EngineState_t m_nDllState; + EngineState_t m_nNextDllState; + double m_flCurrentTime; + float m_flFrameTime; + double m_flPreviousTime; + float m_flFilteredTime; + float m_flMinFrameTime; // Expected duration of a frame, or zero if it is unlimited. +}; + +extern CEngine* g_pEngine; + +extern void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...); + +#pragma once +typedef enum +{ + NA_NULL = 0, + NA_LOOPBACK, + NA_IP, +} netadrtype_t; + +#pragma pack(push, 1) +typedef struct netadr_s +{ + netadrtype_t type; + unsigned char ip[16]; // IPv6 + // IPv4's 127.0.0.1 is [::ffff:127.0.0.1], that is: + // 00 00 00 00 00 00 00 00 00 00 FF FF 7F 00 00 01 + unsigned short port; +} netadr_t; +#pragma pack(pop) + +#pragma pack(push, 1) +typedef struct netpacket_s +{ + netadr_t adr; // sender address + // int source; // received source + char unk[10]; + double received_time; + unsigned char* data; // pointer to raw packet data + void* message; // easy bitbuf data access // 'inpacket.message' etc etc (pointer) + char unk2[16]; + int size; + + // bf_read message; // easy bitbuf data access // 'inpacket.message' etc etc (pointer) + // int size; // size in bytes + // int wiresize; // size in bytes before decompression + // bool stream; // was send as stream + // struct netpacket_s* pNext; // for internal use, should be NULL in public +} netpacket_t; +#pragma pack(pop) + +// #56169 $DB69 PData size +// #512 $200 Trailing data +// #100 $64 Safety buffer +const int PERSISTENCE_MAX_SIZE = 0xDDCD; + +// note: NOT_READY and READY are the only entries we have here that are defined by the vanilla game +// entries after this are custom and used to determine the source of persistence, e.g. whether it is local or remote +enum class ePersistenceReady : char +{ + NOT_READY, + READY = 3, + READY_INSECURE = 3, + READY_REMOTE +}; + +enum class eSignonState : int +{ + NONE = 0, // no state yet; about to connect + CHALLENGE = 1, // client challenging server; all OOB packets + CONNECTED = 2, // client is connected to server; netchans ready + NEW = 3, // just got serverinfo and string tables + PRESPAWN = 4, // received signon buffers + GETTINGDATA = 5, // respawn-defined signonstate, assumedly this is for persistence + SPAWN = 6, // ready to receive entity packets + FIRSTSNAP = 7, // another respawn-defined one + FULL = 8, // we are fully connected; first non-delta packet received + CHANGELEVEL = 9, // server is changing level; please wait +}; + +// clang-format off +OFFSET_STRUCT(CBaseClient) +{ + STRUCT_SIZE(0x2D728) + FIELD(0x16, char m_Name[64]) + FIELD(0x258, KeyValues* m_ConVars) + FIELD(0x2A0, eSignonState m_Signon) + FIELD(0x358, char m_ClanTag[16]) + FIELD(0x484, bool m_bFakePlayer) + FIELD(0x4A0, ePersistenceReady m_iPersistenceReady) + FIELD(0x4FA, char m_PersistenceBuffer[PERSISTENCE_MAX_SIZE]) + FIELD(0xF500, char m_UID[32]) +}; +// clang-format on + +extern CBaseClient* g_pClientArray; + +enum server_state_t +{ + ss_dead = 0, // Dead + ss_loading, // Spawning + ss_active, // Running + ss_paused, // Running, but paused +}; + +extern server_state_t* g_pServerState; + +extern char* g_pModName; + +// clang-format off +OFFSET_STRUCT(CGlobalVars) +{ + FIELD(0x0, + // Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time + // perf clock, but not that it doesn't obey host_timescale/host_framerate) + double m_flRealTime); + + FIELDS(0x8, + // Absolute frame counter - continues to increase even if game is paused + int m_nFrameCount; + + // Non-paused frametime + float m_flAbsoluteFrameTime; + + // Current time + // + // On the client, this (along with tickcount) takes a different meaning based on what + // piece of code you're in: + // + // - While receiving network packets (like in PreDataUpdate/PostDataUpdate and proxies), + // this is set to the SERVER TICKCOUNT for that packet. There is no interval between + // the server ticks. + // [server_current_Tick * tick_interval] + // + // - While rendering, this is the exact client clock + // [client_current_tick * tick_interval + interpolation_amount] + // + // - During prediction, this is based on the client's current tick: + // [client_current_tick * tick_interval] + float m_flCurTime; + ) + + FIELDS(0x30, + // Time spent on last server or client frame (has nothing to do with think intervals) + float m_flFrameTime; + + // current maxplayers setting + int m_nMaxClients; + ) + + FIELDS(0x3C, + // Simulation ticks - does not increase when game is paused + uint32_t m_nTickCount; // this is weird and doesn't seem to increase once per frame? + + // Simulation tick interval + float m_flTickInterval; + ) + + FIELDS(0x60, + const char* m_pMapName; + int m_nMapVersion; + ) + + //FIELD(0x98, double m_flRealTime); // again? +}; +// clang-format on + +extern CGlobalVars* g_pGlobals; diff --git a/NorthstarDLL/engine/runframe.cpp b/primedev/engine/runframe.cpp index 40a619bb..ddfd9253 100644 --- a/NorthstarDLL/engine/runframe.cpp +++ b/primedev/engine/runframe.cpp @@ -7,7 +7,7 @@ AUTOHOOK_INIT() // clang-format off AUTOHOOK(CEngine__Frame, engine.dll + 0x1C8650, -void, __fastcall, (R2::CEngine* self)) +void, __fastcall, (CEngine* self)) // clang-format on { CEngine__Frame(self); diff --git a/NorthstarDLL/logging/crashhandler.cpp b/primedev/logging/crashhandler.cpp index a01de5a1..a01de5a1 100644 --- a/NorthstarDLL/logging/crashhandler.cpp +++ b/primedev/logging/crashhandler.cpp diff --git a/NorthstarDLL/logging/crashhandler.h b/primedev/logging/crashhandler.h index e18de948..c059a8ca 100644 --- a/NorthstarDLL/logging/crashhandler.h +++ b/primedev/logging/crashhandler.h @@ -7,7 +7,7 @@ //----------------------------------------------------------------------------- class CCrashHandler { - public: +public: CCrashHandler(); ~CCrashHandler(); @@ -77,7 +77,7 @@ class CCrashHandler //----------------------------------------------------------------------------- void WriteMinidump(); - private: +private: PVOID m_hExceptionFilter; EXCEPTION_POINTERS* m_pExceptionInfos; diff --git a/NorthstarDLL/logging/logging.cpp b/primedev/logging/logging.cpp index 3416bb8c..3416bb8c 100644 --- a/NorthstarDLL/logging/logging.cpp +++ b/primedev/logging/logging.cpp diff --git a/NorthstarDLL/logging/logging.h b/primedev/logging/logging.h index af4b506c..5056af27 100644 --- a/NorthstarDLL/logging/logging.h +++ b/primedev/logging/logging.h @@ -13,7 +13,7 @@ class ColoredLogger; struct custom_log_msg : spdlog::details::log_msg { - public: +public: custom_log_msg(ColoredLogger* origin, spdlog::details::log_msg msg) : origin(origin), spdlog::details::log_msg(msg) {} ColoredLogger* origin; @@ -21,7 +21,7 @@ struct custom_log_msg : spdlog::details::log_msg class CustomSink : public spdlog::sinks::base_sink<std::mutex> { - public: +public: void custom_log(const custom_log_msg& msg); virtual void custom_sink_it_(const custom_log_msg& msg) { @@ -31,7 +31,7 @@ class CustomSink : public spdlog::sinks::base_sink<std::mutex> class ColoredLogger : public spdlog::logger { - public: +public: std::string ANSIColor; SourceColor SRCColor; @@ -117,7 +117,7 @@ static const char* level_names[] {"trac", "dbug", "info", "warn", "errr", "crit" // spdlog logger, for cool colour things class ExternalConsoleSink : public CustomSink { - private: +private: std::map<spdlog::level::level_enum, std::string> m_LogColours = { {spdlog::level::trace, NS::Colors::TRACE.ToANSIColor()}, {spdlog::level::debug, NS::Colors::DEBUG.ToANSIColor()}, @@ -129,7 +129,7 @@ class ExternalConsoleSink : public CustomSink std::string default_color = "\033[39;49m"; - protected: +protected: void sink_it_(const spdlog::details::log_msg& msg) override; void custom_sink_it_(const custom_log_msg& msg); void flush_() override; diff --git a/NorthstarDLL/logging/loghooks.cpp b/primedev/logging/loghooks.cpp index 41e1bce2..7efb5b99 100644 --- a/NorthstarDLL/logging/loghooks.cpp +++ b/primedev/logging/loghooks.cpp @@ -24,7 +24,7 @@ enum class TextMsgPrintType_t class ICenterPrint { - public: +public: virtual void ctor() = 0; virtual void Clear(void) = 0; virtual void ColorPrint(int r, int g, int b, int a, wchar_t* text) = 0; diff --git a/NorthstarDLL/logging/loghooks.h b/primedev/logging/loghooks.h index 6f70f09b..6f70f09b 100644 --- a/NorthstarDLL/logging/loghooks.h +++ b/primedev/logging/loghooks.h diff --git a/NorthstarDLL/logging/sourceconsole.cpp b/primedev/logging/sourceconsole.cpp index e436d1d4..e436d1d4 100644 --- a/NorthstarDLL/logging/sourceconsole.cpp +++ b/primedev/logging/sourceconsole.cpp diff --git a/NorthstarDLL/logging/sourceconsole.h b/primedev/logging/sourceconsole.h index 3abcc470..44d73843 100644 --- a/NorthstarDLL/logging/sourceconsole.h +++ b/primedev/logging/sourceconsole.h @@ -5,14 +5,14 @@ class EditablePanel { - public: +public: virtual ~EditablePanel() = 0; unsigned char unknown[0x2B0]; }; class IConsoleDisplayFunc { - public: +public: virtual void ColorPrint(const SourceColor& clr, const char* pMessage) = 0; virtual void Print(const char* pMessage) = 0; virtual void DPrint(const char* pMessage) = 0; @@ -24,7 +24,7 @@ class CConsolePanel : public EditablePanel, public IConsoleDisplayFunc class CConsoleDialog { - public: +public: struct VTable { void* unknown[298]; @@ -38,7 +38,7 @@ class CConsoleDialog class CGameConsole { - public: +public: virtual ~CGameConsole() = 0; // activates the console, makes it visible and brings it to the foreground @@ -66,7 +66,7 @@ extern SourceInterface<CGameConsole>* g_pSourceGameConsole; // spdlog logger class SourceConsoleSink : public CustomSink { - private: +private: std::map<spdlog::level::level_enum, SourceColor> m_LogColours = { {spdlog::level::trace, NS::Colors::TRACE.ToSourceColor()}, {spdlog::level::debug, NS::Colors::DEBUG.ToSourceColor()}, @@ -76,7 +76,7 @@ class SourceConsoleSink : public CustomSink {spdlog::level::critical, NS::Colors::CRIT.ToSourceColor()}, {spdlog::level::off, NS::Colors::OFF.ToSourceColor()}}; - protected: +protected: void custom_sink_it_(const custom_log_msg& msg); void sink_it_(const spdlog::details::log_msg& msg) override; void flush_() override; diff --git a/NorthstarDLL/masterserver/masterserver.cpp b/primedev/masterserver/masterserver.cpp index 53a5fa9a..aa248464 100644 --- a/NorthstarDLL/masterserver/masterserver.cpp +++ b/primedev/masterserver/masterserver.cpp @@ -64,7 +64,7 @@ void SetCommonHttpClientOptions(CURL* curl) // seconds. curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L); // curl_easy_setopt(curl, CURLOPT_STDERR, stdout); - if (Tier0::CommandLine()->FindParm("-msinsecure")) // TODO: this check doesn't seem to work + if (CommandLine()->FindParm("-msinsecure")) // TODO: this check doesn't seem to work { curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); @@ -589,7 +589,7 @@ void MasterServerManager::AuthenticateWithOwnServer(const char* uid, const char* if (m_bNewgameAfterSelfAuth) { // pretty sure this is threadsafe? - R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "ns_end_reauth_and_leave_to_lobby", R2::cmd_source_t::kCommandSrcCode); + Cbuf_AddText(Cbuf_GetCurrentPlayer(), "ns_end_reauth_and_leave_to_lobby", cmd_source_t::kCommandSrcCode); m_bNewgameAfterSelfAuth = false; } @@ -897,12 +897,12 @@ void MasterServerManager::ProcessConnectionlessPacketSigreq1(std::string data) return; } - if (pdata.length() > R2::PERSISTENCE_MAX_SIZE) + if (pdata.length() > PERSISTENCE_MAX_SIZE) { spdlog::error( "failed to make Atlas connect pdata request {}: pdata is too large (max={} len={})", token, - R2::PERSISTENCE_MAX_SIZE, + PERSISTENCE_MAX_SIZE, pdata.length()); return; } @@ -1022,7 +1022,7 @@ void MasterServerPresenceReporter::ReportPresence(const ServerPresence* pServerP } // Make sure to wait til the cooldown is over for DUPLICATE_SERVER failures. - if (Tier0::Plat_FloatTime() < m_fNextAddServerAttemptTime) + if (Plat_FloatTime() < m_fNextAddServerAttemptTime) { return; } @@ -1124,7 +1124,7 @@ void MasterServerPresenceReporter::RunFrame(double flCurrentTime, const ServerPr case MasterServerReportPresenceResult::FailedDuplicateServer: ++m_nNumRegistrationAttempts; // Wait at least twenty seconds until we re-attempt to add the server. - m_fNextAddServerAttemptTime = Tier0::Plat_FloatTime() + 20.0f; + m_fNextAddServerAttemptTime = Plat_FloatTime() + 20.0f; break; } diff --git a/NorthstarDLL/masterserver/masterserver.h b/primedev/masterserver/masterserver.h index c4fa56c2..570db619 100644 --- a/NorthstarDLL/masterserver/masterserver.h +++ b/primedev/masterserver/masterserver.h @@ -13,14 +13,14 @@ extern ConVar* Cvar_ns_curl_log_enable; struct RemoteModInfo { - public: +public: std::string Name; std::string Version; }; class RemoteServerInfo { - public: +public: char id[33]; // 32 bytes + nullterminator // server info @@ -37,7 +37,7 @@ class RemoteServerInfo // connection stuff bool requiresPassword; - public: +public: RemoteServerInfo( const char* newId, const char* newName, @@ -52,7 +52,7 @@ class RemoteServerInfo struct RemoteServerConnectionInfo { - public: +public: char authToken[32]; in_addr ip; @@ -61,7 +61,7 @@ struct RemoteServerConnectionInfo struct MainMenuPromoData { - public: +public: std::string newInfoTitle1; std::string newInfoTitle2; std::string newInfoTitle3; @@ -82,11 +82,11 @@ struct MainMenuPromoData class MasterServerManager { - private: +private: bool m_bRequestingServerList = false; bool m_bAuthenticatingWithGameServer = false; - public: +public: char m_sOwnServerId[33]; char m_sOwnServerAuthToken[33]; char m_sOwnClientAuthToken[33]; @@ -123,7 +123,7 @@ class MasterServerManager std::unordered_set<std::string> m_handledServerConnections; - public: +public: MasterServerManager(); void ClearServerList(); @@ -156,7 +156,7 @@ enum class MasterServerReportPresenceResult class MasterServerPresenceReporter : public ServerPresenceReporter { - public: +public: /** Full data returned in the std::future of a MasterServerPresenceReporter::ReportPresence() call. */ struct ReportPresenceResultData { @@ -180,7 +180,7 @@ class MasterServerPresenceReporter : public ServerPresenceReporter // Called every frame. void RunFrame(double flCurrentTime, const ServerPresence* pServerPresence) override; - protected: +protected: // Contains the async logic to add the server to the MS. void InternalAddServer(const ServerPresence* pServerPresence); diff --git a/NorthstarDLL/mods/autodownload/moddownloader.cpp b/primedev/mods/autodownload/moddownloader.cpp index 165399e3..165399e3 100644 --- a/NorthstarDLL/mods/autodownload/moddownloader.cpp +++ b/primedev/mods/autodownload/moddownloader.cpp diff --git a/NorthstarDLL/mods/autodownload/moddownloader.h b/primedev/mods/autodownload/moddownloader.h index 747b3c01..5302c21e 100644 --- a/NorthstarDLL/mods/autodownload/moddownloader.h +++ b/primedev/mods/autodownload/moddownloader.h @@ -1,6 +1,6 @@ class ModDownloader { - private: +private: const char* VERIFICATION_FLAG = "-disablemodverification"; const char* CUSTOM_MODS_URL_FLAG = "-customverifiedurl="; const char* STORE_URL = "https://gcdn.thunderstore.io/live/repository/packages/"; @@ -70,7 +70,7 @@ class ModDownloader */ void ExtractMod(fs::path modPath); - public: +public: ModDownloader(); /** diff --git a/NorthstarDLL/mods/compiled/kb_act.cpp b/primedev/mods/compiled/kb_act.cpp index 3fc7ee30..6117fd28 100644 --- a/NorthstarDLL/mods/compiled/kb_act.cpp +++ b/primedev/mods/compiled/kb_act.cpp @@ -14,7 +14,7 @@ void ModManager::BuildKBActionsList() std::ofstream soCompiledKeys(GetCompiledAssetsPath() / KB_ACT_PATH, std::ios::binary); // write vanilla file's content to compiled file - soCompiledKeys << R2::ReadVPKOriginalFile(KB_ACT_PATH); + soCompiledKeys << ReadVPKOriginalFile(KB_ACT_PATH); for (Mod& mod : m_LoadedMods) { diff --git a/NorthstarDLL/mods/compiled/modkeyvalues.cpp b/primedev/mods/compiled/modkeyvalues.cpp index fe262a60..e44a81d3 100644 --- a/NorthstarDLL/mods/compiled/modkeyvalues.cpp +++ b/primedev/mods/compiled/modkeyvalues.cpp @@ -56,7 +56,7 @@ void ModManager::TryBuildKeyValues(const char* filename) newKvs += "\"\n"; // load original file, so we can parse out the name of the root obj (e.g. WeaponData for weapons) - std::string originalFile = R2::ReadVPKOriginalFile(filename); + std::string originalFile = ReadVPKOriginalFile(filename); if (!originalFile.length()) { diff --git a/NorthstarDLL/mods/compiled/modpdef.cpp b/primedev/mods/compiled/modpdef.cpp index 4b1b12b7..d268a063 100644 --- a/NorthstarDLL/mods/compiled/modpdef.cpp +++ b/primedev/mods/compiled/modpdef.cpp @@ -15,7 +15,7 @@ void ModManager::BuildPdef() fs::path MOD_PDEF_PATH = fs::path(GetCompiledAssetsPath() / MOD_PDEF_SUFFIX); fs::remove(MOD_PDEF_PATH); - std::string pdef = R2::ReadVPKOriginalFile(VPK_PDEF_PATH); + std::string pdef = ReadVPKOriginalFile(VPK_PDEF_PATH); for (Mod& mod : m_LoadedMods) { diff --git a/NorthstarDLL/mods/compiled/modscriptsrson.cpp b/primedev/mods/compiled/modscriptsrson.cpp index cbe26651..d130745f 100644 --- a/NorthstarDLL/mods/compiled/modscriptsrson.cpp +++ b/primedev/mods/compiled/modscriptsrson.cpp @@ -13,7 +13,7 @@ void ModManager::BuildScriptsRson() fs::path MOD_SCRIPTS_RSON_PATH = fs::path(GetCompiledAssetsPath() / MOD_SCRIPTS_RSON_SUFFIX); fs::remove(MOD_SCRIPTS_RSON_PATH); - std::string scriptsRson = R2::ReadVPKOriginalFile(VPK_SCRIPTS_RSON_PATH); + std::string scriptsRson = ReadVPKOriginalFile(VPK_SCRIPTS_RSON_PATH); scriptsRson += "\n\n// START MODDED SCRIPT CONTENT\n\n"; // newline before we start custom stuff for (Mod& mod : m_LoadedMods) diff --git a/NorthstarDLL/mods/modmanager.cpp b/primedev/mods/modmanager.cpp index 982f5068..8a0eb71d 100644 --- a/NorthstarDLL/mods/modmanager.cpp +++ b/primedev/mods/modmanager.cpp @@ -760,7 +760,7 @@ void ModManager::LoadMods() { // make sure convar isn't registered yet, unsure if necessary but idk what // behaviour is for defining same convar multiple times - if (!R2::g_pCVar->FindVar(convar->Name.c_str())) + if (!g_pCVar->FindVar(convar->Name.c_str())) { new ConVar(convar->Name.c_str(), convar->DefaultValue.c_str(), convar->Flags, convar->HelpString.c_str()); } @@ -769,7 +769,7 @@ void ModManager::LoadMods() for (ModConCommand* command : mod.ConCommands) { // make sure command isnt't registered multiple times. - if (!R2::g_pCVar->FindCommand(command->Name.c_str())) + if (!g_pCVar->FindCommand(command->Name.c_str())) { ConCommand* newCommand = new ConCommand(); std::string funcName = command->Function; @@ -818,7 +818,7 @@ void ModManager::LoadMods() modVpk.m_sVpkPath = (file.path().parent_path() / vpkName).string(); if (m_bHasLoadedMods && modVpk.m_bAutoLoad) - (*R2::g_pFilesystem)->m_vtable->MountVPK(*R2::g_pFilesystem, vpkName.c_str()); + (*g_pFilesystem)->m_vtable->MountVPK(*g_pFilesystem, vpkName.c_str()); } } } diff --git a/NorthstarDLL/mods/modmanager.h b/primedev/mods/modmanager.h index c141414f..233f004d 100644 --- a/NorthstarDLL/mods/modmanager.h +++ b/primedev/mods/modmanager.h @@ -19,7 +19,7 @@ const std::set<std::string> MODS_BLACKLIST = {"Mod Settings"}; struct ModConVar { - public: +public: std::string Name; std::string DefaultValue; std::string HelpString; @@ -28,7 +28,7 @@ struct ModConVar struct ModConCommand { - public: +public: std::string Name; std::string Function; std::string HelpString; @@ -38,7 +38,7 @@ struct ModConCommand struct ModScriptCallback { - public: +public: ScriptContext Context; // called before the codecallback is executed @@ -51,7 +51,7 @@ struct ModScriptCallback struct ModScript { - public: +public: std::string Path; std::string RunOn; @@ -61,14 +61,14 @@ struct ModScript // these are pretty much identical, could refactor to use the same stuff? struct ModVPKEntry { - public: +public: bool m_bAutoLoad; std::string m_sVpkPath; }; struct ModRpakEntry { - public: +public: bool m_bAutoLoad; std::string m_sPakName; std::string m_sLoadAfterPak; @@ -76,7 +76,7 @@ struct ModRpakEntry class Mod { - public: +public: // runtime stuff bool m_bEnabled = true; bool m_bWasReadSuccessfully = false; @@ -127,10 +127,10 @@ class Mod std::unordered_map<std::string, std::string> DependencyConstants; std::vector<std::string> PluginDependencyConstants; - public: +public: Mod(fs::path modPath, char* jsonBuf); - private: +private: void ParseConVars(rapidjson_document& json); void ParseConCommands(rapidjson_document& json); void ParseScripts(rapidjson_document& json); @@ -142,14 +142,14 @@ class Mod struct ModOverrideFile { - public: +public: Mod* m_pOwningMod; fs::path m_Path; }; class ModManager { - private: +private: bool m_bHasLoadedMods = false; bool m_bHasEnabledModsCfg; rapidjson_document m_EnabledModsCfg; @@ -159,13 +159,13 @@ class ModManager size_t m_hPdefHash; size_t m_hKBActHash; - public: +public: std::vector<Mod> m_LoadedMods; std::unordered_map<std::string, ModOverrideFile> m_ModFiles; std::unordered_map<std::string, std::string> m_DependencyConstants; std::unordered_set<std::string> m_PluginDependencyConstants; - public: +public: ModManager(); void LoadMods(); void UnloadMods(); diff --git a/NorthstarDLL/mods/modsavefiles.cpp b/primedev/mods/modsavefiles.cpp index f8e5848c..68e33864 100644 --- a/NorthstarDLL/mods/modsavefiles.cpp +++ b/primedev/mods/modsavefiles.cpp @@ -561,9 +561,9 @@ ON_DLL_LOAD("engine.dll", ModSaveFFiles_Init, (CModule module)) { savePath = fs::path(GetNorthstarPrefix()) / "save_data"; g_pSaveFileManager = new SaveFileManager; - int parm = Tier0::CommandLine()->FindParm("-maxfoldersize"); + int parm = CommandLine()->FindParm("-maxfoldersize"); if (parm) - MAX_FOLDER_SIZE = std::stoi(Tier0::CommandLine()->GetParm(parm)); + MAX_FOLDER_SIZE = std::stoi(CommandLine()->GetParm(parm)); } int GetMaxSaveFolderSize() diff --git a/NorthstarDLL/mods/modsavefiles.h b/primedev/mods/modsavefiles.h index a50fe62c..f9d39723 100644 --- a/NorthstarDLL/mods/modsavefiles.h +++ b/primedev/mods/modsavefiles.h @@ -4,13 +4,13 @@ bool ContainsInvalidChars(std::string str); class SaveFileManager { - public: +public: template <ScriptContext context> void SaveFileAsync(fs::path file, std::string content); template <ScriptContext context> int LoadFileAsync(fs::path file); template <ScriptContext context> void DeleteFileAsync(fs::path file); // Future proofed in that if we ever get multi-threaded SSDs this code will take advantage of them. std::mutex fileMutex; - private: +private: int m_iLastRequestHandle = 0; }; diff --git a/NorthstarDLL/ns_version.h b/primedev/ns_version.h index d30594fb..d30594fb 100644 --- a/NorthstarDLL/ns_version.h +++ b/primedev/ns_version.h diff --git a/NorthstarDLL/pch.h b/primedev/pch.h index b9ba0e08..b9ba0e08 100644 --- a/NorthstarDLL/pch.h +++ b/primedev/pch.h diff --git a/NorthstarDLL/plugins/plugin_abi.h b/primedev/plugins/plugin_abi.h index 16b26a1c..16b26a1c 100644 --- a/NorthstarDLL/plugins/plugin_abi.h +++ b/primedev/plugins/plugin_abi.h diff --git a/NorthstarDLL/plugins/pluginbackend.cpp b/primedev/plugins/pluginbackend.cpp index 850394ac..850394ac 100644 --- a/NorthstarDLL/plugins/pluginbackend.cpp +++ b/primedev/plugins/pluginbackend.cpp diff --git a/NorthstarDLL/plugins/pluginbackend.h b/primedev/plugins/pluginbackend.h index fc66a597..45cd42f3 100644 --- a/NorthstarDLL/plugins/pluginbackend.h +++ b/primedev/plugins/pluginbackend.h @@ -17,7 +17,7 @@ union PluginRespondDataCallable class PluginDataRequest { - public: +public: PluginDataRequestType type; PluginRespondDataCallable func; PluginDataRequest(PluginDataRequestType type, PluginRespondDataCallable func) : type(type), func(func) {} @@ -25,11 +25,11 @@ class PluginDataRequest class PluginCommunicationHandler { - public: +public: void RunFrame(); void PushRequest(PluginDataRequestType type, PluginRespondDataCallable func); - public: +public: std::queue<PluginDataRequest> requestQueue = {}; std::mutex requestMutex; diff --git a/NorthstarDLL/plugins/plugins.cpp b/primedev/plugins/plugins.cpp index 72b64566..72b64566 100644 --- a/NorthstarDLL/plugins/plugins.cpp +++ b/primedev/plugins/plugins.cpp diff --git a/NorthstarDLL/plugins/plugins.h b/primedev/plugins/plugins.h index d91b2811..4e841f27 100644 --- a/NorthstarDLL/plugins/plugins.h +++ b/primedev/plugins/plugins.h @@ -5,7 +5,7 @@ const int IDR_RCDATA1 = 101; class Plugin { - public: +public: std::string name; std::string displayName; std::string dependencyName; @@ -23,7 +23,7 @@ class Plugin bool run_on_client = false; bool run_on_server = false; - public: +public: PLUGIN_INIT_TYPE init; PLUGIN_INIT_SQVM_TYPE init_sqvm_client; PLUGIN_INIT_SQVM_TYPE init_sqvm_server; @@ -37,10 +37,10 @@ class Plugin class PluginManager { - public: +public: std::vector<Plugin> m_vLoadedPlugins; - public: +public: bool LoadPlugins(); std::optional<Plugin> LoadPlugin(fs::path path, PluginInitFuncs* funcs, PluginNorthstarData* data); @@ -52,7 +52,7 @@ class PluginManager void RunFrame(); - private: +private: std::string pluginPath; }; diff --git a/NorthstarLauncher/main.cpp b/primedev/primelauncher/main.cpp index ae745672..ae745672 100644 --- a/NorthstarLauncher/main.cpp +++ b/primedev/primelauncher/main.cpp diff --git a/NorthstarLauncher/ns_icon.ico b/primedev/primelauncher/ns_icon.ico Binary files differindex fc9ad166..fc9ad166 100644 --- a/NorthstarLauncher/ns_icon.ico +++ b/primedev/primelauncher/ns_icon.ico diff --git a/NorthstarDLL/resource1.h b/primedev/primelauncher/resource1.h index bb584502..bb584502 100644 --- a/NorthstarDLL/resource1.h +++ b/primedev/primelauncher/resource1.h diff --git a/NorthstarLauncher/resources.rc b/primedev/primelauncher/resources.rc index 32038499..43646122 100644 --- a/NorthstarLauncher/resources.rc +++ b/primedev/primelauncher/resources.rc @@ -1,7 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include "resource1.h" -#include "../NorthstarDLL/ns_version.h" +#include "../ns_version.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/NorthstarLauncher/resource1.h b/primedev/resource1.h index bb584502..bb584502 100644 --- a/NorthstarLauncher/resource1.h +++ b/primedev/resource1.h diff --git a/NorthstarDLL/resources.rc b/primedev/resources.rc index 7e996617..32739daa 100644 --- a/NorthstarDLL/resources.rc +++ b/primedev/resources.rc @@ -1,7 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include "resource1.h" -#include "../NorthstarDLL/ns_version.h" +#include "../primedev/ns_version.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/NorthstarDLL/scripts/client/clientchathooks.cpp b/primedev/scripts/client/clientchathooks.cpp index df9497ef..e084f47e 100644 --- a/NorthstarDLL/scripts/client/clientchathooks.cpp +++ b/primedev/scripts/client/clientchathooks.cpp @@ -30,7 +30,7 @@ void, __fastcall, (void* self, const char* message, int inboxId, bool isTeam, bo payload = message + 1; } - NS::Utils::RemoveAsciiControlSequences(const_cast<char*>(message), true); + RemoveAsciiControlSequences(const_cast<char*>(message), true); SQRESULT result = g_pSquirrel<ScriptContext::CLIENT>->Call( "CHudChat_ProcessMessageStartThread", static_cast<int>(senderId) - 1, payload, isTeam, isDead, type); diff --git a/NorthstarDLL/scripts/client/cursorposition.cpp b/primedev/scripts/client/cursorposition.cpp index c0e8623c..c0e8623c 100644 --- a/NorthstarDLL/scripts/client/cursorposition.cpp +++ b/primedev/scripts/client/cursorposition.cpp diff --git a/NorthstarDLL/scripts/client/scriptbrowserhooks.cpp b/primedev/scripts/client/scriptbrowserhooks.cpp index 86b4a356..86b4a356 100644 --- a/NorthstarDLL/scripts/client/scriptbrowserhooks.cpp +++ b/primedev/scripts/client/scriptbrowserhooks.cpp diff --git a/NorthstarDLL/scripts/client/scriptmainmenupromos.cpp b/primedev/scripts/client/scriptmainmenupromos.cpp index ecb47af7..ecb47af7 100644 --- a/NorthstarDLL/scripts/client/scriptmainmenupromos.cpp +++ b/primedev/scripts/client/scriptmainmenupromos.cpp diff --git a/NorthstarDLL/scripts/client/scriptmodmenu.cpp b/primedev/scripts/client/scriptmodmenu.cpp index a88478fb..a88478fb 100644 --- a/NorthstarDLL/scripts/client/scriptmodmenu.cpp +++ b/primedev/scripts/client/scriptmodmenu.cpp diff --git a/NorthstarDLL/scripts/client/scriptoriginauth.cpp b/primedev/scripts/client/scriptoriginauth.cpp index 420c4872..420c4872 100644 --- a/NorthstarDLL/scripts/client/scriptoriginauth.cpp +++ b/primedev/scripts/client/scriptoriginauth.cpp diff --git a/NorthstarDLL/scripts/client/scriptserverbrowser.cpp b/primedev/scripts/client/scriptserverbrowser.cpp index 1945b3dc..a142c3f4 100644 --- a/NorthstarDLL/scripts/client/scriptserverbrowser.cpp +++ b/primedev/scripts/client/scriptserverbrowser.cpp @@ -62,7 +62,7 @@ ADD_SQFUNC("void", NSTryAuthWithServer, "int serverIndex, string password = ''", // do auth g_pMasterServerManager->AuthenticateWithServer( - R2::g_pLocalPlayerUserID, + g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken, g_pMasterServerManager->m_vRemoteServers[serverIndex], (char*)password); @@ -95,9 +95,9 @@ ADD_SQFUNC("void", NSConnectToAuthedServer, "", "", ScriptContext::UI) // set auth token, then try to connect // i'm honestly not entirely sure how silentconnect works regarding ports and encryption so using connect for now - R2::g_pCVar->FindVar("serverfilter")->SetValue(info.authToken); - R2::Cbuf_AddText( - R2::Cbuf_GetCurrentPlayer(), + g_pCVar->FindVar("serverfilter")->SetValue(info.authToken); + Cbuf_AddText( + Cbuf_GetCurrentPlayer(), fmt::format( "connect {}.{}.{}.{}:{}", info.ip.S_un.S_un_b.s_b1, @@ -106,7 +106,7 @@ ADD_SQFUNC("void", NSConnectToAuthedServer, "", "", ScriptContext::UI) info.ip.S_un.S_un_b.s_b4, info.port) .c_str(), - R2::cmd_source_t::kCommandSrcCode); + cmd_source_t::kCommandSrcCode); g_pMasterServerManager->m_bHasPendingConnectionInfo = false; return SQRESULT_NULL; @@ -115,7 +115,7 @@ ADD_SQFUNC("void", NSConnectToAuthedServer, "", "", ScriptContext::UI) ADD_SQFUNC("void", NSTryAuthWithLocalServer, "", "", ScriptContext::UI) { // do auth request - g_pMasterServerManager->AuthenticateWithOwnServer(R2::g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken); + g_pMasterServerManager->AuthenticateWithOwnServer(g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken); return SQRESULT_NULL; } @@ -125,7 +125,7 @@ ADD_SQFUNC("void", NSCompleteAuthWithLocalServer, "", "", ScriptContext::UI) // literally just set serverfilter // note: this assumes we have no authdata other than our own if (g_pServerAuthentication->m_RemoteAuthenticationData.size()) - R2::g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str()); + g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str()); return SQRESULT_NULL; } diff --git a/NorthstarDLL/scripts/client/scriptservertoclientstringcommand.cpp b/primedev/scripts/client/scriptservertoclientstringcommand.cpp index a3a81c8a..a3a81c8a 100644 --- a/NorthstarDLL/scripts/client/scriptservertoclientstringcommand.cpp +++ b/primedev/scripts/client/scriptservertoclientstringcommand.cpp diff --git a/NorthstarDLL/scripts/scriptdatatables.cpp b/primedev/scripts/scriptdatatables.cpp index 532624f3..87a26dca 100644 --- a/NorthstarDLL/scripts/scriptdatatables.cpp +++ b/primedev/scripts/scriptdatatables.cpp @@ -132,9 +132,9 @@ REPLACE_SQFUNC(GetDataTable, (ScriptContext::UI | ScriptContext::CLIENT | Script diskAssetPath /= fs::path(pAssetName); std::string sDiskAssetPath(diskAssetPath.string()); - if ((*R2::g_pFilesystem)->m_vtable2->FileExists(&(*R2::g_pFilesystem)->m_vtable2, sDiskAssetPath.c_str(), "GAME")) + if ((*g_pFilesystem)->m_vtable2->FileExists(&(*g_pFilesystem)->m_vtable2, sDiskAssetPath.c_str(), "GAME")) { - std::string sTableCSV = R2::ReadVPKFile(sDiskAssetPath.c_str()); + std::string sTableCSV = ReadVPKFile(sDiskAssetPath.c_str()); if (!sTableCSV.size()) { g_pSquirrel<context>->raiseerror(sqvm, fmt::format("Datatable \"{}\" is empty", pAssetName).c_str()); @@ -793,7 +793,7 @@ void DumpDatatable(const char* pDatatablePath) return; } - std::string sOutputPath(fmt::format("{}/scripts/datatable/{}.csv", R2::g_pModName, fs::path(pDatatablePath).stem().string())); + std::string sOutputPath(fmt::format("{}/scripts/datatable/{}.csv", g_pModName, fs::path(pDatatablePath).stem().string())); std::string sDatatableContents(DataTableToString(pDatatable)); fs::create_directories(fs::path(sOutputPath).remove_filename()); @@ -900,7 +900,7 @@ ON_DLL_LOAD_RELIESON("engine.dll", SharedScriptDataTables, ConVar, (CModule modu { Cvar_ns_prefer_datatable_from_disk = new ConVar( "ns_prefer_datatable_from_disk", - IsDedicatedServer() && Tier0::CommandLine()->CheckParm("-nopakdedi") ? "1" : "0", + IsDedicatedServer() && CommandLine()->CheckParm("-nopakdedi") ? "1" : "0", FCVAR_NONE, "whether to prefer loading datatables from disk, rather than rpak"); diff --git a/NorthstarDLL/scripts/scripthttprequesthandler.cpp b/primedev/scripts/scripthttprequesthandler.cpp index 813bd50e..aa75127a 100644 --- a/NorthstarDLL/scripts/scripthttprequesthandler.cpp +++ b/primedev/scripts/scripthttprequesthandler.cpp @@ -7,19 +7,19 @@ HttpRequestHandler* g_httpRequestHandler; bool IsHttpDisabled() { - const static bool bIsHttpDisabled = Tier0::CommandLine()->FindParm("-disablehttprequests"); + const static bool bIsHttpDisabled = CommandLine()->FindParm("-disablehttprequests"); return bIsHttpDisabled; } bool IsLocalHttpAllowed() { - const static bool bIsLocalHttpAllowed = Tier0::CommandLine()->FindParm("-allowlocalhttp"); + const static bool bIsLocalHttpAllowed = CommandLine()->FindParm("-allowlocalhttp"); return bIsLocalHttpAllowed; } bool DisableHttpSsl() { - const static bool bDisableHttpSsl = Tier0::CommandLine()->FindParm("-disablehttpssl"); + const static bool bDisableHttpSsl = CommandLine()->FindParm("-disablehttpssl"); return bDisableHttpSsl; } diff --git a/NorthstarDLL/scripts/scripthttprequesthandler.h b/primedev/scripts/scripthttprequesthandler.h index 1f237bac..f3921f4e 100644 --- a/NorthstarDLL/scripts/scripthttprequesthandler.h +++ b/primedev/scripts/scripthttprequesthandler.h @@ -99,7 +99,7 @@ struct HttpRequest */ class HttpRequestHandler { - public: +public: HttpRequestHandler(); // Start/Stop the HTTP request handler. Right now this doesn't do much. @@ -122,7 +122,7 @@ class HttpRequestHandler /** Registers the HTTP request Squirrel functions for the given script context. */ template <ScriptContext context> void RegisterSQFuncs(); - private: +private: int m_iLastRequestHandle = 0; std::atomic_bool m_bIsHttpRequestHandlerRunning = false; }; diff --git a/NorthstarDLL/scripts/scriptjson.cpp b/primedev/scripts/scriptjson.cpp index 06bda6f4..06bda6f4 100644 --- a/NorthstarDLL/scripts/scriptjson.cpp +++ b/primedev/scripts/scriptjson.cpp diff --git a/NorthstarDLL/scripts/scriptjson.h b/primedev/scripts/scriptjson.h index b747106b..b747106b 100644 --- a/NorthstarDLL/scripts/scriptjson.h +++ b/primedev/scripts/scriptjson.h diff --git a/NorthstarDLL/scripts/scriptutility.cpp b/primedev/scripts/scriptutility.cpp index 054836ca..4b92fa02 100644 --- a/NorthstarDLL/scripts/scriptutility.cpp +++ b/primedev/scripts/scriptutility.cpp @@ -18,9 +18,9 @@ ADD_SQFUNC( ADD_SQFUNC( "string", NSGetLocalPlayerUID, "", "Returns the local player's uid.", ScriptContext::UI | ScriptContext::CLIENT | ScriptContext::SERVER) { - if (R2::g_pLocalPlayerUserID) + if (g_pLocalPlayerUserID) { - g_pSquirrel<context>->pushstring(sqvm, R2::g_pLocalPlayerUserID); + g_pSquirrel<context>->pushstring(sqvm, g_pLocalPlayerUserID); return SQRESULT_NOTNULL; } diff --git a/NorthstarDLL/scripts/server/miscserverfixes.cpp b/primedev/scripts/server/miscserverfixes.cpp index 48c2c111..48c2c111 100644 --- a/NorthstarDLL/scripts/server/miscserverfixes.cpp +++ b/primedev/scripts/server/miscserverfixes.cpp diff --git a/NorthstarDLL/scripts/server/miscserverscript.cpp b/primedev/scripts/server/miscserverscript.cpp index 3ea44ceb..ed6e4800 100644 --- a/NorthstarDLL/scripts/server/miscserverscript.cpp +++ b/primedev/scripts/server/miscserverscript.cpp @@ -9,7 +9,7 @@ ADD_SQFUNC("void", NSEarlyWritePlayerPersistenceForLeave, "entity player", "", ScriptContext::SERVER) { - const R2::CBasePlayer* pPlayer = g_pSquirrel<context>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<context>->template getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { spdlog::warn("NSEarlyWritePlayerPersistenceForLeave got null player"); @@ -18,7 +18,7 @@ ADD_SQFUNC("void", NSEarlyWritePlayerPersistenceForLeave, "entity player", "", S return SQRESULT_NOTNULL; } - R2::CBaseClient* pClient = &R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1]; + CBaseClient* pClient = &g_pClientArray[pPlayer->m_nPlayerIndex - 1]; if (g_pServerAuthentication->m_PlayerAuthenticationData.find(pClient) == g_pServerAuthentication->m_PlayerAuthenticationData.end()) { g_pSquirrel<context>->pushbool(sqvm, false); @@ -38,7 +38,7 @@ ADD_SQFUNC("bool", NSIsWritingPlayerPersistence, "", "", ScriptContext::SERVER) ADD_SQFUNC("bool", NSIsPlayerLocalPlayer, "entity player", "", ScriptContext::SERVER) { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { spdlog::warn("NSIsPlayerLocalPlayer got null player"); @@ -47,8 +47,8 @@ ADD_SQFUNC("bool", NSIsPlayerLocalPlayer, "entity player", "", ScriptContext::SE return SQRESULT_NOTNULL; } - R2::CBaseClient* pClient = &R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1]; - g_pSquirrel<context>->pushbool(sqvm, !strcmp(R2::g_pLocalPlayerUserID, pClient->m_UID)); + CBaseClient* pClient = &g_pClientArray[pPlayer->m_nPlayerIndex - 1]; + g_pSquirrel<context>->pushbool(sqvm, !strcmp(g_pLocalPlayerUserID, pClient->m_UID)); return SQRESULT_NOTNULL; } @@ -65,7 +65,7 @@ ADD_SQFUNC( "Disconnects the player from the server with the given reason", ScriptContext::SERVER) { - const R2::CBasePlayer* pPlayer = g_pSquirrel<context>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<context>->template getentity<CBasePlayer>(sqvm, 1); const char* reason = g_pSquirrel<context>->getstring(sqvm, 2); if (!pPlayer) @@ -77,7 +77,7 @@ ADD_SQFUNC( } // Shouldn't happen but I like sanity checks. - R2::CBaseClient* pClient = &R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1]; + CBaseClient* pClient = &g_pClientArray[pPlayer->m_nPlayerIndex - 1]; if (!pClient) { spdlog::warn("NSDisconnectPlayer(): player entity has null CBaseClient!"); @@ -88,11 +88,11 @@ ADD_SQFUNC( if (reason) { - R2::CBaseClient__Disconnect(pClient, 1, reason); + CBaseClient__Disconnect(pClient, 1, reason); } else { - R2::CBaseClient__Disconnect(pClient, 1, "Disconnected by the server."); + CBaseClient__Disconnect(pClient, 1, "Disconnected by the server."); } g_pSquirrel<context>->pushbool(sqvm, true); diff --git a/NorthstarDLL/scripts/server/scriptuserinfo.cpp b/primedev/scripts/server/scriptuserinfo.cpp index fac458a3..c53a9d22 100644 --- a/NorthstarDLL/scripts/server/scriptuserinfo.cpp +++ b/primedev/scripts/server/scriptuserinfo.cpp @@ -7,7 +7,7 @@ ADD_SQFUNC("string", GetUserInfoKVString_Internal, "entity player, string key, s "Gets the string value of a given player's userinfo convar by name", ScriptContext::SERVER) // clang-format on { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { g_pSquirrel<ScriptContext::SERVER>->raiseerror(sqvm, "player is null"); @@ -17,7 +17,7 @@ ADD_SQFUNC("string", GetUserInfoKVString_Internal, "entity player, string key, s const char* pKey = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 2); const char* pDefaultValue = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 3); - const char* pResult = R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetString(pKey, pDefaultValue); + const char* pResult = g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetString(pKey, pDefaultValue); g_pSquirrel<ScriptContext::SERVER>->pushstring(sqvm, pResult); return SQRESULT_NOTNULL; } @@ -27,7 +27,7 @@ ADD_SQFUNC("asset", GetUserInfoKVAsset_Internal, "entity player, string key, ass "Gets the asset value of a given player's userinfo convar by name", ScriptContext::SERVER) // clang-format on { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { g_pSquirrel<ScriptContext::SERVER>->raiseerror(sqvm, "player is null"); @@ -38,7 +38,7 @@ ADD_SQFUNC("asset", GetUserInfoKVAsset_Internal, "entity player, string key, ass const char* pDefaultValue; g_pSquirrel<ScriptContext::SERVER>->getasset(sqvm, 3, &pDefaultValue); - const char* pResult = R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetString(pKey, pDefaultValue); + const char* pResult = g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetString(pKey, pDefaultValue); g_pSquirrel<ScriptContext::SERVER>->pushasset(sqvm, pResult); return SQRESULT_NOTNULL; } @@ -48,7 +48,7 @@ ADD_SQFUNC("int", GetUserInfoKVInt_Internal, "entity player, string key, int def "Gets the int value of a given player's userinfo convar by name", ScriptContext::SERVER) // clang-format on { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->template getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { g_pSquirrel<ScriptContext::SERVER>->raiseerror(sqvm, "player is null"); @@ -58,7 +58,7 @@ ADD_SQFUNC("int", GetUserInfoKVInt_Internal, "entity player, string key, int def const char* pKey = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 2); const int iDefaultValue = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 3); - const int iResult = R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetInt(pKey, iDefaultValue); + const int iResult = g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetInt(pKey, iDefaultValue); g_pSquirrel<ScriptContext::SERVER>->pushinteger(sqvm, iResult); return SQRESULT_NOTNULL; } @@ -68,7 +68,7 @@ ADD_SQFUNC("float", GetUserInfoKVFloat_Internal, "entity player, string key, flo "Gets the float value of a given player's userinfo convar by name", ScriptContext::SERVER) // clang-format on { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { g_pSquirrel<ScriptContext::SERVER>->raiseerror(sqvm, "player is null"); @@ -78,7 +78,7 @@ ADD_SQFUNC("float", GetUserInfoKVFloat_Internal, "entity player, string key, flo const char* pKey = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 2); const float flDefaultValue = g_pSquirrel<ScriptContext::SERVER>->getfloat(sqvm, 3); - const float flResult = R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetFloat(pKey, flDefaultValue); + const float flResult = g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetFloat(pKey, flDefaultValue); g_pSquirrel<ScriptContext::SERVER>->pushfloat(sqvm, flResult); return SQRESULT_NOTNULL; } @@ -88,7 +88,7 @@ ADD_SQFUNC("bool", GetUserInfoKVBool_Internal, "entity player, string key, bool "Gets the bool value of a given player's userinfo convar by name", ScriptContext::SERVER) // clang-format on { - const R2::CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->getentity<R2::CBasePlayer>(sqvm, 1); + const CBasePlayer* pPlayer = g_pSquirrel<ScriptContext::SERVER>->getentity<CBasePlayer>(sqvm, 1); if (!pPlayer) { g_pSquirrel<ScriptContext::SERVER>->raiseerror(sqvm, "player is null"); @@ -98,7 +98,7 @@ ADD_SQFUNC("bool", GetUserInfoKVBool_Internal, "entity player, string key, bool const char* pKey = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 2); const bool bDefaultValue = g_pSquirrel<ScriptContext::SERVER>->getbool(sqvm, 3); - const bool bResult = R2::g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetInt(pKey, bDefaultValue); + const bool bResult = g_pClientArray[pPlayer->m_nPlayerIndex - 1].m_ConVars->GetInt(pKey, bDefaultValue); g_pSquirrel<ScriptContext::SERVER>->pushbool(sqvm, bResult); return SQRESULT_NOTNULL; } diff --git a/NorthstarDLL/server/alltalk.cpp b/primedev/server/alltalk.cpp index d71b0bae..74119309 100644 --- a/NorthstarDLL/server/alltalk.cpp +++ b/primedev/server/alltalk.cpp @@ -4,12 +4,12 @@ size_t __fastcall ShouldAllowAlltalk() { // this needs to return a 64 bit integer where 0 = true and 1 = false - static ConVar* Cvar_sv_alltalk = R2::g_pCVar->FindVar("sv_alltalk"); + static ConVar* Cvar_sv_alltalk = g_pCVar->FindVar("sv_alltalk"); if (Cvar_sv_alltalk->GetBool()) return 0; // lobby should default to alltalk, otherwise don't allow it - return strcmp(R2::g_pGlobals->m_pMapName, "mp_lobby"); + return strcmp(g_pGlobals->m_pMapName, "mp_lobby"); } ON_DLL_LOAD_RELIESON("engine.dll", ServerAllTalk, ConVar, (CModule module)) diff --git a/NorthstarDLL/server/auth/bansystem.cpp b/primedev/server/auth/bansystem.cpp index 9b9d24c4..a45cde93 100644 --- a/NorthstarDLL/server/auth/bansystem.cpp +++ b/primedev/server/auth/bansystem.cpp @@ -173,7 +173,7 @@ void ServerBanSystem::UnbanUID(uint64_t uid) bool ServerBanSystem::IsUIDAllowed(uint64_t uid) { - uint64_t localPlayerUserID = strtoull(R2::g_pLocalPlayerUserID, nullptr, 10); + uint64_t localPlayerUserID = strtoull(g_pLocalPlayerUserID, nullptr, 10); if (localPlayerUserID == uid) return true; @@ -186,14 +186,14 @@ void ConCommand_ban(const CCommand& args) if (args.ArgC() < 2) return; - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) { - R2::CBaseClient* player = &R2::g_pClientArray[i]; + CBaseClient* player = &g_pClientArray[i]; if (!strcmp(player->m_Name, args.Arg(1)) || !strcmp(player->m_UID, args.Arg(1))) { g_pBanSystem->BanUID(strtoull(player->m_UID, nullptr, 10)); - R2::CBaseClient__Disconnect(player, 1, "Banned from server"); + CBaseClient__Disconnect(player, 1, "Banned from server"); break; } } diff --git a/NorthstarDLL/server/auth/bansystem.h b/primedev/server/auth/bansystem.h index 6f180126..d6ac5a4f 100644 --- a/NorthstarDLL/server/auth/bansystem.h +++ b/primedev/server/auth/bansystem.h @@ -3,11 +3,11 @@ class ServerBanSystem { - private: +private: std::ofstream m_sBanlistStream; std::vector<uint64_t> m_vBannedUids; - public: +public: void OpenBanlist(); void ReloadBanlist(); void ClearBanlist(); diff --git a/NorthstarDLL/server/auth/serverauthentication.cpp b/primedev/server/auth/serverauthentication.cpp index d5653dcc..0d46426f 100644 --- a/NorthstarDLL/server/auth/serverauthentication.cpp +++ b/primedev/server/auth/serverauthentication.cpp @@ -40,7 +40,7 @@ void ServerAuthenticationManager::AddRemotePlayer(std::string token, uint64_t ui m_RemoteAuthenticationData[token] = newAuthData; } -void ServerAuthenticationManager::AddPlayer(R2::CBaseClient* pPlayer, const char* pToken) +void ServerAuthenticationManager::AddPlayer(CBaseClient* pPlayer, const char* pToken) { PlayerAuthenticationData additionalData; @@ -48,14 +48,14 @@ void ServerAuthenticationManager::AddPlayer(R2::CBaseClient* pPlayer, const char if (remoteAuthData != m_RemoteAuthenticationData.end()) additionalData.pdataSize = remoteAuthData->second.pdataSize; else - additionalData.pdataSize = R2::PERSISTENCE_MAX_SIZE; + additionalData.pdataSize = PERSISTENCE_MAX_SIZE; - additionalData.usingLocalPdata = pPlayer->m_iPersistenceReady == R2::ePersistenceReady::READY_INSECURE; + additionalData.usingLocalPdata = pPlayer->m_iPersistenceReady == ePersistenceReady::READY_INSECURE; m_PlayerAuthenticationData.insert(std::make_pair(pPlayer, additionalData)); } -void ServerAuthenticationManager::RemovePlayer(R2::CBaseClient* pPlayer) +void ServerAuthenticationManager::RemovePlayer(CBaseClient* pPlayer) { if (m_PlayerAuthenticationData.count(pPlayer)) m_PlayerAuthenticationData.erase(pPlayer); @@ -88,20 +88,20 @@ bool ServerAuthenticationManager::VerifyPlayerName(const char* pAuthToken, const return true; } -bool ServerAuthenticationManager::IsDuplicateAccount(R2::CBaseClient* pPlayer, const char* pPlayerUid) +bool ServerAuthenticationManager::IsDuplicateAccount(CBaseClient* pPlayer, const char* pPlayerUid) { if (m_bAllowDuplicateAccounts) return false; bool bHasUidPlayer = false; - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) - if (&R2::g_pClientArray[i] != pPlayer && !strcmp(pPlayerUid, R2::g_pClientArray[i].m_UID)) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) + if (&g_pClientArray[i] != pPlayer && !strcmp(pPlayerUid, g_pClientArray[i].m_UID)) return true; return false; } -bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) +bool ServerAuthenticationManager::CheckAuthentication(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) { std::string sUid = std::to_string(iUid); @@ -111,7 +111,7 @@ bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, return true; // local server that doesn't need auth (probably sp) and local player - if (m_bStartingLocalSPGame && !strcmp(sUid.c_str(), R2::g_pLocalPlayerUserID)) + if (m_bStartingLocalSPGame && !strcmp(sUid.c_str(), g_pLocalPlayerUserID)) return true; // don't allow duplicate accounts @@ -126,7 +126,7 @@ bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, return false; } -void ServerAuthenticationManager::AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) +void ServerAuthenticationManager::AuthenticatePlayer(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) { // for bot players, generate a new uid if (pPlayer->m_bFakePlayer) @@ -142,31 +142,31 @@ void ServerAuthenticationManager::AuthenticatePlayer(R2::CBaseClient* pPlayer, u if (authData != m_RemoteAuthenticationData.end()) { // if we're resetting let script handle the reset with InitPersistentData() on connect - if (!m_bForceResetLocalPlayerPersistence || strcmp(sUid.c_str(), R2::g_pLocalPlayerUserID)) + if (!m_bForceResetLocalPlayerPersistence || strcmp(sUid.c_str(), g_pLocalPlayerUserID)) { // copy pdata into buffer memcpy(pPlayer->m_PersistenceBuffer, authData->second.pdata, authData->second.pdataSize); } // set persistent data as ready - pPlayer->m_iPersistenceReady = R2::ePersistenceReady::READY_REMOTE; + pPlayer->m_iPersistenceReady = ePersistenceReady::READY_REMOTE; } // we probably allow insecure at this point, but make sure not to write anyway if not insecure else if (Cvar_ns_auth_allow_insecure->GetBool() || pPlayer->m_bFakePlayer) { // set persistent data as ready // note: actual placeholder persistent data is populated in script with InitPersistentData() - pPlayer->m_iPersistenceReady = R2::ePersistenceReady::READY_INSECURE; + pPlayer->m_iPersistenceReady = ePersistenceReady::READY_INSECURE; } } -bool ServerAuthenticationManager::RemovePlayerAuthData(R2::CBaseClient* pPlayer) +bool ServerAuthenticationManager::RemovePlayerAuthData(CBaseClient* pPlayer) { if (!Cvar_ns_erase_auth_info->GetBool()) // keep auth data forever return false; // hack for special case where we're on a local server, so we erase our own newly created auth data on disconnect - if (m_bNeedLocalAuthForNewgame && !strcmp(pPlayer->m_UID, R2::g_pLocalPlayerUserID)) + if (m_bNeedLocalAuthForNewgame && !strcmp(pPlayer->m_UID, g_pLocalPlayerUserID)) return false; // we don't have our auth token at this point, so lookup authdata by uid @@ -187,9 +187,9 @@ bool ServerAuthenticationManager::RemovePlayerAuthData(R2::CBaseClient* pPlayer) return false; } -void ServerAuthenticationManager::WritePersistentData(R2::CBaseClient* pPlayer) +void ServerAuthenticationManager::WritePersistentData(CBaseClient* pPlayer) { - if (pPlayer->m_iPersistenceReady == R2::ePersistenceReady::READY_REMOTE) + if (pPlayer->m_iPersistenceReady == ePersistenceReady::READY_REMOTE) { g_pMasterServerManager->WritePlayerPersistentData( pPlayer->m_UID, (const char*)pPlayer->m_PersistenceBuffer, m_PlayerAuthenticationData[pPlayer].pdataSize); @@ -240,7 +240,7 @@ ConVar* Cvar_ns_allowuserclantags; // clang-format off AUTOHOOK(CBaseClient__Connect, engine.dll + 0x101740, -bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, void* a5, char pDisconnectReason[256], void* a7)) +bool,, (CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, void* a5, char pDisconnectReason[256], void* a7)) // clang-format on { const char* pAuthenticationFailure = nullptr; @@ -281,13 +281,13 @@ bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, // clang-format off AUTOHOOK(CBaseClient__ActivatePlayer, engine.dll + 0x100F80, -void,, (R2::CBaseClient* self)) +void,, (CBaseClient* self)) // clang-format on { // if we're authed, write our persistent data // RemovePlayerAuthData returns true if it removed successfully, i.e. on first call only, and we only want to write on >= second call // (since this func is called on map loads) - if (self->m_iPersistenceReady >= R2::ePersistenceReady::READY && !g_pServerAuthentication->RemovePlayerAuthData(self)) + if (self->m_iPersistenceReady >= ePersistenceReady::READY && !g_pServerAuthentication->RemovePlayerAuthData(self)) { g_pServerAuthentication->m_bForceResetLocalPlayerPersistence = false; g_pServerAuthentication->WritePersistentData(self); @@ -299,7 +299,7 @@ void,, (R2::CBaseClient* self)) // clang-format off AUTOHOOK(_CBaseClient__Disconnect, engine.dll + 0x1012C0, -void,, (R2::CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, ...)) +void,, (CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, ...)) // clang-format on { // have to manually format message because can't pass varargs to original func @@ -333,7 +333,7 @@ void,, (R2::CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, void ConCommand_ns_resetpersistence(const CCommand& args) { - if (*R2::g_pServerState == R2::server_state_t::ss_active) + if (*g_pServerState == server_state_t::ss_active) { spdlog::error("ns_resetpersistence must be entered from the main menu"); return; @@ -370,7 +370,7 @@ ON_DLL_LOAD_RELIESON("engine.dll", ServerAuthentication, (ConCommand, ConVar), ( CBaseServer__RejectConnection = module.Offset(0x1182E0).RCast<CBaseServer__RejectConnectionType>(); - if (Tier0::CommandLine()->CheckParm("-allowdupeaccounts")) + if (CommandLine()->CheckParm("-allowdupeaccounts")) { // patch to allow same of multiple account module.Offset(0x114510).Patch("EB"); diff --git a/NorthstarDLL/server/auth/serverauthentication.h b/primedev/server/auth/serverauthentication.h index dd0e13af..996d20e1 100644 --- a/NorthstarDLL/server/auth/serverauthentication.h +++ b/primedev/server/auth/serverauthentication.h @@ -26,33 +26,33 @@ extern CBaseServer__RejectConnectionType CBaseServer__RejectConnection; class ServerAuthenticationManager { - public: +public: ConVar* Cvar_ns_erase_auth_info; ConVar* Cvar_ns_auth_allow_insecure; ConVar* Cvar_ns_auth_allow_insecure_write; std::mutex m_AuthDataMutex; std::unordered_map<std::string, RemoteAuthData> m_RemoteAuthenticationData; - std::unordered_map<R2::CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; + std::unordered_map<CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; bool m_bAllowDuplicateAccounts = false; bool m_bNeedLocalAuthForNewgame = false; bool m_bForceResetLocalPlayerPersistence = false; bool m_bStartingLocalSPGame = false; - public: +public: void AddRemotePlayer(std::string token, uint64_t uid, std::string username, std::string pdata); - void AddPlayer(R2::CBaseClient* pPlayer, const char* pAuthToken); - void RemovePlayer(R2::CBaseClient* pPlayer); + void AddPlayer(CBaseClient* pPlayer, const char* pAuthToken); + void RemovePlayer(CBaseClient* pPlayer); bool VerifyPlayerName(const char* pAuthToken, const char* pName, char pOutVerifiedName[64]); - bool IsDuplicateAccount(R2::CBaseClient* pPlayer, const char* pUid); - bool CheckAuthentication(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + bool IsDuplicateAccount(CBaseClient* pPlayer, const char* pUid); + bool CheckAuthentication(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); - void AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); - bool RemovePlayerAuthData(R2::CBaseClient* pPlayer); - void WritePersistentData(R2::CBaseClient* pPlayer); + void AuthenticatePlayer(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + bool RemovePlayerAuthData(CBaseClient* pPlayer); + void WritePersistentData(CBaseClient* pPlayer); }; extern ServerAuthenticationManager* g_pServerAuthentication; diff --git a/NorthstarDLL/server/buildainfile.cpp b/primedev/server/buildainfile.cpp index d0143295..a7f59961 100644 --- a/NorthstarDLL/server/buildainfile.cpp +++ b/primedev/server/buildainfile.cpp @@ -177,8 +177,8 @@ ConVar* Cvar_ns_ai_dumpAINfileFromLoad; void DumpAINInfo(CAI_Network* aiNetwork) { - fs::path writePath(fmt::format("{}/maps/graphs", R2::g_pModName)); - writePath /= R2::g_pGlobals->m_pMapName; + fs::path writePath(fmt::format("{}/maps/graphs", g_pModName)); + writePath /= g_pGlobals->m_pMapName; writePath += ".ain"; // dump from memory @@ -193,7 +193,7 @@ void DumpAINInfo(CAI_Network* aiNetwork) spdlog::info("writing ainet version: {}", AINET_VERSION_NUMBER); writeStream.write((char*)&AINET_VERSION_NUMBER, sizeof(int)); - int mapVersion = R2::g_pGlobals->m_nMapVersion; + int mapVersion = g_pGlobals->m_nMapVersion; spdlog::info("writing map version: {}", mapVersion); writeStream.write((char*)&mapVersion, sizeof(int)); spdlog::info("writing placeholder crc: {}", PLACEHOLDER_CRC); diff --git a/NorthstarDLL/server/r2server.cpp b/primedev/server/r2server.cpp index cf7add0d..c52f396e 100644 --- a/NorthstarDLL/server/r2server.cpp +++ b/primedev/server/r2server.cpp @@ -1,13 +1,7 @@ #include "r2server.h" -using namespace R2; - -// use the R2 namespace for game funcs -namespace R2 -{ - CBaseEntity* (*Server_GetEntityByIndex)(int index); - CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); -} // namespace R2 +CBaseEntity* (*Server_GetEntityByIndex)(int index); +CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); ON_DLL_LOAD("server.dll", R2GameServer, (CModule module)) { diff --git a/primedev/server/r2server.h b/primedev/server/r2server.h new file mode 100644 index 00000000..c40cdc1f --- /dev/null +++ b/primedev/server/r2server.h @@ -0,0 +1,106 @@ +#pragma once + +#include "core/math/vector.h" + +// server entity stuff +class CBaseEntity; +extern CBaseEntity* (*Server_GetEntityByIndex)(int index); + +// clang-format off +OFFSET_STRUCT(CBasePlayer) +{ + FIELD(0x58, uint32_t m_nPlayerIndex) + + FIELD(0x23E8, bool m_grappleActive) + FIELD(0x1D08, uint32_t m_platformUserId) + FIELD(0x1D10, int32_t m_classModsActive) + FIELD(0x1D8C, int32_t m_posClassModsActive) + FIELD(0x1DCC, bool m_passives) + FIELD(0x4948, int32_t m_selectedOffhand) + FIELD(0x1358, int32_t m_selectedOffhandPendingHybridAction) + FIELD(0x1E88, int32_t m_playerFlags) + FIELD(0x26A8, int32_t m_lastUCmdSimulationTicks) + FIELD(0x26AC, float m_lastUCmdSimulationRemainderTime) + FIELD(0x1F04, int32_t m_remoteTurret) + FIELD(0x414, int32_t m_hGroundEntity) + FIELD(0x13B8, int32_t m_titanSoul) + FIELD(0x2054, int32_t m_petTitan) + FIELD(0x4D4, int32_t m_iHealth) + FIELD(0x4D0, int32_t m_iMaxHealth) + FIELD(0x4F1, int32_t m_lifeState) + FIELD(0x50C, float m_flMaxspeed) + FIELD(0x298, int32_t m_fFlags) + FIELD(0x1F64, int32_t m_iObserverMode) + FIELD(0x1F6C, int32_t m_hObserverTarget) + FIELD(0x2098, int32_t m_hViewModel) + FIELD(0x27E4, int32_t m_ubEFNointerpParity) + FIELD(0x1FA4, int32_t m_activeBurnCardIndex) + FIELD(0x1B68, int32_t m_hColorCorrectionCtrl) + FIELD(0x19E0, int32_t m_PlayerFog__m_hCtrl) + FIELD(0x26BC, bool m_bShouldDrawPlayerWhileUsingViewEntity) + FIELD(0x2848, char m_title[32]) + FIELD(0x2964, bool m_useCredit) + FIELD(0x1F40, float m_damageImpulseNoDecelEndTime) + FIELD(0x1E8C, bool m_hasMic) + FIELD(0x1E8D, bool m_inPartyChat) + FIELD(0x1E90, float m_playerMoveSpeedScale) + FIELD(0x1F58, float m_flDeathTime) + FIELD(0x25A8, bool m_iSpawnParity) + FIELD(0x102284, Vector3 m_upDir) + FIELD(0x259C, float m_lastDodgeTime) + FIELD(0x22E0, bool m_wallHanging) + FIELD(0x22EC, int32_t m_traversalType) + FIELD(0x22F0, int32_t m_traversalState) + FIELD(0x2328, Vector3 m_traversalRefPos) + FIELD(0x231C, Vector3 m_traversalForwardDir) + FIELD(0x2354, float m_traversalYawDelta) + FIELD(0x2358, int32_t m_traversalYawPoseParameter) + FIELD(0x2050, int32_t m_grappleHook) + FIELD(0x27C0, int32_t m_autoSprintForced) + FIELD(0x27C4, bool m_fIsSprinting) + FIELD(0x27CC, float m_sprintStartedTime) + FIELD(0x27D0, float m_sprintStartedFrac) + FIELD(0x27D4, float m_sprintEndedTime) + FIELD(0x27D8, float m_sprintEndedFrac) + FIELD(0x27DC, float m_stickySprintStartTime) + FIELD(0x2998, float m_smartAmmoPreviousHighestLockOnMeFractionValue) + FIELD(0x23FC, int32_t m_activeZipline) + FIELD(0x2400, bool m_ziplineReverse) + FIELD(0x2410, int32_t m_ziplineState) + FIELD(0x2250, int32_t m_duckState) + FIELD(0x2254, Vector3 m_StandHullMin) + FIELD(0x2260, Vector3 m_StandHullMax) + FIELD(0x226C, Vector3 m_DuckHullMin) + FIELD(0x2278, Vector3 m_DuckHullMax) + FIELD(0x205C, int32_t m_xp) + FIELD(0x2060, int32_t m_generation) + FIELD(0x2064, int32_t m_rank) + FIELD(0x2068, int32_t m_serverForceIncreasePlayerListGenerationParity) + FIELD(0x206C, bool m_isPlayingRanked) + FIELD(0x2070, float m_skill_mu) + FIELD(0x1E80, int32_t m_titanSoulBeingRodeoed) + FIELD(0x1E84, int32_t m_entitySyncingWithMe) + FIELD(0x2078, float m_nextTitanRespawnAvailable) + FIELD(0x1C90, bool m_hasBadReputation) + FIELD(0x1C91, char m_communityName[64]) + FIELD(0x1CD1, char m_communityClanTag[16]) + FIELD(0x1CE1, char m_factionName[16]) + FIELD(0x1CF1, char m_hardwareIcon[16]) + FIELD(0x1D01, bool m_happyHourActive) + FIELD(0x1EF4, int32_t m_gestureAutoKillBitfield) + FIELD(0x2EA8, int32_t m_pilotClassIndex) + FIELD(0x100490, Vector3 m_vecAbsOrigin) + FIELD(0x25BE, bool m_isPerformingBoostAction) + FIELD(0x240C, bool m_ziplineValid3pWeaponLayerAnim) + FIELD(0x345C, int32_t m_playerScriptNetDataGlobal) + FIELD(0x1598, int32_t m_bZooming) + FIELD(0x1599, bool m_zoomToggleOn) + FIELD(0x159C, float m_zoomBaseFrac) + FIELD(0x15A0, float m_zoomBaseTime) + FIELD(0x15A4, float m_zoomFullStartTime) + FIELD(0xA04, int32_t m_camoIndex) + FIELD(0xA08, int32_t m_decalIndex) +}; +// clang-format on + +extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); diff --git a/NorthstarDLL/server/serverchathooks.cpp b/primedev/server/serverchathooks.cpp index cb3af244..d3ac4776 100644 --- a/NorthstarDLL/server/serverchathooks.cpp +++ b/primedev/server/serverchathooks.cpp @@ -25,7 +25,7 @@ void(__fastcall* CServerGameDLL__OnReceivedSayTextMessage)( void(__fastcall* CRecipientFilter__Construct)(CRecipientFilter* self); void(__fastcall* CRecipientFilter__Destruct)(CRecipientFilter* self); void(__fastcall* CRecipientFilter__AddAllPlayers)(CRecipientFilter* self); -void(__fastcall* CRecipientFilter__AddRecipient)(CRecipientFilter* self, const R2::CBasePlayer* player); +void(__fastcall* CRecipientFilter__AddRecipient)(CRecipientFilter* self, const CBasePlayer* player); void(__fastcall* CRecipientFilter__MakeReliable)(CRecipientFilter* self); void(__fastcall* UserMessageBegin)(CRecipientFilter* filter, const char* messagename); @@ -40,7 +40,7 @@ AUTOHOOK(_CServerGameDLL__OnReceivedSayTextMessage, server.dll + 0x1595C0, void, __fastcall, (CServerGameDLL* self, unsigned int senderPlayerId, const char* text, bool isTeam)) // clang-format on { - NS::Utils::RemoveAsciiControlSequences(const_cast<char*>(text), true); + RemoveAsciiControlSequences(const_cast<char*>(text), true); // MiniHook doesn't allow calling the base function outside of anywhere but the hook function. // To allow bypassing the hook, isSkippingHook can be set. @@ -52,7 +52,7 @@ void, __fastcall, (CServerGameDLL* self, unsigned int senderPlayerId, const char } // check chat ratelimits - if (!g_pServerLimits->CheckChatLimits(&R2::g_pClientArray[senderPlayerId - 1])) + if (!g_pServerLimits->CheckChatLimits(&g_pClientArray[senderPlayerId - 1])) return; SQRESULT result = g_pSquirrel<ScriptContext::SERVER>->Call( @@ -75,10 +75,10 @@ void ChatSendMessage(unsigned int playerIndex, const char* text, bool isTeam) void ChatBroadcastMessage(int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType) { - R2::CBasePlayer* toPlayer = NULL; + CBasePlayer* toPlayer = NULL; if (toPlayerIndex >= 0) { - toPlayer = R2::UTIL_PlayerByIndex(toPlayerIndex + 1); + toPlayer = UTIL_PlayerByIndex(toPlayerIndex + 1); if (toPlayer == NULL) return; } @@ -163,7 +163,7 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule mod CRecipientFilter__Construct = module.Offset(0x1E9440).RCast<void(__fastcall*)(CRecipientFilter*)>(); CRecipientFilter__Destruct = module.Offset(0x1E9700).RCast<void(__fastcall*)(CRecipientFilter*)>(); CRecipientFilter__AddAllPlayers = module.Offset(0x1E9940).RCast<void(__fastcall*)(CRecipientFilter*)>(); - CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).RCast<void(__fastcall*)(CRecipientFilter*, const R2::CBasePlayer*)>(); + CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).RCast<void(__fastcall*)(CRecipientFilter*, const CBasePlayer*)>(); CRecipientFilter__MakeReliable = module.Offset(0x1EA4E0).RCast<void(__fastcall*)(CRecipientFilter*)>(); UserMessageBegin = module.Offset(0x15C520).RCast<void(__fastcall*)(CRecipientFilter*, const char*)>(); diff --git a/NorthstarDLL/server/serverchathooks.h b/primedev/server/serverchathooks.h index d033e769..d033e769 100644 --- a/NorthstarDLL/server/serverchathooks.h +++ b/primedev/server/serverchathooks.h diff --git a/NorthstarDLL/server/servernethooks.cpp b/primedev/server/servernethooks.cpp index f74f2d38..148b735f 100644 --- a/NorthstarDLL/server/servernethooks.cpp +++ b/primedev/server/servernethooks.cpp @@ -84,7 +84,7 @@ cleanup: } // v1 HMACSHA256-signed masterserver request (HMAC-SHA256(JSONData, MasterServerToken) + JSONData) -static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, bool dbg, std::string pType, std::string pData) +static void ProcessAtlasConnectionlessPacketSigreq1(netpacket_t* packet, bool dbg, std::string pType, std::string pData) { if (pData.length() < HMACSHA256_LEN) { @@ -135,7 +135,7 @@ static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, boo return; } -static void ProcessAtlasConnectionlessPacket(R2::netpacket_t* packet) +static void ProcessAtlasConnectionlessPacket(netpacket_t* packet) { bool dbg = Cvar_net_debug_atlas_packet->GetBool(); @@ -168,7 +168,7 @@ static void ProcessAtlasConnectionlessPacket(R2::netpacket_t* packet) return; } -AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, R2::netpacket_t* packet)) +AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, netpacket_t* packet)) { // packet->data consists of 0xFFFFFFFF (int32 -1) to indicate packets aren't split, followed by a header consisting of a single // character, which is used to uniquely identify the packet kind. Most kinds follow this with a null-terminated string payload diff --git a/NorthstarDLL/server/serverpresence.cpp b/primedev/server/serverpresence.cpp index 159b9f30..159b9f30 100644 --- a/NorthstarDLL/server/serverpresence.cpp +++ b/primedev/server/serverpresence.cpp diff --git a/NorthstarDLL/server/serverpresence.h b/primedev/server/serverpresence.h index 3aabecde..c644cc37 100644 --- a/NorthstarDLL/server/serverpresence.h +++ b/primedev/server/serverpresence.h @@ -3,7 +3,7 @@ struct ServerPresence { - public: +public: int m_iPort; std::string m_sServerId; @@ -44,7 +44,7 @@ struct ServerPresence class ServerPresenceReporter { - public: +public: virtual void CreatePresence(const ServerPresence* pServerPresence) {} virtual void ReportPresence(const ServerPresence* pServerPresence) {} virtual void DestroyPresence(const ServerPresence* pServerPresence) {} @@ -53,7 +53,7 @@ class ServerPresenceReporter class ServerPresenceManager { - private: +private: ServerPresence m_ServerPresence; bool m_bHasPresence = false; @@ -71,7 +71,7 @@ class ServerPresenceManager ConVar* Cvar_ns_report_server_to_masterserver; ConVar* Cvar_ns_report_sp_server_to_masterserver; - public: +public: void AddPresenceReporter(ServerPresenceReporter* reporter); void CreateConVars(); diff --git a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp b/primedev/shared/exploit_fixes/exploitfixes.cpp index 8821a40d..8064d5ac 100644 --- a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes.cpp @@ -84,7 +84,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 }; auto msg = (NET_SetConVar*)pMsg; - bool bIsServerFrame = Tier0::ThreadInServerFrameThread(); + bool bIsServerFrame = ThreadInServerFrameThread(); std::string BLOCK_PREFIX = std::string {"NET_SetConVar ("} + (bIsServerFrame ? "server" : "client") + "): Blocked dangerous/invalid msg: "; @@ -118,7 +118,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 if (!nameValid || !valValid) return BLOCKED_INFO("Missing null terminators"); - ConVar* pVar = R2::g_pCVar->FindVar(entry->name); + ConVar* pVar = g_pCVar->FindVar(entry->name); if (pVar) { @@ -263,19 +263,19 @@ bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D { // somewhat temp, store the modname here, since we don't have a proper ptr in engine to it rn int iSize = strlen(pModName); - R2::g_pModName = new char[iSize + 1]; - strcpy(R2::g_pModName, pModName); + g_pModName = new char[iSize + 1]; + strcpy(g_pModName, pModName); if (g_pVanillaCompatibility->GetVanillaCompatibility()) return false; - return (!strcmp("r2", pModName) || !strcmp("r1", pModName)) && !Tier0::CommandLine()->CheckParm("-norestrictservercommands"); + return (!strcmp("r2", pModName) || !strcmp("r1", pModName)) && !CommandLine()->CheckParm("-norestrictservercommands"); } // ratelimit stringcmds, and prevent remote clients from calling commands that they shouldn't // clang-format off AUTOHOOK(CGameClient__ExecuteStringCommand, engine.dll + 0x1022E0, -bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommandString)) +bool, __fastcall, (CBaseClient* self, uint32_t unknown, const char* pCommandString)) // clang-format on { if (Cvar_ns_should_log_all_clientcommands->GetBool()) @@ -283,7 +283,7 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand if (!g_pServerLimits->CheckStringCommandLimits(self)) { - R2::CBaseClient__Disconnect(self, 1, "Sent too many stringcmd commands"); + CBaseClient__Disconnect(self, 1, "Sent too many stringcmd commands"); return false; } @@ -292,10 +292,10 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand memset(commandBuf, 0, sizeof(commandBuf)); CCommand tempCommand = *(CCommand*)&commandBuf; - if (!R2::CCommand__Tokenize(tempCommand, pCommandString, R2::cmd_source_t::kCommandSrcCode) || !tempCommand.ArgC()) + if (!CCommand__Tokenize(tempCommand, pCommandString, cmd_source_t::kCommandSrcCode) || !tempCommand.ArgC()) return false; - ConCommand* command = R2::g_pCVar->FindCommand(tempCommand.Arg(0)); + ConCommand* command = g_pCVar->FindCommand(tempCommand.Arg(0)); // if the command doesn't exist pass it on to ExecuteStringCommand for script clientcommands and stuff if (command && !command->IsFlagSet(FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS)) @@ -304,7 +304,7 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand if (IsDedicatedServer()) return false; - if (strcmp(self->m_UID, R2::g_pLocalPlayerUserID)) + if (strcmp(self->m_UID, g_pLocalPlayerUserID)) return false; } @@ -355,7 +355,7 @@ void, __fastcall, (void* self)) bWasWritingStringTableSuccessful = true; CBaseClient__SendServerInfo(self); if (!bWasWritingStringTableSuccessful) - R2::CBaseClient__Disconnect( + CBaseClient__Disconnect( self, 1, "Overflowed CNetworkStringTableContainer::WriteBaselines, try restarting your client and reconnecting"); } @@ -457,5 +457,5 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerExploitFixes, ConVar, (CModule module)) Cvar_ns_should_log_all_clientcommands = new ConVar("ns_should_log_all_clientcommands", "0", FCVAR_NONE, "Whether to log all clientcommands"); - Cvar_sv_cheats = R2::g_pCVar->FindVar("sv_cheats"); + Cvar_sv_cheats = g_pCVar->FindVar("sv_cheats"); } diff --git a/NorthstarDLL/shared/exploit_fixes/exploitfixes_lzss.cpp b/primedev/shared/exploit_fixes/exploitfixes_lzss.cpp index ccb6ac18..ccb6ac18 100644 --- a/NorthstarDLL/shared/exploit_fixes/exploitfixes_lzss.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes_lzss.cpp diff --git a/NorthstarDLL/shared/exploit_fixes/exploitfixes_utf8parser.cpp b/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp index 3d97f750..3d97f750 100644 --- a/NorthstarDLL/shared/exploit_fixes/exploitfixes_utf8parser.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp diff --git a/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp b/primedev/shared/exploit_fixes/ns_limits.cpp index c9085cb0..bd855ee4 100644 --- a/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp +++ b/primedev/shared/exploit_fixes/ns_limits.cpp @@ -19,47 +19,47 @@ void ServerLimitsManager::RunFrame(double flCurrentTime, float flFrameTime) if (Cvar_sv_antispeedhack_enable->GetBool()) { // for each player, set their usercmd processing budget for the frame to the last frametime for the server - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) { - R2::CBaseClient* player = &R2::g_pClientArray[i]; + CBaseClient* player = &g_pClientArray[i]; if (m_PlayerLimitData.find(player) != m_PlayerLimitData.end()) { PlayerLimitData* pLimitData = &g_pServerLimits->m_PlayerLimitData[player]; - if (pLimitData->flFrameUserCmdBudget < R2::g_pGlobals->m_flTickInterval * Cvar_sv_antispeedhack_maxtickbudget->GetFloat()) + if (pLimitData->flFrameUserCmdBudget < g_pGlobals->m_flTickInterval * Cvar_sv_antispeedhack_maxtickbudget->GetFloat()) { pLimitData->flFrameUserCmdBudget += g_pServerLimits->Cvar_sv_antispeedhack_budgetincreasemultiplier->GetFloat() * - fmax(flFrameTime, R2::g_pGlobals->m_flFrameTime * CEngineServer__GetTimescale()); + fmax(flFrameTime, g_pGlobals->m_flFrameTime * CEngineServer__GetTimescale()); } } } } } -void ServerLimitsManager::AddPlayer(R2::CBaseClient* player) +void ServerLimitsManager::AddPlayer(CBaseClient* player) { PlayerLimitData limitData; limitData.flFrameUserCmdBudget = - R2::g_pGlobals->m_flTickInterval * CEngineServer__GetTimescale() * Cvar_sv_antispeedhack_maxtickbudget->GetFloat(); + g_pGlobals->m_flTickInterval * CEngineServer__GetTimescale() * Cvar_sv_antispeedhack_maxtickbudget->GetFloat(); m_PlayerLimitData.insert(std::make_pair(player, limitData)); } -void ServerLimitsManager::RemovePlayer(R2::CBaseClient* player) +void ServerLimitsManager::RemovePlayer(CBaseClient* player) { if (m_PlayerLimitData.find(player) != m_PlayerLimitData.end()) m_PlayerLimitData.erase(player); } -bool ServerLimitsManager::CheckStringCommandLimits(R2::CBaseClient* player) +bool ServerLimitsManager::CheckStringCommandLimits(CBaseClient* player) { if (CVar_sv_quota_stringcmdspersecond->GetInt() != -1) { // note: this isn't super perfect, legit clients can trigger it in lobby if they try, mostly good enough tho imo - if (Tier0::Plat_FloatTime() - m_PlayerLimitData[player].lastClientCommandQuotaStart >= 1.0) + if (Plat_FloatTime() - m_PlayerLimitData[player].lastClientCommandQuotaStart >= 1.0) { // reset quota - m_PlayerLimitData[player].lastClientCommandQuotaStart = Tier0::Plat_FloatTime(); + m_PlayerLimitData[player].lastClientCommandQuotaStart = Plat_FloatTime(); m_PlayerLimitData[player].numClientCommandsInQuota = 0; } @@ -74,11 +74,11 @@ bool ServerLimitsManager::CheckStringCommandLimits(R2::CBaseClient* player) return true; } -bool ServerLimitsManager::CheckChatLimits(R2::CBaseClient* player) +bool ServerLimitsManager::CheckChatLimits(CBaseClient* player) { - if (Tier0::Plat_FloatTime() - m_PlayerLimitData[player].lastSayTextLimitStart >= 1.0) + if (Plat_FloatTime() - m_PlayerLimitData[player].lastSayTextLimitStart >= 1.0) { - m_PlayerLimitData[player].lastSayTextLimitStart = Tier0::Plat_FloatTime(); + m_PlayerLimitData[player].lastSayTextLimitStart = Plat_FloatTime(); m_PlayerLimitData[player].sayTextLimitCount = 0; } @@ -100,14 +100,14 @@ char, __fastcall, (void* self, void* buf)) NETCHANLIMIT_KICK }; - double startTime = Tier0::Plat_FloatTime(); + double startTime = Plat_FloatTime(); char ret = CNetChan__ProcessMessages(self, buf); // check processing limits, unless we're in a level transition - if (R2::g_pHostState->m_iCurrentState == R2::HostState_t::HS_RUN && Tier0::ThreadInServerFrameThread()) + if (g_pHostState->m_iCurrentState == HostState_t::HS_RUN && ThreadInServerFrameThread()) { // player that sent the message - R2::CBaseClient* sender = *(R2::CBaseClient**)((char*)self + 368); + CBaseClient* sender = *(CBaseClient**)((char*)self + 368); // if no sender, return // relatively certain this is fine? @@ -121,7 +121,7 @@ char, __fastcall, (void* self, void* buf)) g_pServerLimits->m_PlayerLimitData[sender].lastNetChanProcessingLimitStart = startTime; g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime = 0.0; } - g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime += (Tier0::Plat_FloatTime() * 1000) - (startTime * 1000); + g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime += (Plat_FloatTime() * 1000) - (startTime * 1000); if (g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime >= g_pServerLimits->Cvar_net_chan_limit_msec_per_sec->GetInt()) @@ -133,9 +133,9 @@ char, __fastcall, (void* self, void* buf)) g_pServerLimits->Cvar_net_chan_limit_msec_per_sec->GetInt()); // never kick local player - if (g_pServerLimits->Cvar_net_chan_limit_mode->GetInt() != NETCHANLIMIT_WARN && strcmp(R2::g_pLocalPlayerUserID, sender->m_UID)) + if (g_pServerLimits->Cvar_net_chan_limit_mode->GetInt() != NETCHANLIMIT_WARN && strcmp(g_pLocalPlayerUserID, sender->m_UID)) { - R2::CBaseClient__Disconnect(sender, 1, "Exceeded net channel processing limit"); + CBaseClient__Disconnect(sender, 1, "Exceeded net channel processing limit"); return false; } } @@ -144,12 +144,12 @@ char, __fastcall, (void* self, void* buf)) return ret; } -bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packet) +bool ServerLimitsManager::CheckConnectionlessPacketLimits(netpacket_t* packet) { - static const ConVar* Cvar_net_data_block_enabled = R2::g_pCVar->FindVar("net_data_block_enabled"); + static const ConVar* Cvar_net_data_block_enabled = g_pCVar->FindVar("net_data_block_enabled"); // don't ratelimit datablock packets as long as datablock is enabled - if (packet->adr.type == R2::NA_IP && + if (packet->adr.type == NA_IP && (!(packet->data[4] == 'N' && Cvar_net_data_block_enabled->GetBool()) || !Cvar_net_data_block_enabled->GetBool())) { // bad lookup: optimise later tm @@ -169,12 +169,12 @@ bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packe memcpy(sendData->ip, packet->adr.ip, 16); } - if (Tier0::Plat_FloatTime() < sendData->timeoutEnd) + if (Plat_FloatTime() < sendData->timeoutEnd) return false; - if (Tier0::Plat_FloatTime() - sendData->lastQuotaStart >= 1.0) + if (Plat_FloatTime() - sendData->lastQuotaStart >= 1.0) { - sendData->lastQuotaStart = Tier0::Plat_FloatTime(); + sendData->lastQuotaStart = Plat_FloatTime(); sendData->packetCount = 0; } @@ -188,7 +188,7 @@ bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packe packet->data[4]); // timeout for a minute - sendData->timeoutEnd = Tier0::Plat_FloatTime() + 60.0; + sendData->timeoutEnd = Plat_FloatTime() + 60.0; return false; } } @@ -232,12 +232,12 @@ struct alignas(4) SV_CUserCmd // clang-format off AUTOHOOK(CPlayerMove__RunCommand, server.dll + 0x5B8100, -void, __fastcall, (void* self, R2::CBasePlayer* player, SV_CUserCmd* pUserCmd, uint64_t a4)) +void, __fastcall, (void* self, CBasePlayer* player, SV_CUserCmd* pUserCmd, uint64_t a4)) // clang-format on { if (g_pServerLimits->Cvar_sv_antispeedhack_enable->GetBool()) { - R2::CBaseClient* pClient = &R2::g_pClientArray[player->m_nPlayerIndex - 1]; + CBaseClient* pClient = &g_pClientArray[player->m_nPlayerIndex - 1]; if (g_pServerLimits->m_PlayerLimitData.find(pClient) != g_pServerLimits->m_PlayerLimitData.end()) { diff --git a/NorthstarDLL/shared/exploit_fixes/ns_limits.h b/primedev/shared/exploit_fixes/ns_limits.h index d1f7f2ed..546fec6f 100644 --- a/NorthstarDLL/shared/exploit_fixes/ns_limits.h +++ b/primedev/shared/exploit_fixes/ns_limits.h @@ -27,7 +27,7 @@ struct UnconnectedPlayerLimitData class ServerLimitsManager { - public: +public: ConVar* CVar_sv_quota_stringcmdspersecond; ConVar* Cvar_net_chan_limit_mode; ConVar* Cvar_net_chan_limit_msec_per_sec; @@ -37,16 +37,16 @@ class ServerLimitsManager ConVar* Cvar_sv_antispeedhack_maxtickbudget; ConVar* Cvar_sv_antispeedhack_budgetincreasemultiplier; - std::unordered_map<R2::CBaseClient*, PlayerLimitData> m_PlayerLimitData; + std::unordered_map<CBaseClient*, PlayerLimitData> m_PlayerLimitData; std::vector<UnconnectedPlayerLimitData> m_UnconnectedPlayerLimitData; - public: +public: void RunFrame(double flCurrentTime, float flFrameTime); - void AddPlayer(R2::CBaseClient* player); - void RemovePlayer(R2::CBaseClient* player); - bool CheckStringCommandLimits(R2::CBaseClient* player); - bool CheckChatLimits(R2::CBaseClient* player); - bool CheckConnectionlessPacketLimits(R2::netpacket_t* packet); + void AddPlayer(CBaseClient* player); + void RemovePlayer(CBaseClient* player); + bool CheckStringCommandLimits(CBaseClient* player); + bool CheckChatLimits(CBaseClient* player); + bool CheckConnectionlessPacketLimits(netpacket_t* packet); }; extern ServerLimitsManager* g_pServerLimits; diff --git a/NorthstarDLL/shared/keyvalues.cpp b/primedev/shared/keyvalues.cpp index aa22ca65..88753723 100644 --- a/NorthstarDLL/shared/keyvalues.cpp +++ b/primedev/shared/keyvalues.cpp @@ -17,7 +17,7 @@ typedef int HKeySymbol; struct CKeyValuesSystem { - public: +public: struct __VTable { char pad0[8 * 3]; // 2 methods diff --git a/NorthstarDLL/shared/keyvalues.h b/primedev/shared/keyvalues.h index 64ca0cc7..bd62797e 100644 --- a/NorthstarDLL/shared/keyvalues.h +++ b/primedev/shared/keyvalues.h @@ -48,10 +48,10 @@ enum MergeKeyValuesOp_t //----------------------------------------------------------------------------- class KeyValues { - private: +private: KeyValues(); // for internal use only - public: +public: // Constructors/destructors KeyValues(const char* pszSetName); KeyValues(const char* pszSetName, const char* pszFirstKey, const char* pszFirstValue); @@ -112,7 +112,7 @@ class KeyValues void CopySubkeys(KeyValues* pParent) const; KeyValues* MakeCopy(void) const; - public: +public: uint32_t m_iKeyName : 24; // 0x0000 uint32_t m_iKeyNameCaseSensitive1 : 8; // 0x0003 char* m_sValue; // 0x0008 diff --git a/NorthstarDLL/shared/maxplayers.cpp b/primedev/shared/maxplayers.cpp index 4af8ea1c..711193d4 100644 --- a/NorthstarDLL/shared/maxplayers.cpp +++ b/primedev/shared/maxplayers.cpp @@ -48,21 +48,17 @@ constexpr int Team_AddedSize = Team_PlayerArray_AddedSize; bool MaxPlayersIncreaseEnabled() { - static bool bMaxPlayersIncreaseEnabled = Tier0::CommandLine()->CheckParm("-experimentalmaxplayersincrease"); + static bool bMaxPlayersIncreaseEnabled = CommandLine()->CheckParm("-experimentalmaxplayersincrease"); return bMaxPlayersIncreaseEnabled; } -// should we use R2 for this? not sure -namespace R2 // use R2 namespace for game funcs +int GetMaxPlayers() { - int GetMaxPlayers() - { - if (MaxPlayersIncreaseEnabled()) - return NEW_MAX_PLAYERS; + if (MaxPlayersIncreaseEnabled()) + return NEW_MAX_PLAYERS; - return 32; - } -} // namespace R2 + return 32; +} template <class T> void ChangeOffset(CMemoryAddress addr, unsigned int offset) { diff --git a/primedev/shared/maxplayers.h b/primedev/shared/maxplayers.h new file mode 100644 index 00000000..40a3ac58 --- /dev/null +++ b/primedev/shared/maxplayers.h @@ -0,0 +1,3 @@ +#pragma once + +int GetMaxPlayers(); diff --git a/NorthstarDLL/shared/misccommands.cpp b/primedev/shared/misccommands.cpp index 5d9ced99..15da6767 100644 --- a/NorthstarDLL/shared/misccommands.cpp +++ b/primedev/shared/misccommands.cpp @@ -15,21 +15,21 @@ void ConCommand_force_newgame(const CCommand& arg) if (arg.ArgC() < 2) return; - R2::g_pHostState->m_iNextState = R2::HostState_t::HS_NEW_GAME; - strncpy(R2::g_pHostState->m_levelName, arg.Arg(1), sizeof(R2::g_pHostState->m_levelName)); + g_pHostState->m_iNextState = HostState_t::HS_NEW_GAME; + strncpy(g_pHostState->m_levelName, arg.Arg(1), sizeof(g_pHostState->m_levelName)); } void ConCommand_ns_start_reauth_and_leave_to_lobby(const CCommand& arg) { // hack for special case where we're on a local server, so we erase our own newly created auth data on disconnect g_pMasterServerManager->m_bNewgameAfterSelfAuth = true; - g_pMasterServerManager->AuthenticateWithOwnServer(R2::g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken); + g_pMasterServerManager->AuthenticateWithOwnServer(g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken); } void ConCommand_ns_end_reauth_and_leave_to_lobby(const CCommand& arg) { if (g_pServerAuthentication->m_RemoteAuthenticationData.size()) - R2::g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str()); + g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str()); // weird way of checking, but check if client script vm is initialised, mainly just to allow players to cancel this if (g_pSquirrel<ScriptContext::CLIENT>->m_pSQVM) @@ -39,8 +39,8 @@ void ConCommand_ns_end_reauth_and_leave_to_lobby(const CCommand& arg) // this won't set playlist correctly on remote clients, don't think they can set playlist until they've left which sorta // fucks things should maybe set this in HostState_NewGame? R2::SetCurrentPlaylist("tdm"); - strcpy(R2::g_pHostState->m_levelName, "mp_lobby"); - R2::g_pHostState->m_iNextState = R2::HostState_t::HS_NEW_GAME; + strcpy(g_pHostState->m_levelName, "mp_lobby"); + g_pHostState->m_iNextState = HostState_t::HS_NEW_GAME; } } @@ -52,7 +52,7 @@ void ConCommand_cvar_setdefaultvalue(const CCommand& arg) return; } - ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1)); + ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1)); if (!pCvar) { spdlog::info("usage: cvar_setdefaultvalue mp_gamemode tdm"); @@ -75,7 +75,7 @@ void ConCommand_cvar_setvalueanddefaultvalue(const CCommand& arg) return; } - ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1)); + ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1)); if (!pCvar) { spdlog::info("usage: cvar_setvalueanddefaultvalue mp_gamemode tdm"); @@ -99,7 +99,7 @@ void ConCommand_cvar_reset(const CCommand& arg) return; } - ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1)); + ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1)); if (!pCvar) { spdlog::info("usage: cvar_reset mp_gamemode"); @@ -143,11 +143,11 @@ void AddMiscConCommands() // fixes up various cvar flags to have more sane values void FixupCvarFlags() { - if (Tier0::CommandLine()->CheckParm("-allowdevcvars")) + if (CommandLine()->CheckParm("-allowdevcvars")) { // strip hidden and devonly cvar flags int iNumCvarsAltered = 0; - for (auto& pair : R2::g_pCVar->DumpToMap()) + for (auto& pair : g_pCVar->DumpToMap()) { // strip flags int flags = pair.second->GetFlags(); @@ -177,7 +177,7 @@ void FixupCvarFlags() int i = 0; do { - ConCommandBase* pCommand = R2::g_pCVar->FindCommandBase(ppEngineClientCommands[i]); + ConCommandBase* pCommand = g_pCVar->FindCommandBase(ppEngineClientCommands[i]); if (pCommand) // not all the commands in this array actually exist in respawn source pCommand->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS; } while (ppEngineClientCommands[++i]); @@ -367,21 +367,21 @@ void FixupCvarFlags() for (auto& fixup : CVAR_FIXUP_ADD_FLAGS) { - ConCommandBase* command = R2::g_pCVar->FindCommandBase(std::get<0>(fixup)); + ConCommandBase* command = g_pCVar->FindCommandBase(std::get<0>(fixup)); if (command) command->m_nFlags |= std::get<1>(fixup); } for (auto& fixup : CVAR_FIXUP_REMOVE_FLAGS) { - ConCommandBase* command = R2::g_pCVar->FindCommandBase(std::get<0>(fixup)); + ConCommandBase* command = g_pCVar->FindCommandBase(std::get<0>(fixup)); if (command) command->m_nFlags &= ~std::get<1>(fixup); } for (auto& fixup : CVAR_FIXUP_DEFAULT_VALUES) { - ConVar* cvar = R2::g_pCVar->FindVar(std::get<0>(fixup)); + ConVar* cvar = g_pCVar->FindVar(std::get<0>(fixup)); if (cvar && !strcmp(cvar->GetString(), cvar->m_pszDefaultValue)) { cvar->SetValue(std::get<1>(fixup)); diff --git a/NorthstarDLL/shared/misccommands.h b/primedev/shared/misccommands.h index 07a07fb3..07a07fb3 100644 --- a/NorthstarDLL/shared/misccommands.h +++ b/primedev/shared/misccommands.h diff --git a/NorthstarDLL/shared/playlist.cpp b/primedev/shared/playlist.cpp index ab7aab22..2b9ad979 100644 --- a/NorthstarDLL/shared/playlist.cpp +++ b/primedev/shared/playlist.cpp @@ -26,7 +26,7 @@ char, __fastcall, (void* a1, void* a2)) { // the private_match playlist on mp_lobby is the only situation where there should be any legitimate sending of this netmessage if (!Cvar_ns_use_clc_SetPlaylistVarOverride->GetBool() || strcmp(R2::GetCurrentPlaylistName(), "private_match") || - strcmp(R2::g_pGlobals->m_pMapName, "mp_lobby")) + strcmp(g_pGlobals->m_pMapName, "mp_lobby")) return 1; return clc_SetPlaylistVarOverride__Process(a1, a2); diff --git a/NorthstarDLL/shared/playlist.h b/primedev/shared/playlist.h index e56fdf96..e56fdf96 100644 --- a/NorthstarDLL/shared/playlist.h +++ b/primedev/shared/playlist.h diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/primedev/squirrel/squirrel.cpp index d8eff0d6..ac9a2ce9 100644 --- a/NorthstarDLL/squirrel/squirrel.cpp +++ b/primedev/squirrel/squirrel.cpp @@ -504,17 +504,17 @@ void __fastcall ScriptCompileErrorHook(HSquirrelVM* sqvm, const char* error, con } else { - R2::Cbuf_AddText( - R2::Cbuf_GetCurrentPlayer(), + Cbuf_AddText( + Cbuf_GetCurrentPlayer(), fmt::format("disconnect \"Encountered {} script compilation error, see console for details.\"", GetContextName(realContext)) .c_str(), - R2::cmd_source_t::kCommandSrcCode); + cmd_source_t::kCommandSrcCode); // likely temp: show console so user can see any errors, as error message wont display if ui is dead // maybe we could disable all mods other than the coremods and try a reload before doing this? // could also maybe do some vgui bullshit to show something visually rather than console if (realContext == ScriptContext::UI) - R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "showconsole", R2::cmd_source_t::kCommandSrcCode); + Cbuf_AddText(Cbuf_GetCurrentPlayer(), "showconsole", cmd_source_t::kCommandSrcCode); } } @@ -638,7 +638,7 @@ template <ScriptContext context, TemplateStringLiteral funcName> SQRESULT SQ_Stu template <ScriptContext context> void StubUnsafeSQFuncs() { - if (!Tier0::CommandLine()->CheckParm("-allowunsafesqfuncs")) + if (!CommandLine()->CheckParm("-allowunsafesqfuncs")) { g_pSquirrel<context>->AddFuncOverride("DevTextBufferWrite", SQ_StubbedFunc<context, "DevTextBufferWrite">); g_pSquirrel<context>->AddFuncOverride("DevTextBufferClear", SQ_StubbedFunc<context, "DevTextBufferClear">); diff --git a/NorthstarDLL/squirrel/squirrel.h b/primedev/squirrel/squirrel.h index 50dd31d0..a4932044 100644 --- a/NorthstarDLL/squirrel/squirrel.h +++ b/primedev/squirrel/squirrel.h @@ -64,10 +64,10 @@ namespace NS::log // Cuts down on compile time by ~5 seconds class SquirrelManagerBase { - protected: +protected: std::vector<SQFuncRegistration*> m_funcRegistrations; - public: +public: CSquirrelVM* m_pSQVM; std::map<std::string, SQFunction> m_funcOverrides = {}; std::map<std::string, SQFunction> m_funcOriginals = {}; @@ -319,7 +319,7 @@ class SquirrelManagerBase template <ScriptContext context> class SquirrelManager : public virtual SquirrelManagerBase { - public: +public: #pragma region MessageBuffer SquirrelMessageBuffer* messageBuffer; @@ -404,7 +404,7 @@ template <ScriptContext context> class SquirrelManager : public virtual Squirrel #pragma endregion - public: +public: SquirrelManager() { m_pSQVM = nullptr; diff --git a/NorthstarDLL/squirrel/squirrelautobind.cpp b/primedev/squirrel/squirrelautobind.cpp index c15240f5..c15240f5 100644 --- a/NorthstarDLL/squirrel/squirrelautobind.cpp +++ b/primedev/squirrel/squirrelautobind.cpp diff --git a/NorthstarDLL/squirrel/squirrelautobind.h b/primedev/squirrel/squirrelautobind.h index 19ecb808..0fc599f3 100644 --- a/NorthstarDLL/squirrel/squirrelautobind.h +++ b/primedev/squirrel/squirrelautobind.h @@ -5,7 +5,7 @@ typedef void (*SqAutoBindFunc)(); class SquirrelAutoBindContainer { - public: +public: std::vector<std::function<void()>> clientSqAutoBindFuncs; std::vector<std::function<void()>> serverSqAutoBindFuncs; }; @@ -61,7 +61,7 @@ class __squirrelautobind; class __squirrelautobind { - public: +public: __squirrelautobind() = delete; __squirrelautobind(std::function<void()> clientAutoBindFunc, std::function<void()> serverAutoBindFunc) diff --git a/NorthstarDLL/squirrel/squirrelclasstypes.h b/primedev/squirrel/squirrelclasstypes.h index c193f2fc..cd777551 100644 --- a/NorthstarDLL/squirrel/squirrelclasstypes.h +++ b/primedev/squirrel/squirrelclasstypes.h @@ -122,7 +122,7 @@ typedef void (*sq_schedule_call_externalType)( class SquirrelMessage { - public: +public: std::string functionName; FunctionVector args; bool isExternal = false; @@ -133,10 +133,10 @@ class SquirrelMessage class SquirrelMessageBuffer { - private: +private: std::queue<SquirrelMessage> messages = {}; - public: +public: std::mutex mutex; std::optional<SquirrelMessage> pop() { @@ -179,7 +179,7 @@ class SquirrelMessageBuffer // Super simple wrapper class to allow pushing Assets via call class SquirrelAsset { - public: +public: std::string path; SquirrelAsset(std::string path) : path(path) {}; }; diff --git a/NorthstarDLL/squirrel/squirreldatatypes.h b/primedev/squirrel/squirreldatatypes.h index 84ab15ec..84ab15ec 100644 --- a/NorthstarDLL/squirrel/squirreldatatypes.h +++ b/primedev/squirrel/squirreldatatypes.h diff --git a/thirdparty/libcurl b/primedev/thirdparty/libcurl -Subproject 801bd5138ce31aa0d906fa4e2eabfc599d74e79 +Subproject 801bd5138ce31aa0d906fa4e2eabfc599d74e79 diff --git a/thirdparty/minhook b/primedev/thirdparty/minhook -Subproject 0f25a2449b3cf878bcbdbf91b693c38149ecf02 +Subproject 0f25a2449b3cf878bcbdbf91b693c38149ecf02 diff --git a/thirdparty/minizip b/primedev/thirdparty/minizip -Subproject 680d6f1dcf9de99fc033b54975a1dfff10be2b6 +Subproject 680d6f1dcf9de99fc033b54975a1dfff10be2b6 diff --git a/thirdparty/rapidjson/allocators.h b/primedev/thirdparty/rapidjson/allocators.h index 98affe03..98affe03 100644 --- a/thirdparty/rapidjson/allocators.h +++ b/primedev/thirdparty/rapidjson/allocators.h diff --git a/thirdparty/rapidjson/document.h b/primedev/thirdparty/rapidjson/document.h index e3e20dfb..e3e20dfb 100644 --- a/thirdparty/rapidjson/document.h +++ b/primedev/thirdparty/rapidjson/document.h diff --git a/thirdparty/rapidjson/encodedstream.h b/primedev/thirdparty/rapidjson/encodedstream.h index 14506838..14506838 100644 --- a/thirdparty/rapidjson/encodedstream.h +++ b/primedev/thirdparty/rapidjson/encodedstream.h diff --git a/thirdparty/rapidjson/encodings.h b/primedev/thirdparty/rapidjson/encodings.h index baa7c2b1..baa7c2b1 100644 --- a/thirdparty/rapidjson/encodings.h +++ b/primedev/thirdparty/rapidjson/encodings.h diff --git a/thirdparty/rapidjson/error/en.h b/primedev/thirdparty/rapidjson/error/en.h index 2db838bf..2db838bf 100644 --- a/thirdparty/rapidjson/error/en.h +++ b/primedev/thirdparty/rapidjson/error/en.h diff --git a/thirdparty/rapidjson/error/error.h b/primedev/thirdparty/rapidjson/error/error.h index 95cb31a7..95cb31a7 100644 --- a/thirdparty/rapidjson/error/error.h +++ b/primedev/thirdparty/rapidjson/error/error.h diff --git a/thirdparty/rapidjson/filereadstream.h b/primedev/thirdparty/rapidjson/filereadstream.h index b56ea13b..b56ea13b 100644 --- a/thirdparty/rapidjson/filereadstream.h +++ b/primedev/thirdparty/rapidjson/filereadstream.h diff --git a/thirdparty/rapidjson/filewritestream.h b/primedev/thirdparty/rapidjson/filewritestream.h index 6378dd60..6378dd60 100644 --- a/thirdparty/rapidjson/filewritestream.h +++ b/primedev/thirdparty/rapidjson/filewritestream.h diff --git a/thirdparty/rapidjson/fwd.h b/primedev/thirdparty/rapidjson/fwd.h index e8104e84..e8104e84 100644 --- a/thirdparty/rapidjson/fwd.h +++ b/primedev/thirdparty/rapidjson/fwd.h diff --git a/thirdparty/rapidjson/internal/biginteger.h b/primedev/thirdparty/rapidjson/internal/biginteger.h index 9d3e88c9..9d3e88c9 100644 --- a/thirdparty/rapidjson/internal/biginteger.h +++ b/primedev/thirdparty/rapidjson/internal/biginteger.h diff --git a/thirdparty/rapidjson/internal/diyfp.h b/primedev/thirdparty/rapidjson/internal/diyfp.h index c9fefdc6..c9fefdc6 100644 --- a/thirdparty/rapidjson/internal/diyfp.h +++ b/primedev/thirdparty/rapidjson/internal/diyfp.h diff --git a/thirdparty/rapidjson/internal/dtoa.h b/primedev/thirdparty/rapidjson/internal/dtoa.h index 8d6350e6..8d6350e6 100644 --- a/thirdparty/rapidjson/internal/dtoa.h +++ b/primedev/thirdparty/rapidjson/internal/dtoa.h diff --git a/thirdparty/rapidjson/internal/ieee754.h b/primedev/thirdparty/rapidjson/internal/ieee754.h index 82bb0b99..82bb0b99 100644 --- a/thirdparty/rapidjson/internal/ieee754.h +++ b/primedev/thirdparty/rapidjson/internal/ieee754.h diff --git a/thirdparty/rapidjson/internal/itoa.h b/primedev/thirdparty/rapidjson/internal/itoa.h index 01a4e7e7..01a4e7e7 100644 --- a/thirdparty/rapidjson/internal/itoa.h +++ b/primedev/thirdparty/rapidjson/internal/itoa.h diff --git a/thirdparty/rapidjson/internal/meta.h b/primedev/thirdparty/rapidjson/internal/meta.h index 5a9aaa42..5a9aaa42 100644 --- a/thirdparty/rapidjson/internal/meta.h +++ b/primedev/thirdparty/rapidjson/internal/meta.h diff --git a/thirdparty/rapidjson/internal/pow10.h b/primedev/thirdparty/rapidjson/internal/pow10.h index 02f475d7..02f475d7 100644 --- a/thirdparty/rapidjson/internal/pow10.h +++ b/primedev/thirdparty/rapidjson/internal/pow10.h diff --git a/thirdparty/rapidjson/internal/regex.h b/primedev/thirdparty/rapidjson/internal/regex.h index 422a5240..422a5240 100644 --- a/thirdparty/rapidjson/internal/regex.h +++ b/primedev/thirdparty/rapidjson/internal/regex.h diff --git a/thirdparty/rapidjson/internal/stack.h b/primedev/thirdparty/rapidjson/internal/stack.h index 022c9aab..022c9aab 100644 --- a/thirdparty/rapidjson/internal/stack.h +++ b/primedev/thirdparty/rapidjson/internal/stack.h diff --git a/thirdparty/rapidjson/internal/strfunc.h b/primedev/thirdparty/rapidjson/internal/strfunc.h index 2edfae52..2edfae52 100644 --- a/thirdparty/rapidjson/internal/strfunc.h +++ b/primedev/thirdparty/rapidjson/internal/strfunc.h diff --git a/thirdparty/rapidjson/internal/strtod.h b/primedev/thirdparty/rapidjson/internal/strtod.h index 289c413b..289c413b 100644 --- a/thirdparty/rapidjson/internal/strtod.h +++ b/primedev/thirdparty/rapidjson/internal/strtod.h diff --git a/thirdparty/rapidjson/internal/swap.h b/primedev/thirdparty/rapidjson/internal/swap.h index 666e49f9..666e49f9 100644 --- a/thirdparty/rapidjson/internal/swap.h +++ b/primedev/thirdparty/rapidjson/internal/swap.h diff --git a/thirdparty/rapidjson/istreamwrapper.h b/primedev/thirdparty/rapidjson/istreamwrapper.h index f5fe2897..f5fe2897 100644 --- a/thirdparty/rapidjson/istreamwrapper.h +++ b/primedev/thirdparty/rapidjson/istreamwrapper.h diff --git a/thirdparty/rapidjson/memorybuffer.h b/primedev/thirdparty/rapidjson/memorybuffer.h index 39bee1de..39bee1de 100644 --- a/thirdparty/rapidjson/memorybuffer.h +++ b/primedev/thirdparty/rapidjson/memorybuffer.h diff --git a/thirdparty/rapidjson/memorystream.h b/primedev/thirdparty/rapidjson/memorystream.h index 1d71d8a4..1d71d8a4 100644 --- a/thirdparty/rapidjson/memorystream.h +++ b/primedev/thirdparty/rapidjson/memorystream.h diff --git a/thirdparty/rapidjson/msinttypes/inttypes.h b/primedev/thirdparty/rapidjson/msinttypes/inttypes.h index 18111286..18111286 100644 --- a/thirdparty/rapidjson/msinttypes/inttypes.h +++ b/primedev/thirdparty/rapidjson/msinttypes/inttypes.h diff --git a/thirdparty/rapidjson/msinttypes/stdint.h b/primedev/thirdparty/rapidjson/msinttypes/stdint.h index 3d4477b9..3d4477b9 100644 --- a/thirdparty/rapidjson/msinttypes/stdint.h +++ b/primedev/thirdparty/rapidjson/msinttypes/stdint.h diff --git a/thirdparty/rapidjson/ostreamwrapper.h b/primedev/thirdparty/rapidjson/ostreamwrapper.h index 6f4667c0..6f4667c0 100644 --- a/thirdparty/rapidjson/ostreamwrapper.h +++ b/primedev/thirdparty/rapidjson/ostreamwrapper.h diff --git a/thirdparty/rapidjson/pointer.h b/primedev/thirdparty/rapidjson/pointer.h index 0206ac1c..0206ac1c 100644 --- a/thirdparty/rapidjson/pointer.h +++ b/primedev/thirdparty/rapidjson/pointer.h diff --git a/thirdparty/rapidjson/prettywriter.h b/primedev/thirdparty/rapidjson/prettywriter.h index 0dcb0fee..0dcb0fee 100644 --- a/thirdparty/rapidjson/prettywriter.h +++ b/primedev/thirdparty/rapidjson/prettywriter.h diff --git a/thirdparty/rapidjson/rapidjson.h b/primedev/thirdparty/rapidjson/rapidjson.h index 053b2ce4..053b2ce4 100644 --- a/thirdparty/rapidjson/rapidjson.h +++ b/primedev/thirdparty/rapidjson/rapidjson.h diff --git a/thirdparty/rapidjson/reader.h b/primedev/thirdparty/rapidjson/reader.h index 19f8849b..19f8849b 100644 --- a/thirdparty/rapidjson/reader.h +++ b/primedev/thirdparty/rapidjson/reader.h diff --git a/thirdparty/rapidjson/schema.h b/primedev/thirdparty/rapidjson/schema.h index b182aa27..b182aa27 100644 --- a/thirdparty/rapidjson/schema.h +++ b/primedev/thirdparty/rapidjson/schema.h diff --git a/thirdparty/rapidjson/stream.h b/primedev/thirdparty/rapidjson/stream.h index fef82c25..fef82c25 100644 --- a/thirdparty/rapidjson/stream.h +++ b/primedev/thirdparty/rapidjson/stream.h diff --git a/thirdparty/rapidjson/stringbuffer.h b/primedev/thirdparty/rapidjson/stringbuffer.h index 78f34d20..78f34d20 100644 --- a/thirdparty/rapidjson/stringbuffer.h +++ b/primedev/thirdparty/rapidjson/stringbuffer.h diff --git a/thirdparty/rapidjson/writer.h b/primedev/thirdparty/rapidjson/writer.h index 94f22dd5..94f22dd5 100644 --- a/thirdparty/rapidjson/writer.h +++ b/primedev/thirdparty/rapidjson/writer.h diff --git a/thirdparty/spdlog/async.h b/primedev/thirdparty/spdlog/async.h index f7956305..f7956305 100644 --- a/thirdparty/spdlog/async.h +++ b/primedev/thirdparty/spdlog/async.h diff --git a/thirdparty/spdlog/async_logger-inl.h b/primedev/thirdparty/spdlog/async_logger-inl.h index f8c9694c..f8c9694c 100644 --- a/thirdparty/spdlog/async_logger-inl.h +++ b/primedev/thirdparty/spdlog/async_logger-inl.h diff --git a/thirdparty/spdlog/async_logger.h b/primedev/thirdparty/spdlog/async_logger.h index 6f299672..6f299672 100644 --- a/thirdparty/spdlog/async_logger.h +++ b/primedev/thirdparty/spdlog/async_logger.h diff --git a/thirdparty/spdlog/cfg/argv.h b/primedev/thirdparty/spdlog/cfg/argv.h index 36d9f1c4..36d9f1c4 100644 --- a/thirdparty/spdlog/cfg/argv.h +++ b/primedev/thirdparty/spdlog/cfg/argv.h diff --git a/thirdparty/spdlog/cfg/env.h b/primedev/thirdparty/spdlog/cfg/env.h index 1f39ebbb..1f39ebbb 100644 --- a/thirdparty/spdlog/cfg/env.h +++ b/primedev/thirdparty/spdlog/cfg/env.h diff --git a/thirdparty/spdlog/cfg/helpers-inl.h b/primedev/thirdparty/spdlog/cfg/helpers-inl.h index 9e4daede..9e4daede 100644 --- a/thirdparty/spdlog/cfg/helpers-inl.h +++ b/primedev/thirdparty/spdlog/cfg/helpers-inl.h diff --git a/thirdparty/spdlog/cfg/helpers.h b/primedev/thirdparty/spdlog/cfg/helpers.h index a795f39a..a795f39a 100644 --- a/thirdparty/spdlog/cfg/helpers.h +++ b/primedev/thirdparty/spdlog/cfg/helpers.h diff --git a/thirdparty/spdlog/common-inl.h b/primedev/thirdparty/spdlog/common-inl.h index 378efe60..378efe60 100644 --- a/thirdparty/spdlog/common-inl.h +++ b/primedev/thirdparty/spdlog/common-inl.h diff --git a/thirdparty/spdlog/common.h b/primedev/thirdparty/spdlog/common.h index fb9a3660..fb9a3660 100644 --- a/thirdparty/spdlog/common.h +++ b/primedev/thirdparty/spdlog/common.h diff --git a/thirdparty/spdlog/details/backtracer-inl.h b/primedev/thirdparty/spdlog/details/backtracer-inl.h index 21553c26..21553c26 100644 --- a/thirdparty/spdlog/details/backtracer-inl.h +++ b/primedev/thirdparty/spdlog/details/backtracer-inl.h diff --git a/thirdparty/spdlog/details/backtracer.h b/primedev/thirdparty/spdlog/details/backtracer.h index 1da5d4c7..1da5d4c7 100644 --- a/thirdparty/spdlog/details/backtracer.h +++ b/primedev/thirdparty/spdlog/details/backtracer.h diff --git a/thirdparty/spdlog/details/circular_q.h b/primedev/thirdparty/spdlog/details/circular_q.h index 1f2712e7..1f2712e7 100644 --- a/thirdparty/spdlog/details/circular_q.h +++ b/primedev/thirdparty/spdlog/details/circular_q.h diff --git a/thirdparty/spdlog/details/console_globals.h b/primedev/thirdparty/spdlog/details/console_globals.h index 665201dd..665201dd 100644 --- a/thirdparty/spdlog/details/console_globals.h +++ b/primedev/thirdparty/spdlog/details/console_globals.h diff --git a/thirdparty/spdlog/details/file_helper-inl.h b/primedev/thirdparty/spdlog/details/file_helper-inl.h index 30f3cf55..30f3cf55 100644 --- a/thirdparty/spdlog/details/file_helper-inl.h +++ b/primedev/thirdparty/spdlog/details/file_helper-inl.h diff --git a/thirdparty/spdlog/details/file_helper.h b/primedev/thirdparty/spdlog/details/file_helper.h index 5395d9cb..5395d9cb 100644 --- a/thirdparty/spdlog/details/file_helper.h +++ b/primedev/thirdparty/spdlog/details/file_helper.h diff --git a/thirdparty/spdlog/details/fmt_helper.h b/primedev/thirdparty/spdlog/details/fmt_helper.h index 5dc311a0..5dc311a0 100644 --- a/thirdparty/spdlog/details/fmt_helper.h +++ b/primedev/thirdparty/spdlog/details/fmt_helper.h diff --git a/thirdparty/spdlog/details/log_msg-inl.h b/primedev/thirdparty/spdlog/details/log_msg-inl.h index af11e0da..af11e0da 100644 --- a/thirdparty/spdlog/details/log_msg-inl.h +++ b/primedev/thirdparty/spdlog/details/log_msg-inl.h diff --git a/thirdparty/spdlog/details/log_msg.h b/primedev/thirdparty/spdlog/details/log_msg.h index 834ca4df..834ca4df 100644 --- a/thirdparty/spdlog/details/log_msg.h +++ b/primedev/thirdparty/spdlog/details/log_msg.h diff --git a/thirdparty/spdlog/details/log_msg_buffer-inl.h b/primedev/thirdparty/spdlog/details/log_msg_buffer-inl.h index ca9429bb..ca9429bb 100644 --- a/thirdparty/spdlog/details/log_msg_buffer-inl.h +++ b/primedev/thirdparty/spdlog/details/log_msg_buffer-inl.h diff --git a/thirdparty/spdlog/details/log_msg_buffer.h b/primedev/thirdparty/spdlog/details/log_msg_buffer.h index 4410110f..4410110f 100644 --- a/thirdparty/spdlog/details/log_msg_buffer.h +++ b/primedev/thirdparty/spdlog/details/log_msg_buffer.h diff --git a/thirdparty/spdlog/details/mpmc_blocking_q.h b/primedev/thirdparty/spdlog/details/mpmc_blocking_q.h index 5c3cca76..5c3cca76 100644 --- a/thirdparty/spdlog/details/mpmc_blocking_q.h +++ b/primedev/thirdparty/spdlog/details/mpmc_blocking_q.h diff --git a/thirdparty/spdlog/details/null_mutex.h b/primedev/thirdparty/spdlog/details/null_mutex.h index 83533d4f..83533d4f 100644 --- a/thirdparty/spdlog/details/null_mutex.h +++ b/primedev/thirdparty/spdlog/details/null_mutex.h diff --git a/thirdparty/spdlog/details/os-inl.h b/primedev/thirdparty/spdlog/details/os-inl.h index a701e13f..a701e13f 100644 --- a/thirdparty/spdlog/details/os-inl.h +++ b/primedev/thirdparty/spdlog/details/os-inl.h diff --git a/thirdparty/spdlog/details/os.h b/primedev/thirdparty/spdlog/details/os.h index 9fda1447..9fda1447 100644 --- a/thirdparty/spdlog/details/os.h +++ b/primedev/thirdparty/spdlog/details/os.h diff --git a/thirdparty/spdlog/details/periodic_worker-inl.h b/primedev/thirdparty/spdlog/details/periodic_worker-inl.h index 1d794994..1d794994 100644 --- a/thirdparty/spdlog/details/periodic_worker-inl.h +++ b/primedev/thirdparty/spdlog/details/periodic_worker-inl.h diff --git a/thirdparty/spdlog/details/periodic_worker.h b/primedev/thirdparty/spdlog/details/periodic_worker.h index 42373665..42373665 100644 --- a/thirdparty/spdlog/details/periodic_worker.h +++ b/primedev/thirdparty/spdlog/details/periodic_worker.h diff --git a/thirdparty/spdlog/details/registry-inl.h b/primedev/thirdparty/spdlog/details/registry-inl.h index a60faabc..a60faabc 100644 --- a/thirdparty/spdlog/details/registry-inl.h +++ b/primedev/thirdparty/spdlog/details/registry-inl.h diff --git a/thirdparty/spdlog/details/registry.h b/primedev/thirdparty/spdlog/details/registry.h index b069c3f5..b069c3f5 100644 --- a/thirdparty/spdlog/details/registry.h +++ b/primedev/thirdparty/spdlog/details/registry.h diff --git a/thirdparty/spdlog/details/synchronous_factory.h b/primedev/thirdparty/spdlog/details/synchronous_factory.h index e1e42268..e1e42268 100644 --- a/thirdparty/spdlog/details/synchronous_factory.h +++ b/primedev/thirdparty/spdlog/details/synchronous_factory.h diff --git a/thirdparty/spdlog/details/tcp_client-windows.h b/primedev/thirdparty/spdlog/details/tcp_client-windows.h index 7ee72927..7ee72927 100644 --- a/thirdparty/spdlog/details/tcp_client-windows.h +++ b/primedev/thirdparty/spdlog/details/tcp_client-windows.h diff --git a/thirdparty/spdlog/details/tcp_client.h b/primedev/thirdparty/spdlog/details/tcp_client.h index 9f3bb99e..9f3bb99e 100644 --- a/thirdparty/spdlog/details/tcp_client.h +++ b/primedev/thirdparty/spdlog/details/tcp_client.h diff --git a/thirdparty/spdlog/details/thread_pool-inl.h b/primedev/thirdparty/spdlog/details/thread_pool-inl.h index c1df4361..c1df4361 100644 --- a/thirdparty/spdlog/details/thread_pool-inl.h +++ b/primedev/thirdparty/spdlog/details/thread_pool-inl.h diff --git a/thirdparty/spdlog/details/thread_pool.h b/primedev/thirdparty/spdlog/details/thread_pool.h index 61e25252..61e25252 100644 --- a/thirdparty/spdlog/details/thread_pool.h +++ b/primedev/thirdparty/spdlog/details/thread_pool.h diff --git a/thirdparty/spdlog/details/windows_include.h b/primedev/thirdparty/spdlog/details/windows_include.h index 6a2f14f9..6a2f14f9 100644 --- a/thirdparty/spdlog/details/windows_include.h +++ b/primedev/thirdparty/spdlog/details/windows_include.h diff --git a/thirdparty/spdlog/fmt/bin_to_hex.h b/primedev/thirdparty/spdlog/fmt/bin_to_hex.h index 1e2b054b..1e2b054b 100644 --- a/thirdparty/spdlog/fmt/bin_to_hex.h +++ b/primedev/thirdparty/spdlog/fmt/bin_to_hex.h diff --git a/thirdparty/spdlog/fmt/bundled/LICENSE.rst b/primedev/thirdparty/spdlog/fmt/bundled/LICENSE.rst index f0ec3db4..f0ec3db4 100644 --- a/thirdparty/spdlog/fmt/bundled/LICENSE.rst +++ b/primedev/thirdparty/spdlog/fmt/bundled/LICENSE.rst diff --git a/thirdparty/spdlog/fmt/bundled/chrono.h b/primedev/thirdparty/spdlog/fmt/bundled/chrono.h index bdfe2aa0..bdfe2aa0 100644 --- a/thirdparty/spdlog/fmt/bundled/chrono.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/chrono.h diff --git a/thirdparty/spdlog/fmt/bundled/color.h b/primedev/thirdparty/spdlog/fmt/bundled/color.h index 94e3419d..94e3419d 100644 --- a/thirdparty/spdlog/fmt/bundled/color.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/color.h diff --git a/thirdparty/spdlog/fmt/bundled/compile.h b/primedev/thirdparty/spdlog/fmt/bundled/compile.h index 3a33b020..3a33b020 100644 --- a/thirdparty/spdlog/fmt/bundled/compile.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/compile.h diff --git a/thirdparty/spdlog/fmt/bundled/core.h b/primedev/thirdparty/spdlog/fmt/bundled/core.h index 0a81e0cc..0a81e0cc 100644 --- a/thirdparty/spdlog/fmt/bundled/core.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/core.h diff --git a/thirdparty/spdlog/fmt/bundled/format-inl.h b/primedev/thirdparty/spdlog/fmt/bundled/format-inl.h index 8f2fe735..8f2fe735 100644 --- a/thirdparty/spdlog/fmt/bundled/format-inl.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/format-inl.h diff --git a/thirdparty/spdlog/fmt/bundled/format.h b/primedev/thirdparty/spdlog/fmt/bundled/format.h index 1a037b02..1a037b02 100644 --- a/thirdparty/spdlog/fmt/bundled/format.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/format.h diff --git a/thirdparty/spdlog/fmt/bundled/locale.h b/primedev/thirdparty/spdlog/fmt/bundled/locale.h index 7301bf92..7301bf92 100644 --- a/thirdparty/spdlog/fmt/bundled/locale.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/locale.h diff --git a/thirdparty/spdlog/fmt/bundled/os.h b/primedev/thirdparty/spdlog/fmt/bundled/os.h index d44ea0c9..d44ea0c9 100644 --- a/thirdparty/spdlog/fmt/bundled/os.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/os.h diff --git a/thirdparty/spdlog/fmt/bundled/ostream.h b/primedev/thirdparty/spdlog/fmt/bundled/ostream.h index 29c58ec1..29c58ec1 100644 --- a/thirdparty/spdlog/fmt/bundled/ostream.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/ostream.h diff --git a/thirdparty/spdlog/fmt/bundled/posix.h b/primedev/thirdparty/spdlog/fmt/bundled/posix.h index da19e9d5..da19e9d5 100644 --- a/thirdparty/spdlog/fmt/bundled/posix.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/posix.h diff --git a/thirdparty/spdlog/fmt/bundled/printf.h b/primedev/thirdparty/spdlog/fmt/bundled/printf.h index 8c28ac23..8c28ac23 100644 --- a/thirdparty/spdlog/fmt/bundled/printf.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/printf.h diff --git a/thirdparty/spdlog/fmt/bundled/ranges.h b/primedev/thirdparty/spdlog/fmt/bundled/ranges.h index 632f0494..632f0494 100644 --- a/thirdparty/spdlog/fmt/bundled/ranges.h +++ b/primedev/thirdparty/spdlog/fmt/bundled/ranges.h diff --git a/thirdparty/spdlog/fmt/chrono.h b/primedev/thirdparty/spdlog/fmt/chrono.h index e1fb7a06..e1fb7a06 100644 --- a/thirdparty/spdlog/fmt/chrono.h +++ b/primedev/thirdparty/spdlog/fmt/chrono.h diff --git a/thirdparty/spdlog/fmt/fmt.h b/primedev/thirdparty/spdlog/fmt/fmt.h index ec10ac33..ec10ac33 100644 --- a/thirdparty/spdlog/fmt/fmt.h +++ b/primedev/thirdparty/spdlog/fmt/fmt.h diff --git a/thirdparty/spdlog/fmt/ostr.h b/primedev/thirdparty/spdlog/fmt/ostr.h index f82eb679..f82eb679 100644 --- a/thirdparty/spdlog/fmt/ostr.h +++ b/primedev/thirdparty/spdlog/fmt/ostr.h diff --git a/thirdparty/spdlog/formatter.h b/primedev/thirdparty/spdlog/formatter.h index 5086fb21..5086fb21 100644 --- a/thirdparty/spdlog/formatter.h +++ b/primedev/thirdparty/spdlog/formatter.h diff --git a/thirdparty/spdlog/fwd.h b/primedev/thirdparty/spdlog/fwd.h index cc05ddd4..cc05ddd4 100644 --- a/thirdparty/spdlog/fwd.h +++ b/primedev/thirdparty/spdlog/fwd.h diff --git a/thirdparty/spdlog/logger-inl.h b/primedev/thirdparty/spdlog/logger-inl.h index d01c08da..d01c08da 100644 --- a/thirdparty/spdlog/logger-inl.h +++ b/primedev/thirdparty/spdlog/logger-inl.h diff --git a/thirdparty/spdlog/logger.h b/primedev/thirdparty/spdlog/logger.h index a34c5221..a34c5221 100644 --- a/thirdparty/spdlog/logger.h +++ b/primedev/thirdparty/spdlog/logger.h diff --git a/thirdparty/spdlog/pattern_formatter-inl.h b/primedev/thirdparty/spdlog/pattern_formatter-inl.h index 54346e1e..54346e1e 100644 --- a/thirdparty/spdlog/pattern_formatter-inl.h +++ b/primedev/thirdparty/spdlog/pattern_formatter-inl.h diff --git a/thirdparty/spdlog/pattern_formatter.h b/primedev/thirdparty/spdlog/pattern_formatter.h index bc13ae10..bc13ae10 100644 --- a/thirdparty/spdlog/pattern_formatter.h +++ b/primedev/thirdparty/spdlog/pattern_formatter.h diff --git a/thirdparty/spdlog/sinks/android_sink.h b/primedev/thirdparty/spdlog/sinks/android_sink.h index 659beabb..659beabb 100644 --- a/thirdparty/spdlog/sinks/android_sink.h +++ b/primedev/thirdparty/spdlog/sinks/android_sink.h diff --git a/thirdparty/spdlog/sinks/ansicolor_sink-inl.h b/primedev/thirdparty/spdlog/sinks/ansicolor_sink-inl.h index 61c0a719..61c0a719 100644 --- a/thirdparty/spdlog/sinks/ansicolor_sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/ansicolor_sink-inl.h diff --git a/thirdparty/spdlog/sinks/ansicolor_sink.h b/primedev/thirdparty/spdlog/sinks/ansicolor_sink.h index 4438f706..4438f706 100644 --- a/thirdparty/spdlog/sinks/ansicolor_sink.h +++ b/primedev/thirdparty/spdlog/sinks/ansicolor_sink.h diff --git a/thirdparty/spdlog/sinks/base_sink-inl.h b/primedev/thirdparty/spdlog/sinks/base_sink-inl.h index b15fb0e6..b15fb0e6 100644 --- a/thirdparty/spdlog/sinks/base_sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/base_sink-inl.h diff --git a/thirdparty/spdlog/sinks/base_sink.h b/primedev/thirdparty/spdlog/sinks/base_sink.h index bf5072f8..bf5072f8 100644 --- a/thirdparty/spdlog/sinks/base_sink.h +++ b/primedev/thirdparty/spdlog/sinks/base_sink.h diff --git a/thirdparty/spdlog/sinks/basic_file_sink-inl.h b/primedev/thirdparty/spdlog/sinks/basic_file_sink-inl.h index 1260d15c..1260d15c 100644 --- a/thirdparty/spdlog/sinks/basic_file_sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/basic_file_sink-inl.h diff --git a/thirdparty/spdlog/sinks/basic_file_sink.h b/primedev/thirdparty/spdlog/sinks/basic_file_sink.h index 4a742624..4a742624 100644 --- a/thirdparty/spdlog/sinks/basic_file_sink.h +++ b/primedev/thirdparty/spdlog/sinks/basic_file_sink.h diff --git a/thirdparty/spdlog/sinks/daily_file_sink.h b/primedev/thirdparty/spdlog/sinks/daily_file_sink.h index 16be821a..16be821a 100644 --- a/thirdparty/spdlog/sinks/daily_file_sink.h +++ b/primedev/thirdparty/spdlog/sinks/daily_file_sink.h diff --git a/thirdparty/spdlog/sinks/dist_sink.h b/primedev/thirdparty/spdlog/sinks/dist_sink.h index 8fccb4ee..8fccb4ee 100644 --- a/thirdparty/spdlog/sinks/dist_sink.h +++ b/primedev/thirdparty/spdlog/sinks/dist_sink.h diff --git a/thirdparty/spdlog/sinks/dup_filter_sink.h b/primedev/thirdparty/spdlog/sinks/dup_filter_sink.h index c9a08d68..c9a08d68 100644 --- a/thirdparty/spdlog/sinks/dup_filter_sink.h +++ b/primedev/thirdparty/spdlog/sinks/dup_filter_sink.h diff --git a/thirdparty/spdlog/sinks/hourly_file_sink.h b/primedev/thirdparty/spdlog/sinks/hourly_file_sink.h index f5e34366..f5e34366 100644 --- a/thirdparty/spdlog/sinks/hourly_file_sink.h +++ b/primedev/thirdparty/spdlog/sinks/hourly_file_sink.h diff --git a/thirdparty/spdlog/sinks/msvc_sink.h b/primedev/thirdparty/spdlog/sinks/msvc_sink.h index 8fec428d..8fec428d 100644 --- a/thirdparty/spdlog/sinks/msvc_sink.h +++ b/primedev/thirdparty/spdlog/sinks/msvc_sink.h diff --git a/thirdparty/spdlog/sinks/null_sink.h b/primedev/thirdparty/spdlog/sinks/null_sink.h index eb832801..eb832801 100644 --- a/thirdparty/spdlog/sinks/null_sink.h +++ b/primedev/thirdparty/spdlog/sinks/null_sink.h diff --git a/thirdparty/spdlog/sinks/ostream_sink.h b/primedev/thirdparty/spdlog/sinks/ostream_sink.h index 95c1e962..95c1e962 100644 --- a/thirdparty/spdlog/sinks/ostream_sink.h +++ b/primedev/thirdparty/spdlog/sinks/ostream_sink.h diff --git a/thirdparty/spdlog/sinks/ringbuffer_sink.h b/primedev/thirdparty/spdlog/sinks/ringbuffer_sink.h index 1ee3f691..1ee3f691 100644 --- a/thirdparty/spdlog/sinks/ringbuffer_sink.h +++ b/primedev/thirdparty/spdlog/sinks/ringbuffer_sink.h diff --git a/thirdparty/spdlog/sinks/rotating_file_sink-inl.h b/primedev/thirdparty/spdlog/sinks/rotating_file_sink-inl.h index d715ebf3..d715ebf3 100644 --- a/thirdparty/spdlog/sinks/rotating_file_sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/rotating_file_sink-inl.h diff --git a/thirdparty/spdlog/sinks/rotating_file_sink.h b/primedev/thirdparty/spdlog/sinks/rotating_file_sink.h index e1e85a7d..e1e85a7d 100644 --- a/thirdparty/spdlog/sinks/rotating_file_sink.h +++ b/primedev/thirdparty/spdlog/sinks/rotating_file_sink.h diff --git a/thirdparty/spdlog/sinks/sink-inl.h b/primedev/thirdparty/spdlog/sinks/sink-inl.h index a8dd6a6c..a8dd6a6c 100644 --- a/thirdparty/spdlog/sinks/sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/sink-inl.h diff --git a/thirdparty/spdlog/sinks/sink.h b/primedev/thirdparty/spdlog/sinks/sink.h index be99744d..be99744d 100644 --- a/thirdparty/spdlog/sinks/sink.h +++ b/primedev/thirdparty/spdlog/sinks/sink.h diff --git a/thirdparty/spdlog/sinks/stdout_color_sinks-inl.h b/primedev/thirdparty/spdlog/sinks/stdout_color_sinks-inl.h index 935f1ccc..935f1ccc 100644 --- a/thirdparty/spdlog/sinks/stdout_color_sinks-inl.h +++ b/primedev/thirdparty/spdlog/sinks/stdout_color_sinks-inl.h diff --git a/thirdparty/spdlog/sinks/stdout_color_sinks.h b/primedev/thirdparty/spdlog/sinks/stdout_color_sinks.h index e67aa91b..e67aa91b 100644 --- a/thirdparty/spdlog/sinks/stdout_color_sinks.h +++ b/primedev/thirdparty/spdlog/sinks/stdout_color_sinks.h diff --git a/thirdparty/spdlog/sinks/stdout_sinks-inl.h b/primedev/thirdparty/spdlog/sinks/stdout_sinks-inl.h index 25192607..25192607 100644 --- a/thirdparty/spdlog/sinks/stdout_sinks-inl.h +++ b/primedev/thirdparty/spdlog/sinks/stdout_sinks-inl.h diff --git a/thirdparty/spdlog/sinks/stdout_sinks.h b/primedev/thirdparty/spdlog/sinks/stdout_sinks.h index 40688a46..40688a46 100644 --- a/thirdparty/spdlog/sinks/stdout_sinks.h +++ b/primedev/thirdparty/spdlog/sinks/stdout_sinks.h diff --git a/thirdparty/spdlog/sinks/syslog_sink.h b/primedev/thirdparty/spdlog/sinks/syslog_sink.h index 7c38fcb5..7c38fcb5 100644 --- a/thirdparty/spdlog/sinks/syslog_sink.h +++ b/primedev/thirdparty/spdlog/sinks/syslog_sink.h diff --git a/thirdparty/spdlog/sinks/systemd_sink.h b/primedev/thirdparty/spdlog/sinks/systemd_sink.h index d23824b8..d23824b8 100644 --- a/thirdparty/spdlog/sinks/systemd_sink.h +++ b/primedev/thirdparty/spdlog/sinks/systemd_sink.h diff --git a/thirdparty/spdlog/sinks/tcp_sink.h b/primedev/thirdparty/spdlog/sinks/tcp_sink.h index 9dd9e51d..9dd9e51d 100644 --- a/thirdparty/spdlog/sinks/tcp_sink.h +++ b/primedev/thirdparty/spdlog/sinks/tcp_sink.h diff --git a/thirdparty/spdlog/sinks/win_eventlog_sink.h b/primedev/thirdparty/spdlog/sinks/win_eventlog_sink.h index 68170dd9..68170dd9 100644 --- a/thirdparty/spdlog/sinks/win_eventlog_sink.h +++ b/primedev/thirdparty/spdlog/sinks/win_eventlog_sink.h diff --git a/thirdparty/spdlog/sinks/wincolor_sink-inl.h b/primedev/thirdparty/spdlog/sinks/wincolor_sink-inl.h index e2676d3c..e2676d3c 100644 --- a/thirdparty/spdlog/sinks/wincolor_sink-inl.h +++ b/primedev/thirdparty/spdlog/sinks/wincolor_sink-inl.h diff --git a/thirdparty/spdlog/sinks/wincolor_sink.h b/primedev/thirdparty/spdlog/sinks/wincolor_sink.h index a82f1b24..a82f1b24 100644 --- a/thirdparty/spdlog/sinks/wincolor_sink.h +++ b/primedev/thirdparty/spdlog/sinks/wincolor_sink.h diff --git a/thirdparty/spdlog/spdlog-inl.h b/primedev/thirdparty/spdlog/spdlog-inl.h index 96e09f59..96e09f59 100644 --- a/thirdparty/spdlog/spdlog-inl.h +++ b/primedev/thirdparty/spdlog/spdlog-inl.h diff --git a/thirdparty/spdlog/spdlog.h b/primedev/thirdparty/spdlog/spdlog.h index bb130d94..bb130d94 100644 --- a/thirdparty/spdlog/spdlog.h +++ b/primedev/thirdparty/spdlog/spdlog.h diff --git a/thirdparty/spdlog/stopwatch.h b/primedev/thirdparty/spdlog/stopwatch.h index bb976b19..bb976b19 100644 --- a/thirdparty/spdlog/stopwatch.h +++ b/primedev/thirdparty/spdlog/stopwatch.h diff --git a/thirdparty/spdlog/tweakme.h b/primedev/thirdparty/spdlog/tweakme.h index 31e417ab..31e417ab 100644 --- a/thirdparty/spdlog/tweakme.h +++ b/primedev/thirdparty/spdlog/tweakme.h diff --git a/thirdparty/spdlog/version.h b/primedev/thirdparty/spdlog/version.h index 828f78cb..828f78cb 100644 --- a/thirdparty/spdlog/version.h +++ b/primedev/thirdparty/spdlog/version.h diff --git a/NorthstarDLL/util/printcommands.cpp b/primedev/util/printcommands.cpp index 7c915318..34d56666 100644 --- a/NorthstarDLL/util/printcommands.cpp +++ b/primedev/util/printcommands.cpp @@ -12,7 +12,7 @@ void PrintCommandHelpDialogue(const ConCommandBase* command, const char* name) } // temp because command->IsCommand does not currently work - ConVar* cvar = R2::g_pCVar->FindVar(command->m_pszName); + ConVar* cvar = g_pCVar->FindVar(command->m_pszName); // build string for flags if not FCVAR_NONE std::string flagString; @@ -66,7 +66,7 @@ void TryPrintCvarHelpForCommand(const char* pCommand) } // check if we're inputting a cvar, but not setting it at all - ConVar* cvar = R2::g_pCVar->FindVar(pCvarStr); + ConVar* cvar = g_pCVar->FindVar(pCvarStr); if (cvar) PrintCommandHelpDialogue(&cvar->m_ConCommandBase, pCvarStr); @@ -81,7 +81,7 @@ void ConCommand_help(const CCommand& arg) return; } - PrintCommandHelpDialogue(R2::g_pCVar->FindCommandBase(arg.Arg(1)), arg.Arg(1)); + PrintCommandHelpDialogue(g_pCVar->FindCommandBase(arg.Arg(1)), arg.Arg(1)); } void ConCommand_find(const CCommand& arg) @@ -96,7 +96,7 @@ void ConCommand_find(const CCommand& arg) char pTempSearchTerm[256]; ConCommandBase* var; - CCVarIteratorInternal* itint = R2::g_pCVar->FactoryInternalIterator(); + CCVarIteratorInternal* itint = g_pCVar->FactoryInternalIterator(); std::map<std::string, ConCommandBase*> sorted; for (itint->SetFirst(); itint->IsValid(); itint->Next()) { @@ -165,7 +165,7 @@ void ConCommand_findflags(const CCommand& arg) } ConCommandBase* var; - CCVarIteratorInternal* itint = R2::g_pCVar->FactoryInternalIterator(); + CCVarIteratorInternal* itint = g_pCVar->FactoryInternalIterator(); std::map<std::string, ConCommandBase*> sorted; for (itint->SetFirst(); itint->IsValid(); itint->Next()) { @@ -189,7 +189,7 @@ void ConCommand_findflags(const CCommand& arg) void ConCommand_list(const CCommand& arg) { ConCommandBase* var; - CCVarIteratorInternal* itint = R2::g_pCVar->FactoryInternalIterator(); + CCVarIteratorInternal* itint = g_pCVar->FactoryInternalIterator(); std::map<std::string, ConCommandBase*> sorted; for (itint->SetFirst(); itint->IsValid(); itint->Next()) { @@ -210,7 +210,7 @@ void ConCommand_list(const CCommand& arg) void ConCommand_differences(const CCommand& arg) { - CCVarIteratorInternal* itint = R2::g_pCVar->FactoryInternalIterator(); + CCVarIteratorInternal* itint = g_pCVar->FactoryInternalIterator(); std::map<std::string, ConCommandBase*> sorted; for (itint->SetFirst(); itint->IsValid(); itint->Next()) @@ -225,7 +225,7 @@ void ConCommand_differences(const CCommand& arg) for (auto& map : sorted) { - ConVar* cvar = R2::g_pCVar->FindVar(map.second->m_pszName); + ConVar* cvar = g_pCVar->FindVar(map.second->m_pszName); if (!cvar) { @@ -267,19 +267,19 @@ void InitialiseCommandPrint() // these commands already exist, so we need to modify the preexisting command to use our func instead // and clear the flags also - ConCommand* helpCommand = R2::g_pCVar->FindCommand("help"); + ConCommand* helpCommand = g_pCVar->FindCommand("help"); helpCommand->m_nFlags = FCVAR_NONE; helpCommand->m_pCommandCallback = ConCommand_help; - ConCommand* findCommand = R2::g_pCVar->FindCommand("convar_findByFlags"); + ConCommand* findCommand = g_pCVar->FindCommand("convar_findByFlags"); findCommand->m_nFlags = FCVAR_NONE; findCommand->m_pCommandCallback = ConCommand_findflags; - ConCommand* listCommand = R2::g_pCVar->FindCommand("convar_list"); + ConCommand* listCommand = g_pCVar->FindCommand("convar_list"); listCommand->m_nFlags = FCVAR_NONE; listCommand->m_pCommandCallback = ConCommand_list; - ConCommand* diffCommand = R2::g_pCVar->FindCommand("convar_differences"); + ConCommand* diffCommand = g_pCVar->FindCommand("convar_differences"); diffCommand->m_nFlags = FCVAR_NONE; diffCommand->m_pCommandCallback = ConCommand_differences; } diff --git a/NorthstarDLL/util/printcommands.h b/primedev/util/printcommands.h index cb72e5cc..cb72e5cc 100644 --- a/NorthstarDLL/util/printcommands.h +++ b/primedev/util/printcommands.h diff --git a/NorthstarDLL/util/printmaps.cpp b/primedev/util/printmaps.cpp index bf9f1dec..d3253605 100644 --- a/NorthstarDLL/util/printmaps.cpp +++ b/primedev/util/printmaps.cpp @@ -42,10 +42,10 @@ void RefreshMapList() // Only update the maps list every 10 seconds max to we avoid constantly reading fs static double fLastRefresh = -999; - if (fLastRefresh + 10.0 > R2::g_pGlobals->m_flRealTime) + if (fLastRefresh + 10.0 > g_pGlobals->m_flRealTime) return; - fLastRefresh = R2::g_pGlobals->m_flRealTime; + fLastRefresh = g_pGlobals->m_flRealTime; // Rebuild map list vMapList.clear(); @@ -110,7 +110,7 @@ void RefreshMapList() } // get maps in game dir - std::string gameDir = fmt::format("{}/maps", R2::g_pModName); + std::string gameDir = fmt::format("{}/maps", g_pModName); if (!std::filesystem::exists(gameDir)) { return; @@ -212,7 +212,7 @@ AUTOHOOK(Host_Map_f, engine.dll + 0x15B340, void, __fastcall, (const CCommand& a return; } - if (*R2::g_pServerState >= R2::server_state_t::ss_active) + if (*g_pServerState >= server_state_t::ss_active) return Host_Changelevel_f(args); else return Host_Map_helper(args, nullptr); @@ -222,7 +222,7 @@ void InitialiseMapsPrint() { AUTOHOOK_DISPATCH() - ConCommand* mapsCommand = R2::g_pCVar->FindCommand("maps"); + ConCommand* mapsCommand = g_pCVar->FindCommand("maps"); mapsCommand->m_pCommandCallback = ConCommand_maps; } diff --git a/NorthstarDLL/util/printmaps.h b/primedev/util/printmaps.h index b01761c0..b01761c0 100644 --- a/NorthstarDLL/util/printmaps.h +++ b/primedev/util/printmaps.h diff --git a/NorthstarDLL/util/utils.cpp b/primedev/util/utils.cpp index 2c9dc85a..c3f90cfa 100644 --- a/NorthstarDLL/util/utils.cpp +++ b/primedev/util/utils.cpp @@ -20,7 +20,7 @@ bool skip_valid_ansi_csi_sgr(char*& str) return true; } -void NS::Utils::RemoveAsciiControlSequences(char* str, bool allow_color_codes) +void RemoveAsciiControlSequences(char* str, bool allow_color_codes) { for (char *pc = str, c = *pc; c = *pc; pc++) { diff --git a/primedev/util/utils.h b/primedev/util/utils.h new file mode 100644 index 00000000..85922692 --- /dev/null +++ b/primedev/util/utils.h @@ -0,0 +1,3 @@ +#pragma once + +void RemoveAsciiControlSequences(char* str, bool allow_color_codes); diff --git a/NorthstarDLL/util/version.cpp b/primedev/util/version.cpp index a947cde1..a947cde1 100644 --- a/NorthstarDLL/util/version.cpp +++ b/primedev/util/version.cpp diff --git a/NorthstarDLL/util/version.h b/primedev/util/version.h index a3dcf8c7..a3dcf8c7 100644 --- a/NorthstarDLL/util/version.h +++ b/primedev/util/version.h diff --git a/NorthstarDLL/util/wininfo.cpp b/primedev/util/wininfo.cpp index 4fd64369..4fd64369 100644 --- a/NorthstarDLL/util/wininfo.cpp +++ b/primedev/util/wininfo.cpp diff --git a/NorthstarDLL/util/wininfo.h b/primedev/util/wininfo.h index c56f7b87..c56f7b87 100644 --- a/NorthstarDLL/util/wininfo.h +++ b/primedev/util/wininfo.h diff --git a/loader_wsock32_proxy/dllmain.cpp b/primedev/wsockproxy/dllmain.cpp index 4cc4f26e..4cc4f26e 100644 --- a/loader_wsock32_proxy/dllmain.cpp +++ b/primedev/wsockproxy/dllmain.cpp diff --git a/loader_wsock32_proxy/loader.cpp b/primedev/wsockproxy/loader.cpp index 3e46c1a6..3e46c1a6 100644 --- a/loader_wsock32_proxy/loader.cpp +++ b/primedev/wsockproxy/loader.cpp diff --git a/loader_wsock32_proxy/loader.h b/primedev/wsockproxy/loader.h index 0c6fb053..0c6fb053 100644 --- a/loader_wsock32_proxy/loader.h +++ b/primedev/wsockproxy/loader.h diff --git a/loader_wsock32_proxy/pch.h b/primedev/wsockproxy/pch.h index ebc29547..ebc29547 100644 --- a/loader_wsock32_proxy/pch.h +++ b/primedev/wsockproxy/pch.h diff --git a/loader_wsock32_proxy/wsock32.asm b/primedev/wsockproxy/wsock32.asm index 22a9c384..22a9c384 100644 --- a/loader_wsock32_proxy/wsock32.asm +++ b/primedev/wsockproxy/wsock32.asm diff --git a/loader_wsock32_proxy/wsock32.def b/primedev/wsockproxy/wsock32.def index 448440b4..448440b4 100644 --- a/loader_wsock32_proxy/wsock32.def +++ b/primedev/wsockproxy/wsock32.def |