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

@@ -6,11 +6,15 @@ using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using System;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Server.Log;
namespace ReallifeGamemode.Server.Events
{
public class UpdateCharacterCloth : Script
{
private static readonly ILogger logger = LogManager.GetLogger<UpdateCharacterCloth>();
[RemoteEvent("updateDutyProp")]
public void UpdateDutyProp(Player player, int componentId, int componentVariation)
{
@@ -280,7 +284,8 @@ namespace ReallifeGamemode.Server.Events
}
}
if(data[0] == 2){
if (data[0] == 2)
{
User payer = client.GetUser(dbContext);
payer.GetCharacter(dbContext);
payer.Character.Hair = Convert.ToByte(data[2]);
@@ -288,13 +293,14 @@ namespace ReallifeGamemode.Server.Events
}
client.GetUser(dbContext).Handmoney -= data[6];
logger.LogInformation("Player {0} bought clothing for {1} dollars: slot = {2}, cloth = {3}, texture = {4}", client.Name, data[6], data[0], data[2], data[1]);
dbContext.SaveChanges();
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
}
client.TriggerEvent("clothesMenu:updateLast", data[2], data[1], data[4], data[5], data[3]);
}
}
[RemoteEvent("SERVER:BuyHairColor")]
public void BuyHairColor(Player client, byte HairColor)
@@ -332,7 +338,7 @@ namespace ReallifeGamemode.Server.Events
User payer = client.GetUser(dbContext);
payer.GetCharacter(dbContext);
payer.Handmoney -= 50;
payer.Character.HairHighlightColor = HairlightColor;
payer.Character.HairHighlightColor = HairlightColor;
// client.TriggerEvent("SERVER:SET_HANDMONEY", payer.Handmoney);
dbContext.SaveChanges();
}