From 21aee089361f6465dc89d1f74782b5646a89895e Mon Sep 17 00:00:00 2001 From: CroniX Date: Mon, 22 Jun 2020 19:31:39 +0200 Subject: [PATCH 1/4] 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 { From 03d88fcb75e07e7882eeb5a7b50aa4a38b3ce962 Mon Sep 17 00:00:00 2001 From: CroniX Date: Mon, 22 Jun 2020 19:52:41 +0200 Subject: [PATCH 2/4] Change scoring gangwar system --- ReallifeGamemode.Server/Gangwar/Turf.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 8828a401..cffa3e32 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -40,8 +40,8 @@ namespace ReallifeGamemode.Server.Gangwar this.maxValue = maxValue; this.surplus = surplus; this.Attacker = null; - this.Att_Score = 50; - this.Def_Score = 50; + this.Att_Score = 0; + this.Def_Score = 0; this.status = "normal"; this.timer = null; this.playerInside = new List(); @@ -154,11 +154,11 @@ namespace ReallifeGamemode.Server.Gangwar { gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); } - if (this.Def_Score <= 0) + if (this.Def_Score >= 5) { this.takeOver(this.Attacker); } - else if (this.Att_Score <= 0) + else if (this.Att_Score >= 5) { this.takeOver(this.Owner); } @@ -172,7 +172,7 @@ namespace ReallifeGamemode.Server.Gangwar gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } this.takeOver(this.Owner); - this.Att_Score = 0; + this.Att_Score = 5; } else if (this.Def_Score < this.Att_Score) { @@ -181,7 +181,7 @@ namespace ReallifeGamemode.Server.Gangwar gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } this.takeOver(this.Attacker); - this.Def_Score = 0; + this.Def_Score = 5; return; } else if (this.Def_Score == this.Att_Score) @@ -191,7 +191,7 @@ namespace ReallifeGamemode.Server.Gangwar gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } this.takeOver(this.Attacker); - this.Def_Score = 0; + this.Def_Score = 5; return; } @@ -341,11 +341,11 @@ namespace ReallifeGamemode.Server.Gangwar { if (getOwner() == FactionName) { - Def_Score -= 1; + Def_Score += 1; } else if (getAttacker() == FactionName) { - Att_Score -= 1; + Att_Score += 1; } } } From 6ae4adc4687ed27950aa1dc0397c99c6d81a47ef Mon Sep 17 00:00:00 2001 From: CroniX Date: Mon, 22 Jun 2020 20:15:19 +0200 Subject: [PATCH 3/4] Change Gangwar scoring v2 --- ReallifeGamemode.Server/Gangwar/Turf.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index cffa3e32..b07103d8 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -169,7 +169,7 @@ namespace ReallifeGamemode.Server.Gangwar { foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); } this.takeOver(this.Owner); this.Att_Score = 5; @@ -178,7 +178,7 @@ namespace ReallifeGamemode.Server.Gangwar { foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); } this.takeOver(this.Attacker); this.Def_Score = 5; @@ -188,7 +188,7 @@ namespace ReallifeGamemode.Server.Gangwar { foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); } this.takeOver(this.Attacker); this.Def_Score = 5; @@ -341,11 +341,11 @@ namespace ReallifeGamemode.Server.Gangwar { if (getOwner() == FactionName) { - Def_Score += 1; + Att_Score += 1; } else if (getAttacker() == FactionName) { - Att_Score += 1; + Def_Score += 1; } } } From 3ce7612008a89d140c0ff0a3e8abca051110a782 Mon Sep 17 00:00:00 2001 From: CroniX Date: Mon, 22 Jun 2020 20:26:45 +0200 Subject: [PATCH 4/4] gw score die 3 --- ReallifeGamemode.Server/Gangwar/Turf.cs | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index b07103d8..f9a41bff 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -40,7 +40,7 @@ namespace ReallifeGamemode.Server.Gangwar this.maxValue = maxValue; this.surplus = surplus; this.Attacker = null; - this.Att_Score = 0; + this.Att_Score = 1; this.Def_Score = 0; this.status = "normal"; this.timer = null; @@ -154,44 +154,44 @@ namespace ReallifeGamemode.Server.Gangwar { gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); } - if (this.Def_Score >= 5) + if (this.Att_Score >= 5) { this.takeOver(this.Attacker); } - else if (this.Att_Score >= 5) + else if (this.Def_Score >= 5) { this.takeOver(this.Owner); } timerCount += 1; if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like { - if (this.Def_Score > this.Att_Score) + if (this.Att_Score > this.Def_Score) { foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); - } - this.takeOver(this.Owner); - this.Att_Score = 5; - } - else if (this.Def_Score < this.Att_Score) - { - foreach (Player gangwarPlayer in this.playerInGangwar) - { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } this.takeOver(this.Attacker); - this.Def_Score = 5; + this.Def_Score = 0; + } + else if (this.Att_Score < this.Def_Score) + { + foreach (Player gangwarPlayer in this.playerInGangwar) + { + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); + } + this.takeOver(this.Owner); + this.Att_Score = 0; return; } else if (this.Def_Score == this.Att_Score) { foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 5, 5); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } - this.takeOver(this.Attacker); - this.Def_Score = 5; + this.takeOver(this.Owner); + this.Def_Score = 0; return; }