1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ClientData
- {
- public static Action onClientDataUpdate;
- public static List<ulong> clientIPList = new List<ulong>();
- public static bool AddClientID(ulong clientID)
- {
- if(!clientIPList.Contains(clientID))
- {
- clientIPList.Add(clientID);
- if(onClientDataUpdate != null)
- {
- onClientDataUpdate();
- }
- return true;
- }
- return false;
- }
- public static bool RemoveClientID(ulong clientID)
- {
- if(clientIPList.Contains(clientID))
- {
- clientIPList.Remove(clientID);
- if(onClientDataUpdate != null)
- {
- onClientDataUpdate();
- }
- return true;
- }
- return false;
- }
- }
|