GELD LOGS

(cherry picked from commit a2db770316)
This commit is contained in:
hydrant
2021-05-15 03:14:37 +02:00
parent 3c63002c03
commit 7411fa02f3
22 changed files with 448 additions and 306 deletions

View File

@@ -2,9 +2,11 @@
using System.Linq;
using System.Numerics;
using GTANetworkAPI;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Log;
/**
* @overview Life of German Reallife - Managers ATMManager (ATMManager.cs)
@@ -18,6 +20,8 @@ namespace ReallifeGamemode.Server.Managers
{
public static List<ColShape> ATMColShapes = new List<ColShape>();
private static readonly ILogger logger = LogManager.GetLogger<ATMManager>();
public static void InitATMs()
{
var addedATMs = 0;
@@ -112,15 +116,16 @@ namespace ReallifeGamemode.Server.Managers
//client.TriggerEvent("SERVER:WORLD_INTERACTION:ATM_ERROR", 0, checkATM.Balance);
client.SendNotification("~r~Nicht genügend Geld auf der Hand!");
}
else if(inputField1 < 0)
else if (inputField1 < 0)
{
client.SendNotification("~r~Ungültiger Betrag!");
}
else
}
else
{
var updateBankMoneyIn = user.BankAccount;
var updateATMBalanceIn = dbContext.ATMs.FirstOrDefault(a => a.Id == nearATM);
user.Handmoney -= inputField1;
logger.LogInformation("Player {0} did a deposit of {1} dollars at atm {2}", client.Name, inputField1, nearATM);
updateBankMoneyIn.Balance += inputField1;
updateATMBalanceIn.Balance += inputField1;
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
@@ -149,6 +154,7 @@ namespace ReallifeGamemode.Server.Managers
var updateATMBalanceOut = dbContext.ATMs.FirstOrDefault(a => a.Id == nearATM);
updateHandMoneyOut.Handmoney += inputField1;
user.BankAccount.Balance -= inputField1;
logger.LogInformation("Player {0} did a withdraw of {1} dollars at atm {2}", client.Name, inputField1, nearATM);
updateATMBalanceOut.Balance -= inputField1;
//client.TriggerEvent("SERVER:SET_HANDMONEY", updateHandMoneyOut.Handmoney);
}