]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Merge remote branch 'origin/master' into samual/updatecommands
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index 6ed8fee3f0eb6450ee19c3d63183221581d17612..9f4cc194836c71438d22674c1195644e34c110c8 100644 (file)
@@ -402,6 +402,9 @@ void cvar_changes_init()
                BADCVAR("gameversion");
                BADPREFIX("gameversion_");
                BADCVAR("sv_namechangetimer");
+#ifndef NO_LEGACY_NETWORKING
+               BADCVAR("sv_use_csqc_players"); // transition
+#endif
 
                // allowed changes to server admins (please sync this to server.cfg)
                // vi commands:
@@ -410,10 +413,10 @@ void cvar_changes_init()
                //   :%s,//\([^ ]*\).*,BADCVAR("\1");,
                //   :%!sort
                // yes, this does contain some redundant stuff, don't really care
+               BADCVAR("bot_config_file");
                BADCVAR("bot_number");
                BADCVAR("bot_prefix");
                BADCVAR("bot_suffix");
-               BADCVAR("bot_config_file");
                BADCVAR("capturelimit_override");
                BADCVAR("fraglimit_override");
                BADCVAR("gametype");
@@ -444,6 +447,7 @@ void cvar_changes_init()
                BADCVAR("g_minstagib");
                BADCVAR("g_mirrordamage");
                BADCVAR("g_nexball_goallimit");
+               BADCVAR("g_powerups");
                BADCVAR("g_runematch_point_limit");
                BADCVAR("g_start_delay");
                BADCVAR("g_warmup");
@@ -460,6 +464,7 @@ void cvar_changes_init()
                BADCVAR("skill");
                BADCVAR("sv_adminnick");
                BADCVAR("sv_autoscreenshot");
+               BADCVAR("sv_autotaunt");
                BADCVAR("sv_curl_defaulturl");
                BADCVAR("sv_defaultcharacter");
                BADCVAR("sv_defaultplayercolors");
@@ -471,6 +476,7 @@ void cvar_changes_init()
                BADCVAR("sv_public");
                BADCVAR("sv_ready_restart");
                BADCVAR("sv_status_privacy");
+               BADCVAR("sv_taunt");
                BADCVAR("sv_vote_call");
                BADCVAR("sv_vote_commands");
                BADCVAR("sv_vote_majority_factor");
@@ -482,6 +488,7 @@ void cvar_changes_init()
                BADCVAR("teamplay_mode");
                BADCVAR("timelimit_override");
                BADPREFIX("g_warmup_");
+               BADPREFIX("sv_ready_restart_");
 
                if(autocvar_g_minstagib)
                {
@@ -718,6 +725,10 @@ void spawnfunc_worldspawn (void)
        //      dom_init();
 
        GameLogInit(); // prepare everything
+       // NOTE for matchid:
+       // changing the logic generating it is okay. But:
+       // it HAS to stay <= 64 chars
+       // character set: ASCII 33-126 without the following characters: : ; ' " \ $
        if(autocvar_sv_eventlog)
        {
                s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(FALSE, "%s"), floor(random() * 1000000));
@@ -739,8 +750,10 @@ void spawnfunc_worldspawn (void)
                        s = strcat(s, ":no_use_ammunition");
 
                // initialiation stuff, not good in the mutator system
-               if(!autocvar_g_pickup_items)
+               if(autocvar_g_pickup_items == 0)
                        s = strcat(s, ":no_pickup_items");
+               if(autocvar_g_pickup_items > 0)
+                       s = strcat(s, ":pickup_items");
 
                // initialiation stuff, not good in the mutator system
                if(autocvar_g_weaponarena != "0")
@@ -758,6 +771,12 @@ void spawnfunc_worldspawn (void)
                if(autocvar_g_minstagib)
                        s = strcat(s, ":minstagib");
 
+               // TODO to mutator system
+               if(autocvar_g_powerups == 0)
+                       s = strcat(s, ":no_powerups");
+               if(autocvar_g_powerups > 0)
+                       s = strcat(s, ":powerups");
+
                GameLogEcho(s);
                GameLogEcho(":gameinfo:end");
        }
@@ -931,8 +950,17 @@ void spawnfunc_worldspawn (void)
                s = "";
                n = tokenize_console(cvar_string("sv_curl_serverpackages"));
                for(i = 0; i < n; ++i)
