This commit is contained in:
Amos 2022-05-24 19:26:05 +02:00
parent dacd307663
commit d233262b79
6 changed files with 86 additions and 25 deletions

View File

@ -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();

View File

@ -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<eVisibility>(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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;