Esempio n. 1
0
 //Performs a deep copy of the given MNI and applies it to the existing object, preserving active pointers
 //Preserves the existing MeshNetwork reference and the existing list of attached components
 //These are not serialized across the network (obviously) and thus should not be deepcopied
 public void DeepCopyAndApply(MeshNetworkIdentity i)
 {
     SetLocked(i.GetLocked());
     SetObjectID(i.GetObjectID());
     SetOwnerID(i.GetOwnerID());
     SetPrefabID(i.GetPrefabID());
 }
Esempio n. 2
0
    public void ReceivePacket(MeshPacket p)
    {
        if (p.GetPacketType() != PacketType.TransformUpdate)
        {
            //Reject incompatible packets.
            return;
        }
        if (p.GetSourcePlayerId() == thisIdentity.meshnetReference.GetLocalPlayerID())
        {
            //Reject packets coming from ourselves.
            return;
        }
        if (p.GetSourcePlayerId() != thisIdentity.GetOwnerID())
        {
            //Reject unauhorized packets.
            return;
        }

        TransformUpdate t = TransformUpdate.ParseSerializedBytes(p.GetContents());

        ProcessUpdate(t);
    }