-                       if(substring(argv(i), -14, -1) != ".serverpackage")
+                       if(substring(argv(i), -14, -1) != "-serverpackage.txt")
+                       if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy
                                s = strcat(s, " ", argv(i));
+               fd = search_begin("*-serverpackage.txt", TRUE, FALSE);
+               if(fd >= 0)
+               {
+                       j = search_getsize(fd);
+                       for(i = 0; i < j; ++i)
+                               s = strcat(s, " ", search_getfilename(fd, i));
+                       search_end(fd);
+               }
                fd = search_begin("*.serverpackage", TRUE, FALSE);
                if(fd >= 0)
                {
@@ -2307,7 +2335,7 @@ string mapvote_maps_pakfile[MAPVOTE_COUNT];
 float mapvote_maps_suggested[MAPVOTE_COUNT];
 string mapvote_suggestions[MAPVOTE_COUNT];
 float mapvote_suggestion_ptr;
-float mapvote_selectionrs;
+float mapvote_voters;
 float mapvote_selections[MAPVOTE_COUNT];
 float mapvote_run;
 float mapvote_detail;
@@ -2565,7 +2593,7 @@ float MapVote_Finished(float mappos)
        {
                result = strcat(":vote:finished:", mapvote_maps[mappos]);
                result = strcat(result, ":", ftos(mapvote_selections[mappos]), "::");
-               didntvote = mapvote_selectionrs;
+               didntvote = mapvote_voters;
                for(i = 0; i < mapvote_count; ++i)
                        if(mapvote_maps[i] != "")
                        {
@@ -2601,10 +2629,10 @@ void MapVote_CheckRules_1()
                mapvote_selections[i] = 0;
        }
 
-       mapvote_selectionrs = 0;
+       mapvote_voters = 0;
        FOR_EACH_REALCLIENT(other)
        {
-               ++mapvote_selectionrs;
+               ++mapvote_voters;
                if(other.mapvote)
                {
                        i = other.mapvote - 1;
@@ -2619,15 +2647,15 @@ float MapVote_CheckRules_2()
        float i;
        float firstPlace, secondPlace;
        float firstPlaceVotes, secondPlaceVotes;
-       float mapvote_selectionrs_real;
+       float mapvote_voters_real;
        string result;
 
        if(mapvote_count_real == 1)
                return MapVote_Finished(0);
 
-       mapvote_selectionrs_real = mapvote_selectionrs;
+       mapvote_voters_real = mapvote_voters;
        if(mapvote_abstain)
-               mapvote_selectionrs_real -= mapvote_selections[mapvote_count - 1];
+               mapvote_voters_real -= mapvote_selections[mapvote_count - 1];
 
        RandomSelection_Init();
        for(i = 0; i < mapvote_count_real; ++i) if(mapvote_maps[i] != "")
@@ -2649,11 +2677,11 @@ float MapVote_CheckRules_2()
        if(firstPlace == -1)
                error("No first place in map vote... WTF?");
 
-       if(secondPlace == -1 || time > mapvote_timeout || (mapvote_selectionrs_real - firstPlaceVotes) < firstPlaceVotes)
+       if(secondPlace == -1 || time > mapvote_timeout || (mapvote_voters_real - firstPlaceVotes) < firstPlaceVotes)
                return MapVote_Finished(firstPlace);
 
        if(mapvote_keeptwotime)
-               if(time > mapvote_keeptwotime || (mapvote_selectionrs_real - firstPlaceVotes - secondPlaceVotes) < secondPlaceVotes)
+               if(time > mapvote_keeptwotime || (mapvote_voters_real - firstPlaceVotes - secondPlaceVotes) < secondPlaceVotes)
                {
                        float didntvote;
                        MapVote_TouchMask();
@@ -2663,7 +2691,7 @@ float MapVote_CheckRules_2()
                        result = strcat(result, ":", ftos(firstPlaceVotes));
                        result = strcat(result, ":", mapvote_maps[secondPlace]);
                        result = strcat(result, ":", ftos(secondPlaceVotes), "::");
-                       didntvote = mapvote_selectionrs;
+                       didntvote = mapvote_voters;
                        for(i = 0; i < mapvote_count; ++i)
                                if(mapvote_maps[i] != "")
                                {