From 136c1c06d29885a2bf0e297c7ae5c8c1ad3ba30b Mon Sep 17 00:00:00 2001 From: VegaZ Date: Tue, 30 Mar 2021 22:06:28 +0200 Subject: [PATCH] GangwarFix zweiter Tag 9 --- ReallifeGamemode.Server/Gangwar/Turf.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index a2ef678e..e93eeb7e 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using System.Timers; using GTANetworkAPI; using Microsoft.EntityFrameworkCore; @@ -113,6 +114,13 @@ namespace ReallifeGamemode.Server.Gangwar this.timerCount = 0; } + private async Task reloadGangTurfs() + { + await Task.Delay(10000); + Gangwar.loadTurfs(); + Gangwar.loadTurfs_ToAllPlayers(); + } + private void Tick(object sender, System.Timers.ElapsedEventArgs e) { if (this.status == "attack") @@ -286,8 +294,7 @@ namespace ReallifeGamemode.Server.Gangwar this.status = "conquered"; NAPI.ClientEvent.TriggerClientEventForAll("CLIENT:Turf_Conquered", JsonConvert.SerializeObject(this.TurfID), JsonConvert.SerializeObject(this.status), JsonConvert.SerializeObject(this.Owner)); - //Gangwar.loadTurfs(); - Gangwar.loadTurfs_ToAllPlayers(); + reloadGangTurfs(); } public void attack(string attacker)