improve paycheck and weapondeal logs
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using ReallifeGamemode.Database.Entities;
|
using ReallifeGamemode.Database.Entities;
|
||||||
using ReallifeGamemode.Database.Models;
|
using ReallifeGamemode.Database.Models;
|
||||||
@@ -19,6 +20,7 @@ using ReallifeGamemode.Server.Services;
|
|||||||
using ReallifeGamemode.Server.Types;
|
using ReallifeGamemode.Server.Types;
|
||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
using ReallifeGamemode.Server.WeaponDeal;
|
using ReallifeGamemode.Server.WeaponDeal;
|
||||||
|
using ReallifeGamemode.Server.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @overview Life of German Reallife - Event Key (Key.cs)
|
* @overview Life of German Reallife - Event Key (Key.cs)
|
||||||
@@ -30,6 +32,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
public class Key : Script
|
public class Key : Script
|
||||||
{
|
{
|
||||||
|
private static readonly ILogger logger = LogManager.GetLogger<Key>();
|
||||||
|
|
||||||
#region User Key
|
#region User Key
|
||||||
|
|
||||||
[RemoteEvent("keyPress:NUM2")]
|
[RemoteEvent("keyPress:NUM2")]
|
||||||
@@ -293,6 +297,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
dbContext.VehicleItems.Remove(v);
|
dbContext.VehicleItems.Remove(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.LogInformation("Player {0} took the weapon deal item {1} (amount: {2}) out of weapon vehicle {3}", player.Name, v.VehicleId, itemToAdd, v.VehicleId);
|
||||||
|
|
||||||
InventoryManager.AddItemToInventory(player, v.ItemId, itemToAdd);
|
InventoryManager.AddItemToInventory(player, v.ItemId, itemToAdd);
|
||||||
nearestBehindVehiclePoint.usePoint(player);
|
nearestBehindVehiclePoint.usePoint(player);
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
@@ -392,6 +398,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.LogInformation("Player {0} put the weapon deal item \"{1}\" (amount: {2}) in weapon rack of faction {3}", player.Name, weapon.WeaponModel, item.Amount, user.FactionId);
|
||||||
|
|
||||||
weapon.Ammount += item.Amount;
|
weapon.Ammount += item.Amount;
|
||||||
ChatService.SendMessage(player, item.Amount + " " + iItem.Name + " wurden im Waffenlager hinzugefügt.");
|
ChatService.SendMessage(player, item.Amount + " " + iItem.Name + " wurden im Waffenlager hinzugefügt.");
|
||||||
unloadedWeaponPackage = true;
|
unloadedWeaponPackage = true;
|
||||||
|
|||||||
@@ -166,7 +166,14 @@ namespace ReallifeGamemode.Server.Finance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.LogInformation("Player {0} has a payday of {1} dollars. old balance: {2}, new balance: {3}", client.Name, paycheck.Amount, u.BankAccount.Balance, u.BankAccount.Balance + paycheck.Amount);
|
logger.LogInformation("Player {0} has a payday of {1} dollars. old balance: {2}, new balance: {3}, wage: {4}, interest: {5}, other: {6}",
|
||||||
|
client.Name,
|
||||||
|
paycheck.Amount,
|
||||||
|
u.BankAccount.Balance,
|
||||||
|
u.BankAccount.Balance + paycheck.Amount,
|
||||||
|
paycheck.Wage,
|
||||||
|
paycheck.FinancialInterest,
|
||||||
|
paycheck.otheramount);
|
||||||
|
|
||||||
u.BankAccount.Balance += paycheck.Amount;
|
u.BankAccount.Balance += paycheck.Amount;
|
||||||
u.Wage = 0;
|
u.Wage = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user