Esempio n. 1
0
        public async Task UpdateOfflineUser(List <UserData> onlineUser, Action <List <UserData>, List <LocationData> > result = null)
        {
            Debug.Log("Update Offline User");
            var keys   = UserDataList.Keys.ToArray();
            var values = UserDataList.Values.ToArray();

            for (int i = 0; i < UserDataList.Count; i++)
            {
                UserData a = null;
                for (int j = 0; j < onlineUser.Count; j++)
                {
                    if (onlineUser[j].Id == keys[i])
                    {
                        a = onlineUser[j];
                        break;
                    }
                }
                if (a == null)
                {
                    var u = values[i];
                    if (u.Location != "offline")
                    {
                        OnLostUser?.Invoke(u);
                    }
                }
            }
            result?.Invoke(
                UserDataList.Select(l => l.Value).ToList(),
                LocationDataList.Select(l => l.Value).ToList());
        }
Esempio n. 2
0
 public void GetUserLocations(Action <List <UserData>, List <LocationData> > result)
 {
     result(
         UserDataList.Select(l => l.Value).ToList(),
         LocationDataList.Select(l => l.Value).ToList());
 }