add cityhall menu, add self interaction menu (Arrow Down), fix freecam, add group creation, move (faction) invite from commands to menu
This commit is contained in:
@@ -24,29 +24,15 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
/// <returns></returns>
|
||||
public static User GetUser(this Client client, DatabaseContext context = null)
|
||||
{
|
||||
context = context ?? new DatabaseContext();
|
||||
if (!client.IsLoggedIn()) return null;
|
||||
if (context == null)
|
||||
{
|
||||
using (context = new DatabaseContext())
|
||||
{
|
||||
return context
|
||||
.Users
|
||||
.Include(u => u.Faction)
|
||||
.Include(u => u.FactionRank)
|
||||
.Include(u => u.Group)
|
||||
.Where(u => u.Name == client.Name)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return context
|
||||
.Users
|
||||
.Include(u => u.Faction)
|
||||
.Include(u => u.FactionRank)
|
||||
.Where(u => u.Name == client.Name)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return context
|
||||
.Users
|
||||
.Include(u => u.Faction)
|
||||
.Include(u => u.FactionRank)
|
||||
.Include(u => u.Group)
|
||||
.Where(u => u.Name == client.Name)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
public static Character GetCharacter(this User user, DatabaseContext context = null)
|
||||
|
||||
Reference in New Issue
Block a user