Feature/character creator

This commit is contained in:
VegaZ
2018-10-24 20:51:54 +02:00
parent bf13d7ed4a
commit 6e16db56bd
14 changed files with 1184 additions and 15 deletions

View File

@@ -31,5 +31,19 @@ namespace reallife_gamemode.Server.Extensions
return context.UserBankAccounts.FirstOrDefault(u => u.UserId == user.Id);
}
}
public static Character GetUserCharacter(this User user, DatabaseContext context = null)
{
if (context == null)
{
using (context = new DatabaseContext())
{
return context.Characters.FirstOrDefault(u => u.UserId == user.Id);
}
}
else
{
return context.Characters.FirstOrDefault(u => u.UserId == user.Id);
}
}
}
}