Merge branch 'feature/faction-system' into develop

This commit is contained in:
hydrant
2018-09-28 17:52:09 +02:00
24 changed files with 720 additions and 10 deletions

View File

@@ -1,6 +1,10 @@
using GTANetworkAPI;
using reallife_gamemode.Model;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/**
@@ -18,11 +22,12 @@ namespace reallife_gamemode.Server.Services
player.SendChatMessage("~r~[FEHLER]~s~ Du kannst diesen Befehl nicht ausführen.");
}
internal static void PlayerNotFound(Client player)
public static void PlayerNotFound(Client player)
{
player.SendChatMessage("~r~[FEHLER]~s~ Der Spieler wurde nicht gefunden.");
}
<<<<<<< HEAD
public static void PlayerNotLoggedIn(Client player)
{
player.SendChatMessage("~r~[FEHLER]~s~ Du bist nicht eingeloggt.");
@@ -30,6 +35,29 @@ namespace reallife_gamemode.Server.Services
public static void ErrorMsg(Client player)
{
player.SendChatMessage("~r~[FEHLER]~s~ Die Aktion wurde nicht ausgeführt.");
=======
public static void BroadcastFaction(string message, List<Faction> factions)
{
using (var dbCon = new DatabaseContext())
{
foreach (Client c in NAPI.Pools.GetAllPlayers())
{
Faction f = c.GetFaction();
if (f != null)
{
if (factions.Find(fT => fT.Id == f.Id) != null)
{
c.SendChatMessage(message);
}
}
}
}
}
public static void BroadcastFaction(string message, Faction faction)
{
BroadcastFaction(message, new List<Faction> { faction });
>>>>>>> feature/faction-system
}
}
}