[HOTFIX] Mehr Logs beim Tod, DeathLogs korrekt füllen

This commit is contained in:
hydrant
2021-04-18 03:39:35 +02:00
parent 2cdb422a78
commit 0b7b0a3a99
3 changed files with 59 additions and 23 deletions

View File

@@ -203,11 +203,16 @@ namespace ReallifeGamemode.Server.Gangwar
public void enter(Player client)
{
User user = client.GetUser();
if(user == null || user.FactionId == null)
{
return;
}
if (this.status == "attack")
{
if (user.Faction.Name != getOwner() && user.Faction.Name != getAttacker())
return;
Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.GetUser()?.Id == user.Id).FirstOrDefault();
Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.Handle.Value == client.Handle.Value).FirstOrDefault();
if (gPlayer == null)
{
using (var dbContext = new DatabaseContext())
@@ -366,10 +371,12 @@ namespace ReallifeGamemode.Server.Gangwar
{
if (getOwner() == FactionName)
{
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getAttacker()}");
Att_Score += 1;
}
else if (getAttacker() == FactionName)
{
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getOwner()}");
Def_Score += 1;
}
}