Merge branch 'dedicated-server-optimization' into 'develop'

Resolve "Dedicated Server optimization"
This commit is contained in:
momo5502 2017-02-25 13:01:43 +01:00
commit 0b7a87e39e
12 changed files with 20 additions and 3 deletions

2
deps/libtomcrypt vendored

@ -1 +1 @@
Subproject commit 824f3af98c68880ba2d186d0632996730dd58a98 Subproject commit c39390dba1dc519988fe8f6b1af6fdec24f86fc5

2
deps/protobuf vendored

@ -1 +1 @@
Subproject commit b4b0e304be5a68de3d0ee1af9b286f958750f5e4 Subproject commit 17174b54ddd040a326dec6db75d1bfb5e5b3caa9

View File

@ -51,6 +51,8 @@ namespace Components
Changelog::Changelog() Changelog::Changelog()
{ {
if (Dedicated::IsEnabled()) return;
// Changelog // Changelog
UIFeeder::Add(62.0f, Changelog::GetChangelogCount, Changelog::GetChangelogText, Changelog::SelectChangelog); UIFeeder::Add(62.0f, Changelog::GetChangelogCount, Changelog::GetChangelogText, Changelog::SelectChangelog);
} }

View File

@ -204,6 +204,8 @@ namespace Components
ConnectProtocol::ConnectProtocol() ConnectProtocol::ConnectProtocol()
{ {
if (Dedicated::IsEnabled()) return;
// IPC handler // IPC handler
IPCPipe::On("connect", [] (std::string data) IPCPipe::On("connect", [] (std::string data)
{ {

View File

@ -745,6 +745,8 @@ namespace Components
D3D9Ex::D3D9Ex() D3D9Ex::D3D9Ex()
{ {
if (Dedicated::IsEnabled()) return;
Dvar::Register<bool>("r_useD3D9Ex", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Use extended d3d9 interface!"); Dvar::Register<bool>("r_useD3D9Ex", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Use extended d3d9 interface!");
// Hook Interface creation // Hook Interface creation

View File

@ -535,6 +535,7 @@ namespace Components
Friends::LoggedOn = false; Friends::LoggedOn = false;
if (Dedicated::IsEnabled() ||ZoneBuilder::IsEnabled()) return; if (Dedicated::IsEnabled() ||ZoneBuilder::IsEnabled()) return;
Dvar::Register<bool>("cl_anonymous", false, Game::DVAR_FLAG_SAVED, ""); Dvar::Register<bool>("cl_anonymous", false, Game::DVAR_FLAG_SAVED, "");
Dvar::Register<int>("cl_notifyFriendState", 1, -1, 1, Game::DVAR_FLAG_SAVED, ""); Dvar::Register<int>("cl_notifyFriendState", 1, -1, 1, Game::DVAR_FLAG_SAVED, "");

View File

@ -90,6 +90,8 @@ namespace Components
ModList::ModList() ModList::ModList()
{ {
if (Dedicated::IsEnabled()) return;
ModList::CurrentMod = 0; ModList::CurrentMod = 0;
Dvar::Register("cl_modVidRestart", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Perform a vid_restart when loading a mod."); Dvar::Register("cl_modVidRestart", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Perform a vid_restart when loading a mod.");

View File

@ -172,7 +172,7 @@ namespace Components
News::UpdaterArgs.clear(); News::UpdaterArgs.clear();
News::UpdaterHash.clear(); News::UpdaterHash.clear();
News::UpdaterRefresh = 0; News::UpdaterRefresh = 0;
if (ZoneBuilder::IsEnabled()) return; // Maybe also dedi? if (ZoneBuilder::IsEnabled() || Dedicated::IsEnabled()) return; // Maybe also dedi?
Dvar::Register<bool>("g_firstLaunch", true, Game::DVAR_FLAG_SAVED, ""); Dvar::Register<bool>("g_firstLaunch", true, Game::DVAR_FLAG_SAVED, "");

View File

@ -66,6 +66,8 @@ namespace Components
void QuickPatch::UnlockStats() void QuickPatch::UnlockStats()
{ {
if (Dedicated::IsEnabled()) return;
if (Game::CL_IsCgameInitialized()) if (Game::CL_IsCgameInitialized())
{ {
Toast::Show("cardicon_locked", "^1Error", "Not allowed while ingame.", 3000); Toast::Show("cardicon_locked", "^1Error", "Not allowed while ingame.", 3000);

View File

@ -94,6 +94,8 @@ namespace Components
Renderer::Renderer() Renderer::Renderer()
{ {
if (Dedicated::IsEnabled()) return;
// Renderer::OnBackendFrame([] (IDirect3DDevice9* device) // Renderer::OnBackendFrame([] (IDirect3DDevice9* device)
// { // {
// if (Game::Sys_Milliseconds() % 2) // if (Game::Sys_Milliseconds() % 2)

View File

@ -379,6 +379,8 @@ namespace Components
UIFeeder::UIFeeder() UIFeeder::UIFeeder()
{ {
if (Dedicated::IsEnabled()) return;
Dvar::OnInit([]() Dvar::OnInit([]()
{ {
Dvar::Register<const char*>("ui_map_long", "Afghan", Game::dvar_flag::DVAR_FLAG_NONE, ""); Dvar::Register<const char*>("ui_map_long", "Afghan", Game::dvar_flag::DVAR_FLAG_NONE, "");

View File

@ -116,6 +116,8 @@ namespace Components
UIScript::UIScript() UIScript::UIScript()
{ {
if (Dedicated::IsEnabled()) return;
// Install handler // Install handler
Utils::Hook::RedirectJump(0x45EC59, UIScript::RunMenuScriptStub); Utils::Hook::RedirectJump(0x45EC59, UIScript::RunMenuScriptStub);