]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/util.qc
Merge branch 'bones_was_here/subtlebloom' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / util.qc
index 06139566d85ad6a50c30af6d3f09d19a3eca418d..63eb27abf7b4ffba689280b1f4c83f4faa8357f5 100644 (file)
@@ -437,11 +437,10 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                        }
                }
        }
-       
+
        if(un_tosversion != "")
        {
                _Nex_ExtResponseSystem_NewToS = stof(un_tosversion);
-               LOG_INFOF("Latest ToS version is %d", _Nex_ExtResponseSystem_NewToS);
        }
 
        if(un_bannedservers != "")
@@ -830,6 +829,18 @@ void dialog_hudpanel_main_settings(entity me, string panelname)
                                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");
+}
+
 float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha)
 {
        if(startAlpha < targetAlpha)