|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections.Generic;
-
- namespace CLre_server.API.Synergy
- {
- public static class Clients
- {
- private static readonly List<int> clrePlayers = new List<int>();
- private static readonly List<int> players = new List<int>();
-
- internal static void RegisterCLreClient(int playerId)
- {
- clrePlayers.Add(playerId);
- }
-
- internal static void RegisterClient(int playerId)
- {
- players.Add(playerId);
- }
-
- internal static void RemoveClient(int playerId)
- {
- if (IsCLreClient(playerId))
- {
- clrePlayers.Remove(playerId);
- }
- players.Remove(playerId);
- }
-
- public static bool IsCLreClient(int playerId)
- {
- return clrePlayers.Contains(playerId);
- }
-
- public static bool IsConnected(int playerId)
- {
- return players.Contains(playerId);
- }
-
- public static IEnumerator<int> CLreClients()
- {
- return clrePlayers.GetEnumerator();
- }
- }
- }
|