Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1KB

  1. using System.Collections.Generic;
  2. namespace CLre_server.API.Synergy
  3. {
  4. public static class Clients
  5. {
  6. private static readonly List<int> clrePlayers = new List<int>();
  7. private static readonly List<int> players = new List<int>();
  8. internal static void RegisterCLreClient(int playerId)
  9. {
  10. clrePlayers.Add(playerId);
  11. }
  12. internal static void RegisterClient(int playerId)
  13. {
  14. players.Add(playerId);
  15. }
  16. internal static void RemoveClient(int playerId)
  17. {
  18. if (IsCLreClient(playerId))
  19. {
  20. clrePlayers.Remove(playerId);
  21. }
  22. players.Remove(playerId);
  23. }
  24. public static bool IsCLreClient(int playerId)
  25. {
  26. return clrePlayers.Contains(playerId);
  27. }
  28. public static bool IsConnected(int playerId)
  29. {
  30. return players.Contains(playerId);
  31. }
  32. public static IEnumerator<int> CLreClients()
  33. {
  34. return clrePlayers.GetEnumerator();
  35. }
  36. }
  37. }