Bladeren bron

+companyId в UsersReceive

Rimmon 4 jaren geleden
bovenliggende
commit
d1c9fd2a2a
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      Assets/Scripts/Models/User.cs

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

@@ -26,7 +26,8 @@ public class User
     {
         var player = PlayerController.instance;
         player.users = new Dictionary<uint, User>();
-        int read = 5;
+        var companyId = BitConverter.ToUInt32(bytedata, 5);
+        int read = 9;
         while (read < bytedata.Length)
         {
             var id = BitConverter.ToUInt32(bytedata, read);
@@ -34,7 +35,7 @@ public class User
             var lenname = bytedata[read + 5];
             var name = Encoding.UTF8.GetString(bytedata, read + 6, lenname);
             read += 6 + lenname;
-            Debug.Log($"user received id {id} lenname {lenname} name {name} online {online}");
+            Debug.Log($"user received id {id} lenname {lenname} name {name} online {online} companyId {companyId}");
             player.users.Add(id, new User { id = id, name = name, online = online!=0 });
             WorkerMarker(player.users[id], Color.green);
         }