Log UserWeapon
This commit is contained in:
25
ReallifeGamemode.Database/Entities/UserWeapon.cs
Normal file
25
ReallifeGamemode.Database/Entities/UserWeapon.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Database.Entities
|
||||||
|
{
|
||||||
|
public partial class UserWeapon
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("User")]
|
||||||
|
public int UserId { get; set; }
|
||||||
|
public User User { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("Weapon")]
|
||||||
|
public int WeaponId { get; set; }
|
||||||
|
public Weapon Weapon { get; set; }
|
||||||
|
|
||||||
|
public int Ammo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
20
ReallifeGamemode.Database/Entities/Weapon.cs
Normal file
20
ReallifeGamemode.Database/Entities/Weapon.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Database.Entities
|
||||||
|
{
|
||||||
|
public partial class Weapon
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string WeaponModel { get; set; }
|
||||||
|
public string Category { get; set; }
|
||||||
|
public int SlotID { get; set; }
|
||||||
|
public int Ammo { get; set; }
|
||||||
|
public float Price { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,6 +74,8 @@ namespace ReallifeGamemode.Database.Models
|
|||||||
public DbSet<Entities.UserVehicle> UserVehicles { get; set; }
|
public DbSet<Entities.UserVehicle> UserVehicles { get; set; }
|
||||||
public DbSet<Entities.UserBankAccount> UserBankAccounts { get; set; }
|
public DbSet<Entities.UserBankAccount> UserBankAccounts { get; set; }
|
||||||
|
|
||||||
|
public DbSet<Entities.UserWeapon> UserWeapons { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//Inventar
|
//Inventar
|
||||||
public DbSet<Entities.UserItem> UserItems { get; set; }
|
public DbSet<Entities.UserItem> UserItems { get; set; }
|
||||||
@@ -85,8 +87,12 @@ namespace ReallifeGamemode.Database.Models
|
|||||||
public DbSet<Entities.FactionVehicle> FactionVehicles { get; set; }
|
public DbSet<Entities.FactionVehicle> FactionVehicles { get; set; }
|
||||||
|
|
||||||
//Shops
|
//Shops
|
||||||
|
public DbSet<Entities.ShopClothe> ShopClothes { get; set; }
|
||||||
|
public DbSet<Entities.ShopItem> ShopItems { get; set; }
|
||||||
|
public DbSet<Entities.Weapon> Weapons { get; set; }
|
||||||
|
|
||||||
//Logs
|
//Logs
|
||||||
|
|
||||||
//public DbSet<Logs.Ban> BanLogs { get; set; }
|
//public DbSet<Logs.Ban> BanLogs { get; set; }
|
||||||
public DbSet<Entities.Logs.BankAccountTransactionHistory> BankAccountTransactionLogs { get; set; }
|
public DbSet<Entities.Logs.BankAccountTransactionHistory> BankAccountTransactionLogs { get; set; }
|
||||||
public DbSet<Entities.Logs.Death> DeathLogs { get; set; }
|
public DbSet<Entities.Logs.Death> DeathLogs { get; set; }
|
||||||
@@ -155,12 +161,6 @@ namespace ReallifeGamemode.Database.Models
|
|||||||
//Gangwar
|
//Gangwar
|
||||||
public DbSet<Entities.Turfs> Turfs { get; set; }
|
public DbSet<Entities.Turfs> Turfs { get; set; }
|
||||||
|
|
||||||
//ClothesShop
|
|
||||||
public DbSet<Entities.ShopClothe> ShopClothes { get; set; }
|
|
||||||
|
|
||||||
//ItemShop
|
|
||||||
public DbSet<Entities.ShopItem> ShopItems { get; set; }
|
|
||||||
|
|
||||||
//Server Variablen
|
//Server Variablen
|
||||||
public DbSet<Entities.ServerVariable> ServerVariables { get; set; }
|
public DbSet<Entities.ServerVariable> ServerVariables { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using ReallifeGamemode.Server.Shop.SevenEleven;
|
|||||||
using ReallifeGamemode.Server.Shop.Friseur;
|
using ReallifeGamemode.Server.Shop.Friseur;
|
||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Shop.Ammunation;
|
||||||
|
|
||||||
namespace ReallifeGamemode.Server.Managers
|
namespace ReallifeGamemode.Server.Managers
|
||||||
{
|
{
|
||||||
@@ -29,6 +30,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
public static List<Player> cuffPoints = new List<Player>();
|
public static List<Player> cuffPoints = new List<Player>();
|
||||||
|
|
||||||
|
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
|
||||||
|
|
||||||
public static void LoadPositionManager()
|
public static void LoadPositionManager()
|
||||||
{
|
{
|
||||||
#region DutyPoints
|
#region DutyPoints
|
||||||
@@ -407,3 +410,9 @@ public class ElevatorPoint
|
|||||||
public int FactionId { get; set; }
|
public int FactionId { get; set; }
|
||||||
public string Stage { get; set; }
|
public string Stage { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AmmunationPoint
|
||||||
|
{
|
||||||
|
public Vector3 Position { get; set; }
|
||||||
|
public Ammunation Ammunation { get; set; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
public static List<ClotheShop> clotheStores = new List<ClotheShop>();
|
public static List<ClotheShop> clotheStores = new List<ClotheShop>();
|
||||||
public static List<ItemShop> itemShops = new List<ItemShop>();
|
public static List<ItemShop> itemShops = new List<ItemShop>();
|
||||||
public static List<Friseur> FriseurStores = new List<Friseur>();
|
public static List<Friseur> FriseurStores = new List<Friseur>();
|
||||||
|
public static List<AmmunationPoint> Ammunations = new List<Ammunation>();
|
||||||
|
|
||||||
public static void LoadClotheShops()
|
public static void LoadClotheShops()
|
||||||
{
|
{
|
||||||
|
|||||||
31
ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs
Normal file
31
ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Database.Models;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Shop.Ammunation
|
||||||
|
{
|
||||||
|
public class Ammunation
|
||||||
|
{
|
||||||
|
public Vector3 vector { get; set; }
|
||||||
|
public List<Weapon> weaponList = new List<Weapon>();
|
||||||
|
|
||||||
|
public Ammunation(Vector3 position)
|
||||||
|
{
|
||||||
|
this.vector = vector;
|
||||||
|
LoadWeapons();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadWeapons()
|
||||||
|
{
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
weaponList = dbContext.Weapons.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user