|
@@ -865,8 +865,10 @@ public class Client : MonoBehaviour
|
|
|
public void BeaconsReceive(byte[] bytedata)
|
|
|
{
|
|
|
int read = 5;
|
|
|
+ int num = 0;
|
|
|
while (read < bytedata.Length)
|
|
|
{
|
|
|
+ num++;
|
|
|
var id = BitConverter.ToUInt32(bytedata, read);
|
|
|
var uuid = Encoding.UTF8.GetString(bytedata, read + 4, 36);
|
|
|
var x = BitConverter.ToSingle(bytedata, read + 40);
|
|
@@ -876,11 +878,13 @@ public class Client : MonoBehaviour
|
|
|
var major = BitConverter.ToUInt16(bytedata, read + 54);
|
|
|
var enabled = bytedata[read + 56];
|
|
|
var lid = BitConverter.ToUInt32(bytedata, read+57);
|
|
|
- print($"beacon received id {id} uuid {uuid} x {x} y {y} z {z} minor {minor} major {major} enabled {enabled} location {lid}");
|
|
|
- read += 61;
|
|
|
+ var mac = Encoding.UTF8.GetString(bytedata, read + 61, 17);
|
|
|
+ print($"beacon received id {id} uuid {uuid} x {x} y {y} z {z} minor {minor} major {major} enabled {enabled} location {lid} mac{mac}");
|
|
|
+ read += 78;
|
|
|
|
|
|
PlayerController.Beacons.Add(new Beacon { id = id, location_id = lid, uuid = uuid, x = x, y = y, z = z, minor = minor, major = major, enabled = enabled == 1 ? true : false });
|
|
|
}
|
|
|
+ print("Beacons loaded: " + num);
|
|
|
PlayerController.beacons_load = true;
|
|
|
}
|
|
|
|