From d233262b792076292cab63c6ed9ee168dd7f810d Mon Sep 17 00:00:00 2001 From: Amos Date: Tue, 24 May 2022 19:26:05 +0200 Subject: [PATCH] Things --- r5dev/networksystem/pylon.cpp | 2 +- r5dev/sdklauncher/basepanel.cpp | 96 +++++++++++++++++++++++++-------- r5dev/sdklauncher/basepanel.h | 7 +++ r5dev/tier1/IConVar.cpp | 2 +- r5dev/tier1/cvar.cpp | 2 +- r5dev/tier1/cvar.h | 2 +- 6 files changed, 86 insertions(+), 25 deletions(-) diff --git a/r5dev/networksystem/pylon.cpp b/r5dev/networksystem/pylon.cpp index 1da167b4..12ca644b 100644 --- a/r5dev/networksystem/pylon.cpp +++ b/r5dev/networksystem/pylon.cpp @@ -21,7 +21,7 @@ void KeepAliveToPylon() { #ifndef CLIENT_DLL - if (g_pHostState->m_bActiveGame && sv_pylonvisibility->GetBool()) // Check for active game. + if (g_pHostState->m_bActiveGame && sv_pylonVisibility->GetBool()) // Check for active game. { std::string m_szHostToken = std::string(); std::string m_szHostRequestMessage = std::string(); diff --git a/r5dev/sdklauncher/basepanel.cpp b/r5dev/sdklauncher/basepanel.cpp index a93014a4..88739f61 100644 --- a/r5dev/sdklauncher/basepanel.cpp +++ b/r5dev/sdklauncher/basepanel.cpp @@ -202,9 +202,29 @@ void CUIBasePanel::Init() this->m_HostNameLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); this->m_MainGroup->AddControl(this->m_HostNameLabel); + this->m_VisibilityCombo = new UIX::UIXComboBox(); + this->m_VisibilityCombo->SetSize({ 82, 25 }); + this->m_VisibilityCombo->SetLocation({ 15, 50 }); + this->m_VisibilityCombo->SetTabIndex(0); + this->m_VisibilityCombo->SetSelectedIndex(0); + this->m_VisibilityCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); + this->m_VisibilityCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList); + this->m_VisibilityCombo->Items.Add("Public"); + this->m_VisibilityCombo->Items.Add("Hidden"); + this->m_VisibilityCombo->Items.Add("Offline"); + this->m_MainGroup->AddControl(this->m_VisibilityCombo); + + this->m_VisibilityLabel = new UIX::UIXLabel(); + this->m_VisibilityLabel->SetSize({ 70, 21 }); + this->m_VisibilityLabel->SetLocation({ 100, 53 }); + this->m_VisibilityLabel->SetTabIndex(0); + this->m_VisibilityLabel->SetText("Visibility"); + this->m_VisibilityLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); + this->m_MainGroup->AddControl(this->m_VisibilityLabel); + this->m_LaunchArgsTextBox = new UIX::UIXTextBox(); - this->m_LaunchArgsTextBox->SetSize({ 215, 21 }); - this->m_LaunchArgsTextBox->SetLocation({ 15, 50 }); + this->m_LaunchArgsTextBox->SetSize({ 80, 21 }); + this->m_LaunchArgsTextBox->SetLocation({ 150, 50 }); this->m_LaunchArgsTextBox->SetTabIndex(0); this->m_LaunchArgsTextBox->SetText(""); this->m_LaunchArgsTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); @@ -427,7 +447,7 @@ void CUIBasePanel::Init() // // ################################################################################################# this->m_ConsoleGroup = new UIX::UIXGroupBox(); - this->m_ConsoleGroup->SetSize({ 429, 181 }); + this->m_ConsoleGroup->SetSize({ 429, 182 }); this->m_ConsoleGroup->SetLocation({ 359, 158 }); this->m_ConsoleGroup->SetTabIndex(0); this->m_ConsoleGroup->SetText("Console"); @@ -435,7 +455,7 @@ void CUIBasePanel::Init() this->AddControl(this->m_ConsoleGroup); this->m_ConsoleListView = new UIX::UIXListView(); - this->m_ConsoleListView->SetSize({ 427, 165 }); + this->m_ConsoleListView->SetSize({ 427, 166 }); this->m_ConsoleListView->SetLocation({ 1, 15 }); this->m_ConsoleListView->SetTabIndex(0); this->m_ConsoleListView->SetText("0"); @@ -473,6 +493,14 @@ eLaunchMode CUIBasePanel::BuildParameter(string& svParameter) case eMode::HOST: { // GAME ############################################################################################ + if (!String::IsNullOrEmpty(this->m_MapCombo->Text())) + { + svParameter.append("+map \"" + this->m_MapCombo->Text() + "\" "); + } + if (!String::IsNullOrEmpty(this->m_PlaylistCombo->Text())) + { + svParameter.append("+launchplaylist \"" + this->m_PlaylistCombo->Text() + "\" "); + } if (this->m_DevelopmentToggle->Checked()) { svParameter.append("+exec \"autoexec_server_dev.cfg\" "); @@ -519,29 +547,29 @@ eLaunchMode CUIBasePanel::BuildParameter(string& svParameter) if (this->m_NoAsyncJobsToggle->Checked()) { svParameter.append("-noasync "); - svParameter.append("async_serialize \"0\" "); - svParameter.append("buildcubemaps_async \"0\" "); - svParameter.append("sv_asyncAIInit \"0\" "); - svParameter.append("sv_asyncSendSnapshot \"0\" "); - svParameter.append("sv_scriptCompileAsync \"0\" "); - svParameter.append("cl_async_bone_setup \"0\" "); - svParameter.append("cl_updatedirty_async \"0\" "); - svParameter.append("mat_syncGPU \"1\" "); - svParameter.append("mat_sync_rt \"1\" "); - svParameter.append("mat_sync_rt_flushes_gpu \"1\" "); - svParameter.append("net_async_sendto \"0\" "); - svParameter.append("physics_async_sv \"0\" "); - svParameter.append("physics_async_cl \"0\" "); + svParameter.append("+async_serialize \"0\" "); + svParameter.append("+buildcubemaps_async \"0\" "); + svParameter.append("+sv_asyncAIInit \"0\" "); + svParameter.append("+sv_asyncSendSnapshot \"0\" "); + svParameter.append("+sv_scriptCompileAsync \"0\" "); + svParameter.append("+cl_async_bone_setup \"0\" "); + svParameter.append("+cl_updatedirty_async \"0\" "); + svParameter.append("+mat_syncGPU \"1\" "); + svParameter.append("+mat_sync_rt \"1\" "); + svParameter.append("+mat_sync_rt_flushes_gpu \"1\" "); + svParameter.append("+net_async_sendto \"0\" "); + svParameter.append("+physics_async_sv \"0\" "); + svParameter.append("+physics_async_cl \"0\" "); } if (this->m_NetEncryptionToggle->Checked()) - svParameter.append("net_encryptionEnable \"1\" "); + svParameter.append("+net_encryptionEnable \"1\" "); if (this->m_NetRandomKeyToggle->Checked()) - svParameter.append("net_useRandomKey \"1\" "); + svParameter.append("+net_useRandomKey \"1\" "); if (this->m_NoQueuedPacketThread->Checked()) - svParameter.append("net_queued_packet_thread \"0\" "); + svParameter.append("+net_queued_packet_thread \"0\" "); if (this->m_NoTimeOutToggle->Checked()) svParameter.append("-notimeout "); @@ -564,13 +592,39 @@ eLaunchMode CUIBasePanel::BuildParameter(string& svParameter) // MAIN ############################################################################################ if (!String::IsNullOrEmpty(this->m_HostNameTextBox->Text())) { - svParameter.append("+sv_pylonVisibility \"1\" "); svParameter.append("+sv_pylonHostName \"" + this->m_HostNameTextBox->Text() + "\" "); + + switch (static_cast(this->m_VisibilityCombo->SelectedIndex())) + { + case eVisibility::PUBLIC: + { + svParameter.append("+sv_pylonVisibility \"2\" "); + break; + } + case eVisibility::HIDDEN: + { + svParameter.append("+sv_pylonVisibility \"1\" "); + break; + } + default: + { + svParameter.append("+sv_pylonVisibility \"0\" "); + break; + } + } } if (!String::IsNullOrEmpty(this->m_LaunchArgsTextBox->Text())) svParameter.append(this->m_LaunchArgsTextBox->Text()); return results; + } + case eMode::SERVER: + { + + } + case eMode::CLIENT: + { + } default: return results; diff --git a/r5dev/sdklauncher/basepanel.h b/r5dev/sdklauncher/basepanel.h index 0ee3aa6a..86eb2bdf 100644 --- a/r5dev/sdklauncher/basepanel.h +++ b/r5dev/sdklauncher/basepanel.h @@ -22,6 +22,11 @@ private: SERVER, CLIENT, }; + enum class eVisibility + { + PUBLIC, + HIDDEN, + }; UIX::UIXTextBox* m_WidthTextBox; UIX::UIXTextBox* m_HeightTextBox; @@ -41,6 +46,7 @@ private: UIX::UIXLabel* m_ResolutionLabel; UIX::UIXLabel* m_PlaylistFileLabel; UIX::UIXLabel* m_HostNameLabel; + UIX::UIXLabel* m_VisibilityLabel; UIX::UIXLabel* m_LaunchArgsLabel; // Boxes UIX::UIXGroupBox* m_GameGroup; @@ -68,6 +74,7 @@ private: UIX::UIXComboBox* m_MapCombo; UIX::UIXComboBox* m_PlaylistCombo; UIX::UIXComboBox* m_ModeCombo; + UIX::UIXComboBox* m_VisibilityCombo; // Buttons UIX::UIXButton* m_CleanSDK; UIX::UIXButton* m_UpdateSDK; diff --git a/r5dev/tier1/IConVar.cpp b/r5dev/tier1/IConVar.cpp index 286245c6..38731ddd 100644 --- a/r5dev/tier1/IConVar.cpp +++ b/r5dev/tier1/IConVar.cpp @@ -69,7 +69,7 @@ void ConVar::Init(void) const navmesh_always_reachable = new ConVar("navmesh_always_reachable" , "1", FCVAR_DEVELOPMENTONLY, "Marks poly from agent to target on navmesh as reachable regardless of table data ( !slower! ).", false, 0.f, false, 0.f, nullptr, nullptr); // !TODO: Default to '0' once the reachability table gets properly parsed. sv_showconnecting = new ConVar("sv_showconnecting" , "1", FCVAR_RELEASE, "Logs information about the connecting client to the console.", false, 0.f, false, 0.f, nullptr, nullptr); - sv_pylonvisibility = new ConVar("sv_pylonvisibility", "0", FCVAR_RELEASE, "Determines the visiblity to the Pylon master server, 0 = Not visible, 1 = Visible, 2 = Hidden !TODO: not implemented yet.", false, 0.f, false, 0.f, nullptr, nullptr); + sv_pylonVisibility = new ConVar("sv_pylonVisibility", "0", FCVAR_RELEASE, "Determines the visiblity to the Pylon master server, 0 = Not visible, 1 = Hidden, 2 = Visible !TODO: not implemented yet.", false, 0.f, false, 0.f, nullptr, nullptr); sv_pylonRefreshInterval = new ConVar("sv_pylonRefreshInterval" , "5.0", FCVAR_RELEASE, "Pylon server host request post update interval (seconds).", true, 2.f, true, 8.f, nullptr, nullptr); sv_banlistRefreshInterval = new ConVar("sv_banlistRefreshInterval", "1.0", FCVAR_RELEASE, "Banlist refresh interval (seconds).", true, 1.f, false, 0.f, nullptr, nullptr); sv_statusRefreshInterval = new ConVar("sv_statusRefreshInterval" , "0.5", FCVAR_RELEASE, "Server status bar update interval (seconds).", false, 0.f, false, 0.f, nullptr, nullptr); diff --git a/r5dev/tier1/cvar.cpp b/r5dev/tier1/cvar.cpp index 842ec0d7..7557817f 100644 --- a/r5dev/tier1/cvar.cpp +++ b/r5dev/tier1/cvar.cpp @@ -39,7 +39,7 @@ ConVar* ai_ainDebugConnect = nullptr; ConVar* navmesh_always_reachable = nullptr; ConVar* sv_showconnecting = nullptr; -ConVar* sv_pylonvisibility = nullptr; +ConVar* sv_pylonVisibility = nullptr; ConVar* sv_pylonRefreshInterval = nullptr; ConVar* sv_banlistRefreshInterval = nullptr; ConVar* sv_statusRefreshInterval = nullptr; diff --git a/r5dev/tier1/cvar.h b/r5dev/tier1/cvar.h index 00034424..ec275978 100644 --- a/r5dev/tier1/cvar.h +++ b/r5dev/tier1/cvar.h @@ -37,7 +37,7 @@ extern ConVar* ai_ainDumpOnLoad; extern ConVar* ai_ainDebugConnect; extern ConVar* navmesh_always_reachable; extern ConVar* sv_showconnecting; -extern ConVar* sv_pylonvisibility; +extern ConVar* sv_pylonVisibility; extern ConVar* sv_pylonRefreshInterval; extern ConVar* sv_banlistRefreshInterval; extern ConVar* sv_statusRefreshInterval;