X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=15dce3d80617d16949b0c54f2a077d1dd5f63ea5;hb=49d458814ee6def9f22548da8b288bc7ae7dbc47;hp=680afbc8909a2ffeaa9d3880a0bf48f5ad16aba6;hpb=11b0bff52b9e56b9ae41469588d61b7a8da4c3b8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 680afbc89..15dce3d80 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -340,9 +340,6 @@ 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: @@ -553,9 +550,13 @@ void spawnfunc___init_dedicated_server(void) // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); + CALL_ACCUMULATED_FUNCTION(RegisterNotifications); + CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); MapInfo_Enumerate(); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0); + + print("^1YO SAMUAL, CHECK THIS SHIT OUT MOTHERFUCKER! _init spawnfunc was called!\n"); } void Map_MarkAsRecent(string m); @@ -596,9 +597,13 @@ void spawnfunc_worldspawn (void) head = nextent(head); } + server_is_dedicated = (cvar_defstring("is_dedicated") ? TRUE : FALSE); + // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); + CALL_ACCUMULATED_FUNCTION(RegisterNotifications); + CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid)); @@ -841,7 +846,7 @@ void spawnfunc_worldspawn (void) for(i = 0, j = 0; i < MapInfo_count; ++i) { if(MapInfo_Get_ByID(i)) - if not(MapInfo_Map_flags & (MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN)) + if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags()) { if(mod(i, 2)) col = "^2"; @@ -1593,6 +1598,8 @@ void NextLevel() PlayerStats_Shutdown(); WeaponStats_Shutdown(); + Kill_Notification(NOTIF_ANY, world, MSG_CENTER, 0); // kill all centerprints now + if(autocvar_sv_eventlog) GameLogEcho(":gameover"); @@ -1675,20 +1682,8 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true tl = autocvar_timelimit; tl += autocvar_timelimit_overtime; cvar_set("timelimit", ftos(tl)); - string minutesPlural; - if (autocvar_timelimit_overtime == 1) - minutesPlural = " ^3minute"; - else - minutesPlural = " ^3minutes"; - - bcenterprint( - strcat( - "^3Now playing ^1OVERTIME^3!\n\n^3Added ^1", - ftos(autocvar_timelimit_overtime), - minutesPlural, - " to the game!" - ) - ); + + Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime); } float GetWinningCode(float fraglimitreached, float equality) @@ -1756,10 +1751,10 @@ float WinningCondition_Onslaught() { if (head.health > 0) { - if (head.team == COLOR_TEAM1) t1 = 1; - if (head.team == COLOR_TEAM2) t2 = 1; - if (head.team == COLOR_TEAM3) t3 = 1; - if (head.team == COLOR_TEAM4) t4 = 1; + if (head.team == FL_TEAM_1) t1 = 1; + if (head.team == FL_TEAM_2) t2 = 1; + if (head.team == FL_TEAM_3) t3 = 1; + if (head.team == FL_TEAM_4) t4 = 1; } head = find(head, classname, "onslaught_generator"); } @@ -1767,10 +1762,10 @@ float WinningCondition_Onslaught() { // game over, only one team remains (or none) ClearWinners(); - if (t1) SetWinners(team, COLOR_TEAM1); - if (t2) SetWinners(team, COLOR_TEAM2); - if (t3) SetWinners(team, COLOR_TEAM3); - if (t4) SetWinners(team, COLOR_TEAM4); + if (t1) SetWinners(team, FL_TEAM_1); + if (t2) SetWinners(team, FL_TEAM_2); + if (t3) SetWinners(team, FL_TEAM_3); + if (t4) SetWinners(team, FL_TEAM_4); dprint("Have a winner, ending game.\n"); return WINNING_YES; } @@ -1808,13 +1803,13 @@ float WinningCondition_Assault() status = WINNING_NO; // as the timelimit has not yet passed just assume the defending team will win - if(assault_attacker_team == COLOR_TEAM1) + if(assault_attacker_team == FL_TEAM_1) { - SetWinners(team, COLOR_TEAM2); + SetWinners(team, FL_TEAM_2); } else { - SetWinners(team, COLOR_TEAM1); + SetWinners(team, FL_TEAM_1); } entity ent; @@ -1940,10 +1935,10 @@ float WinningCondition_Scores(float limit, float leadlimit) if(teamplay) { - team1_score = TeamScore_GetCompareValue(COLOR_TEAM1); - team2_score = TeamScore_GetCompareValue(COLOR_TEAM2); - team3_score = TeamScore_GetCompareValue(COLOR_TEAM3); - team4_score = TeamScore_GetCompareValue(COLOR_TEAM4); + team1_score = TeamScore_GetCompareValue(FL_TEAM_1); + team2_score = TeamScore_GetCompareValue(FL_TEAM_2); + team3_score = TeamScore_GetCompareValue(FL_TEAM_3); + team4_score = TeamScore_GetCompareValue(FL_TEAM_4); } ClearWinners(); @@ -2059,25 +2054,25 @@ float WinningCondition_RanOutOfSpawns() FOR_EACH_PLAYER(head) if(head.deadflag == DEAD_NO) { - if(head.team == COLOR_TEAM1) + if(head.team == FL_TEAM_1) team1_score = 1; - else if(head.team == COLOR_TEAM2) + else if(head.team == FL_TEAM_2) team2_score = 1; - else if(head.team == COLOR_TEAM3) + else if(head.team == FL_TEAM_3) team3_score = 1; - else if(head.team == COLOR_TEAM4) + else if(head.team == FL_TEAM_4) team4_score = 1; } for(head = world; (head = find(head, classname, "info_player_deathmatch")) != world; ) { - if(head.team == COLOR_TEAM1) + if(head.team == FL_TEAM_1) team1_score = 1; - else if(head.team == COLOR_TEAM2) + else if(head.team == FL_TEAM_2) team2_score = 1; - else if(head.team == COLOR_TEAM3) + else if(head.team == FL_TEAM_3) team3_score = 1; - else if(head.team == COLOR_TEAM4) + else if(head.team == FL_TEAM_4) team4_score = 1; } @@ -2091,20 +2086,20 @@ float WinningCondition_RanOutOfSpawns() { float t, i; if(team1_score) - t = COLOR_TEAM1; + t = FL_TEAM_1; else if(team2_score) - t = COLOR_TEAM2; + t = FL_TEAM_2; else if(team3_score) - t = COLOR_TEAM3; + t = FL_TEAM_3; else // if(team4_score) - t = COLOR_TEAM4; + t = FL_TEAM_4; CheckAllowedTeams(world); for(i = 0; i < MAX_TEAMSCORE; ++i) { - if(t != COLOR_TEAM1) if(c1 >= 0) TeamScore_AddToTeam(COLOR_TEAM1, i, -1000); - if(t != COLOR_TEAM2) if(c2 >= 0) TeamScore_AddToTeam(COLOR_TEAM2, i, -1000); - if(t != COLOR_TEAM3) if(c3 >= 0) TeamScore_AddToTeam(COLOR_TEAM3, i, -1000); - if(t != COLOR_TEAM4) if(c4 >= 0) TeamScore_AddToTeam(COLOR_TEAM4, i, -1000); + if(t != FL_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(FL_TEAM_1, i, -1000); + if(t != FL_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(FL_TEAM_2, i, -1000); + if(t != FL_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(FL_TEAM_3, i, -1000); + if(t != FL_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(FL_TEAM_4, i, -1000); } AddWinners(team, t); @@ -2194,9 +2189,9 @@ void CheckRules_World() { checkrules_suddendeathwarning = TRUE; if(g_race && !g_race_qualifying) - bcenterprint("^3Everyone, finish your lap! The race is over!"); + Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_RACE_FINISHLAP); else - bcenterprint("^3Now playing ^1OVERTIME^3!\n\n^3Keep fragging until we have a ^1winner^3!"); + Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_OVERTIME_FRAG); } } else