Browse Source

+companyId в UsersReceive

Rimmon 4 years ago
parent
commit
d1c9fd2a2a
1 changed files with 3 additions and 2 deletions
  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;
         var player = PlayerController.instance;
         player.users = new Dictionary<uint, User>();
         player.users = new Dictionary<uint, User>();
-        int read = 5;
+        var companyId = BitConverter.ToUInt32(bytedata, 5);
+        int read = 9;
         while (read < bytedata.Length)
         while (read < bytedata.Length)
         {
         {
             var id = BitConverter.ToUInt32(bytedata, read);
             var id = BitConverter.ToUInt32(bytedata, read);
@@ -34,7 +35,7 @@ public class User
             var lenname = bytedata[read + 5];
             var lenname = bytedata[read + 5];
             var name = Encoding.UTF8.GetString(bytedata, read + 6, lenname);
             var name = Encoding.UTF8.GetString(bytedata, read + 6, lenname);
             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 });
             player.users.Add(id, new User { id = id, name = name, online = online!=0 });
             WorkerMarker(player.users[id], Color.green);
             WorkerMarker(player.users[id], Color.green);
         }
         }