Bladeren bron

fix users

Виктор Шейко 4 jaren geleden
bovenliggende
commit
c116dd2fce
2 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 2 1
      Assets/Scripts/Controllers/CompanyController.cs
  2. 2 2
      Assets/Scripts/Models/User.cs

+ 2 - 1
Assets/Scripts/Controllers/CompanyController.cs

@@ -152,8 +152,9 @@ public class CompanyController : MonoBehaviour
             }
         Client.instance.company_id = (uint)(active_company + 1);
         User.SendGetUsers();
-        player.users = new Dictionary<uint, User>();
+        //player.users = new Dictionary<uint, User>();
         //player.users = users[];
+        foreach (var u in player.users.Values) u.UserCompany();            
         Location.LocationsRequest(0);
     }
 

+ 2 - 2
Assets/Scripts/Models/User.cs

@@ -37,10 +37,10 @@ public class User
             var name = Encoding.UTF8.GetString(bytedata, read + 6, lenname);
             read += 6 + lenname;
             Debug.Log($"user received id {id} lenname {lenname} name {name} online {online} companyId {companyId}");
-            if (companyId == Client.instance.company_id) {
+            //if (companyId == Client.instance.company_id) {
                 player.users.Add(id, new User { id = id, name_user = name, online = online != 0, company_id = companyId });
                 WorkerMarker(player.users[id], Color.green);
-            }
+            //}
         }
         player.users_load = true;
     }