return _("Leave current match");
else if(cvar("g_campaign"))
return _("Leave campaign");
- else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ else if (isServerSingleplayer())
return _("Leave singleplayer");
else
return _("Leave multiplayer");
return "-";
else if(cvar("g_campaign"))
return _("Leave current campaign level");
- else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ else if (isServerSingleplayer())
return _("Leave current singleplayer match");
else
return _("Leave current multiplayer match / Disconnect from the server");
e.configureXonoticTextSliderValues(e);
}
+bool isServerSingleplayer()
+{
+ return (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1");
+}
+
void makeServerSingleplayer()
{
+ // it doesn't allow clients to connect from different machines
localcmd("defer 0.1 \"sv_cmd settemp net_address 127.0.0.1\"\n");
localcmd("defer 0.1 \"sv_cmd settemp net_address_ipv6 ::1\"\n");
}
void dialog_hudpanel_main_checkbox(entity me, string panelname);
void dialog_hudpanel_main_settings(entity me, string panelname);
+bool isServerSingleplayer();
void makeServerSingleplayer();
+
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha);
string _Nex_ExtResponseSystem_BannedServers;