lückenlose nachvollziehbarkeit
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
|
||||
namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
public class Gangwar : Script
|
||||
{
|
||||
private static ILogger logger = LogManager.GetLogger<Gangwar>();
|
||||
|
||||
public static Turf[] _loadedTurfs;
|
||||
private static List<Turfs> turfs;
|
||||
public const int GANGWAR_TOTAL_TIME = 900;
|
||||
@@ -53,19 +57,19 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
var killerInsideTurf = killer.HasData("GotInsideOfTurf");
|
||||
var victimInsideTurf = victim.HasData("GotInsideOfTurf");
|
||||
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - KillerInsideTurf = {killerInsideTurf}, VictimInsideTurf = {victimInsideTurf}");
|
||||
logger.LogDebug($"GangwarKill - Victim {victim.Name} - KillerInsideTurf = {killerInsideTurf}, VictimInsideTurf = {victimInsideTurf}");
|
||||
|
||||
if (killerInsideTurf && victimInsideTurf)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killer and Victim are in Turf area");
|
||||
logger.LogDebug($"GangwarKill - Victim {victim.Name} - Killer and Victim are in Turf area");
|
||||
killer.TriggerEvent("gangWarKillNotification", victim.Name);
|
||||
foreach (var turf in getTurfs())
|
||||
{
|
||||
if (turf.getId() == victim.GetData<int>("inGangWar"))
|
||||
{
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killed in turf id {turf.getId()}");
|
||||
logger.LogDebug($"GangwarKill - Victim {victim.Name} - Killed in turf id {turf.getId()}");
|
||||
var victimFactionName = victim.GetUser().Faction.Name;
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Faction Name = {victimFactionName}");
|
||||
logger.LogDebug($"GangwarKill - Victim {victim.Name} - Faction Name = {victimFactionName}");
|
||||
turf.setKill(victimFactionName);
|
||||
return;
|
||||
}
|
||||
@@ -96,7 +100,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
[RemoteEvent("Gangarea:Leave")]
|
||||
public void RmtEvent_TurfLeave(Player client, string jsonId)
|
||||
{
|
||||
if(string.IsNullOrEmpty(jsonId))
|
||||
if (string.IsNullOrEmpty(jsonId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -189,7 +193,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
public void RmtEvent_StartGangwar(Player client)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
if(user == null || user.Faction == null)
|
||||
if (user == null || user.Faction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -385,12 +385,12 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
if (getOwner() == FactionName)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getAttacker()}");
|
||||
logger.LogDebug($"GangwarKill - Adding Point for Faction {getAttacker()}");
|
||||
Att_Score += 1;
|
||||
}
|
||||
else if (getAttacker() == FactionName)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getOwner()}");
|
||||
logger.LogDebug($"GangwarKill - Adding Point for Faction {getOwner()}");
|
||||
Def_Score += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user