Initial commit for player keys

This commit is contained in:
VegaZ
2018-09-29 00:07:36 +02:00
parent 5ea4612873
commit 9f33cfbd89
7 changed files with 91 additions and 10 deletions

View File

@@ -19,11 +19,9 @@ namespace reallife_gamemode.Server.Extensions
{
public static User GetUser(this Client client, DatabaseContext context = null)
{
<<<<<<< HEAD
using (DatabaseContext dbContext = new DatabaseContext())
=======
if(context == null)
>>>>>>> feature/faction-system
{
using (context = new DatabaseContext())
{
@@ -92,7 +90,7 @@ namespace reallife_gamemode.Server.Extensions
{
using (var unbanUser = new DatabaseContext())
{
var targetUser = unbanUser.Bans.FirstOrDefault(u => u.Id == target.GetUser().BanId);
var targetUser = unbanUser.Bans.FirstOrDefault(u => u.Id == target.GetUser(unbanUser).BanId);
unbanUser.Bans.Remove(targetUser);
unbanUser.SaveChanges();
}