From 21aee089361f6465dc89d1f74782b5646a89895e Mon Sep 17 00:00:00 2001 From: CroniX Date: Mon, 22 Jun 2020 19:31:39 +0200 Subject: [PATCH] Debug gang chat --- ReallifeGamemode.Database/Entities/Faction.cs | 2 ++ ReallifeGamemode.Server/Commands/FactionCommands.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Database/Entities/Faction.cs b/ReallifeGamemode.Database/Entities/Faction.cs index a0291a0f..5e600b89 100644 --- a/ReallifeGamemode.Database/Entities/Faction.cs +++ b/ReallifeGamemode.Database/Entities/Faction.cs @@ -19,6 +19,8 @@ namespace ReallifeGamemode.Database.Entities [StringLength(32)] public string Name { get; set; } public bool StateOwned { get; set; } + + public bool GangOwned { get; set; } public int WeaponDealTime { get; set; } = 60; public override string BankAccountName => Name; diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index c05429b8..18e4a5d8 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -53,7 +53,10 @@ namespace ReallifeGamemode.Server.Commands message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " )) **"; - ChatService.BroadcastFaction(broadcastMessage, f); + using (var context = new DatabaseContext()) + { + ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned)); + } } else {