formatted code
This commit is contained in:
@@ -25,7 +25,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
public string Reason { get; set; }
|
||||
public string BannedBy { get; set; }
|
||||
|
||||
|
||||
public int Applied { get; set; }
|
||||
public int UntilDateTime { get; set; }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace ReallifeGamemode.Server.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public int Balance {
|
||||
public int Balance
|
||||
{
|
||||
get => _balance;
|
||||
set
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
@@ -8,6 +11,17 @@ namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public Group Group { get; set; }
|
||||
|
||||
[ForeignKey("Group")]
|
||||
public int? GroupId { get; set; }
|
||||
|
||||
public Group GetGroup()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
return dbContext.Groups.Where(g => g.Id == GroupId).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Gruppen Fahrzeug | Gruppe: " + Group.Name;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace ReallifeGamemode.Server.Entities.Logs
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("Victim")]
|
||||
public int VictimId { get; set; }
|
||||
public User Victim { get; set; }
|
||||
@@ -36,7 +36,7 @@ namespace ReallifeGamemode.Server.Entities.Logs
|
||||
public float KillerPositionY { get; set; }
|
||||
public float KillerPositionZ { get; set; }
|
||||
public float KillerHeading { get; set; }
|
||||
|
||||
|
||||
[StringLength(64)]
|
||||
public string CauseOfDeath { get; set; }
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -34,5 +34,5 @@ namespace ReallifeGamemode.Server.Entities.Saves
|
||||
public float Rotation { get; set; }
|
||||
public byte Dimension { get; set; }
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
string numberplate = $"{this.Id}";
|
||||
|
||||
if(this is FactionVehicle fV)
|
||||
if (this is FactionVehicle fV)
|
||||
{
|
||||
numberplate = $"F{fV.FactionId} " + numberplate;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
numberplate = $"U{uV.UserId} " + numberplate;
|
||||
}
|
||||
|
||||
if(this is ShopVehicle sV)
|
||||
if (this is ShopVehicle sV)
|
||||
{
|
||||
numberplate = "Shop";
|
||||
VehicleStreaming.SetLockStatus(veh, false);
|
||||
@@ -66,6 +66,11 @@ namespace ReallifeGamemode.Server.Entities
|
||||
veh.Position.Add(new Vector3(0, 0, 1.3)), 10.0f, 1f, 1, new Color(255, 255, 255));
|
||||
}
|
||||
|
||||
if (this is GroupVehicle gV)
|
||||
{
|
||||
numberplate = $"{gV.GroupId}" + numberplate;
|
||||
}
|
||||
|
||||
veh.NumberPlate = numberplate;
|
||||
|
||||
return veh;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
[ForeignKey("Ban")]
|
||||
public int? BanId { get; set; }
|
||||
public Ban Ban { get; set; }
|
||||
|
||||
|
||||
public int? FactionId { get; set; }
|
||||
public Faction Faction { get; set; }
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
public Group Group { get; set; }
|
||||
|
||||
public GroupRank GroupRank { get; set; }
|
||||
|
||||
public FactionRank GetFactionRank()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
@@ -97,7 +99,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
banUser = new Ban { UserId = this.Id, Reason = reason, BannedBy = admin.Name, Applied = unixTimestamp, UntilDateTime = unixTimestamp };
|
||||
|
||||
this.Client?.Kick();
|
||||
|
||||
|
||||
mins--;
|
||||
}
|
||||
else
|
||||
@@ -128,7 +130,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
public List<UserItem> GetItems()
|
||||
{
|
||||
using(var dbContext = new DatabaseContext())
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
return dbContext.UserItems.ToList().FindAll(u => u.UserId == this.Id);
|
||||
}
|
||||
|
||||
@@ -28,12 +28,13 @@ namespace ReallifeGamemode.Server.Entities
|
||||
public string Bic { get; set; }
|
||||
[StringLength(32)]
|
||||
public string Iban { get; set; }
|
||||
public int Balance {
|
||||
public int Balance
|
||||
{
|
||||
get => _balance;
|
||||
set
|
||||
{
|
||||
_balance = value;
|
||||
using(var dbContext = new DatabaseContext())
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
ClientService.GetClientByNameOrId(dbContext.Users.First(u => u.Id == UserId).Name).TriggerEvent("updateMoney", value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user