Add debug for Faction
This commit is contained in:
3
Main.cs
3
Main.cs
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Entities;
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace reallife_gamemode
|
||||
NAPI.Util.ConsoleOutput(f.Name);
|
||||
}
|
||||
|
||||
foreach(User u in context.Users)
|
||||
foreach(User u in context.Users.Include(x => x.Faction))
|
||||
{
|
||||
Faction f = u.Faction;
|
||||
NAPI.Util.ConsoleOutput("User: " + u.Name + " | Faction: " + (f == null ? "null" : f.Name));
|
||||
|
||||
@@ -21,18 +21,6 @@ namespace reallife_gamemode.Server.Commands
|
||||
{
|
||||
User u = player.GetUser();
|
||||
|
||||
if(u == null)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("u is null");
|
||||
return;
|
||||
}
|
||||
Entities.Faction f = u.Faction;
|
||||
if(f == null)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("f is null");
|
||||
return;
|
||||
}
|
||||
|
||||
string broadcastMessage = "** " + player.Name + ": " + message + " )) **";
|
||||
|
||||
ChatService.BroadcastFaction(broadcastMessage, player.GetFaction());
|
||||
|
||||
Reference in New Issue
Block a user