This commit is contained in:
Lukas Moungos
2019-12-01 19:06:50 +01:00
parent 35c00c002c
commit 37cb9d0e30

View File

@@ -59,7 +59,7 @@ namespace ReallifeGamemode.Server.Gangwar
public string getOwner() public string getOwner()
{ {
return this.TurfName; return this.Owner;
} }
public string getAttacker() public string getAttacker()
@@ -168,7 +168,7 @@ 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 == getAttacker()).FirstOrDefault()); ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht erobern.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
this.Owner = FactionName; this.Owner = FactionName;
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault(); Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();
turf.Owner = this.Owner; turf.Owner = this.Owner;
@@ -206,9 +206,6 @@ namespace ReallifeGamemode.Server.Gangwar
Client[] usersInGangwar = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == getOwner() || c.GetUser().Faction.Name == getAttacker()).ToArray(); Client[] usersInGangwar = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == getOwner() || c.GetUser().Faction.Name == getAttacker()).ToArray();
foreach (var u in usersInGangwar) foreach (var u in usersInGangwar)
{ {
u.SendChatMessage(JsonConvert.SerializeObject(usersInGangwar));
u.SendChatMessage(JsonConvert.SerializeObject(usersInGangwar.Length));
u.SendChatMessage(JsonConvert.SerializeObject(u.Name));
u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
u.SetData("inGangWar", getId()); u.SetData("inGangWar", getId());
clientsInGangwar.Add(u); clientsInGangwar.Add(u);