Continued faction rank system
This commit is contained in:
@@ -76,7 +76,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
using(var context = new DatabaseContext())
|
||||
{
|
||||
List<FactionRank> factionRanks = context.FactionRanks.ToList().FindAll(r => r.FactionId == f.Id);
|
||||
List<FactionRank> factionRanks = context.FactionRanks.ToList().FindAll(r => r.FactionId == f.Id).OrderByDescending(o => o.Order).ToList();
|
||||
string json = JsonConvert.SerializeObject(factionRanks, Formatting.None);
|
||||
player.TriggerEvent("manageFactionRanks", json);
|
||||
}
|
||||
|
||||
@@ -31,18 +31,14 @@ namespace reallife_gamemode.Server.Services
|
||||
{
|
||||
using (var dbCon = new DatabaseContext())
|
||||
{
|
||||
foreach (User u in dbCon.Users)
|
||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
Client c = ClientService.GetClientByName(u.Name);
|
||||
if (c != null)
|
||||
Faction f = c.GetFaction();
|
||||
if (f != null)
|
||||
{
|
||||
Faction f = c.GetFaction();
|
||||
if (f != null)
|
||||
if (factions.Find(fT => fT.Id == f.Id) != null)
|
||||
{
|
||||
if (factions.Find(fT => fT.Id == f.Id) != null)
|
||||
{
|
||||
c.SendChatMessage(message);
|
||||
}
|
||||
c.SendChatMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user