This commit is contained in:
2021-04-08 02:38:23 +02:00
parent a016a5e065
commit d3f347a228

View File

@@ -173,7 +173,7 @@ namespace ReallifeGamemode.Server.Gangwar
this.takeOver(this.Owner); this.takeOver(this.Owner);
}*/ }*/
timerCount += 1; timerCount += 1;
if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like if (timerCount >= 10) //change to 900 (seconds) before release for testing reasons change to whatever you like
{ {
if (this.Att_Score > this.Def_Score) if (this.Att_Score > this.Def_Score)
{ {
@@ -255,10 +255,13 @@ namespace ReallifeGamemode.Server.Gangwar
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray(); Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
foreach (var o in owners) foreach (var o in owners)
{ {
if (o != null)
o.TriggerEvent("CLIENT:win"); o.TriggerEvent("CLIENT:win");
} }
foreach (var a in attackers) foreach (var a in attackers)
{ {
if (o != null)
a.TriggerEvent("CLIENT:loose"); a.TriggerEvent("CLIENT:loose");
} }
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
@@ -268,8 +271,15 @@ namespace ReallifeGamemode.Server.Gangwar
else if (getOwner() != FactionName) else if (getOwner() != FactionName)
{ {
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
Console.WriteLine("[DEBUG:GANGWAR] getting owners...");
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray(); Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
Console.WriteLine($"[DEBUG:GANGWAR] got owners {owners}.");
Console.WriteLine($"[DEBUG:GANGWAR] got owners {owners.ToString()}.");
Console.WriteLine("[DEBUG:GANGWAR] getting attackers...");
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray(); Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
Console.WriteLine($"[DEBUG:GANGWAR] got attackers {attackers}.");
Console.WriteLine($"[DEBUG:GANGWAR] got attackers {attackers.ToString()}.");
foreach (var o in owners) foreach (var o in owners)
{ {
if (o != null) if (o != null)