X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=9f4cc194836c71438d22674c1195644e34c110c8;hb=60c3f5e778bdfd84ee199e4a357fae567c6aaeb2;hp=69df066abea6fe25990ec0817dd15a354315fe02;hpb=845688edbe9045b65b6e9978be287b0e3bda3e30;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 69df066ab..9f4cc1948 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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"); } @@ -2031,7 +2050,6 @@ float WinningCondition_Race(float fraglimit) return wc; } -void ReadyRestart(); float WinningCondition_QualifyingThenRace(float limit) { float wc; @@ -2121,6 +2139,7 @@ CheckRules_World Exit deathmatch games upon conditions ============ */ +void ReadyRestart(); void CheckRules_World() { float timelimit; @@ -2317,7 +2336,7 @@ float mapvote_maps_suggested[MAPVOTE_COUNT]; string mapvote_suggestions[MAPVOTE_COUNT]; float mapvote_suggestion_ptr; float mapvote_voters; -float mapvote_votes[MAPVOTE_COUNT]; +float mapvote_selections[MAPVOTE_COUNT]; float mapvote_run; float mapvote_detail; float mapvote_abstain; @@ -2474,20 +2493,6 @@ void MapVote_SendPicture(float id) WritePicture(MSG_ONE, strcat(mapvote_screenshot_dirs[mapvote_maps_screenshot_dir[id]], "/", mapvote_maps[id]), 3072); } -float GameCommand_MapVote(string cmd) -{ - if(!intermission_running) - return FALSE; - - if(cmd == "mv_getpic") - { - MapVote_SendPicture(stof(argv(1))); - return TRUE; - } - - return FALSE; -} - float MapVote_GetMapMask() { float mask, i, power; @@ -2555,7 +2560,7 @@ float MapVote_SendEntity(entity to, float sf) if(mapvote_detail) for(i = 0; i < mapvote_count; ++i) if(mapvote_maps[i] != "") - WriteByte(MSG_ENTITY, mapvote_votes[i]); + WriteByte(MSG_ENTITY, mapvote_selections[i]); WriteByte(MSG_ENTITY, to.mapvote); } @@ -2587,16 +2592,16 @@ float MapVote_Finished(float mappos) if(autocvar_sv_eventlog) { result = strcat(":vote:finished:", mapvote_maps[mappos]); - result = strcat(result, ":", ftos(mapvote_votes[mappos]), "::"); + result = strcat(result, ":", ftos(mapvote_selections[mappos]), "::"); didntvote = mapvote_voters; for(i = 0; i < mapvote_count; ++i) if(mapvote_maps[i] != "") { - didntvote -= mapvote_votes[i]; + didntvote -= mapvote_selections[i]; if(i != mappos) { result = strcat(result, ":", mapvote_maps[i]); - result = strcat(result, ":", ftos(mapvote_votes[i])); + result = strcat(result, ":", ftos(mapvote_selections[i])); } } result = strcat(result, ":didn't vote:", ftos(didntvote)); @@ -2621,7 +2626,7 @@ void MapVote_CheckRules_1() for(i = 0; i < mapvote_count; ++i) if(mapvote_maps[i] != "") { //dprint("Map ", ftos(i), ": "); dprint(mapvote_maps[i], "\n"); - mapvote_votes[i] = 0; + mapvote_selections[i] = 0; } mapvote_voters = 0; @@ -2632,7 +2637,7 @@ void MapVote_CheckRules_1() { i = other.mapvote - 1; //dprint("Player ", other.netname, " vote = ", ftos(other.mapvote - 1), "\n"); - mapvote_votes[i] = mapvote_votes[i] + 1; + mapvote_selections[i] = mapvote_selections[i] + 1; } } } @@ -2650,11 +2655,11 @@ float MapVote_CheckRules_2() mapvote_voters_real = mapvote_voters; if(mapvote_abstain) - mapvote_voters_real -= mapvote_votes[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] != "") - RandomSelection_Add(world, i, string_null, 1, mapvote_votes[i]); + RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]); firstPlace = RandomSelection_chosen_float; firstPlaceVotes = RandomSelection_best_priority; //dprint("First place: ", ftos(firstPlace), "\n"); @@ -2663,7 +2668,7 @@ float MapVote_CheckRules_2() RandomSelection_Init(); for(i = 0; i < mapvote_count_real; ++i) if(mapvote_maps[i] != "") if(i != firstPlace) - RandomSelection_Add(world, i, string_null, 1, mapvote_votes[i]); + RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]); secondPlace = RandomSelection_chosen_float; secondPlaceVotes = RandomSelection_best_priority; //dprint("Second place: ", ftos(secondPlace), "\n"); @@ -2690,12 +2695,12 @@ float MapVote_CheckRules_2() for(i = 0; i < mapvote_count; ++i) if(mapvote_maps[i] != "") { - didntvote -= mapvote_votes[i]; + didntvote -= mapvote_selections[i]; if(i != firstPlace) if(i != secondPlace) { result = strcat(result, ":", mapvote_maps[i]); - result = strcat(result, ":", ftos(mapvote_votes[i])); + result = strcat(result, ":", ftos(mapvote_selections[i])); if(i < mapvote_count_real) { strunzone(mapvote_maps[i]);