public static void Replicate(object obj, ulong entityID)
        {
            Debug.Assert(Static != null);
            Debug.Assert(Static.m_peer is MyRakNetServer);
            Debug.Assert(!Static.m_stateData.ContainsKey(entityID));
            Debug.Assert(Static.m_idToType.Contains(obj.GetType()));

            int typeID = Static.m_typeToId[obj.GetType()];

            BitStream bs = new BitStream(null);

            bs.Write((byte)MessageIDEnum.REPLICATION_CREATE);
            bs.WriteCompressed(typeID); // TODO:SK better compression
            bs.Write((long)entityID);

            MySyncedClass syncedClass = GetSyncedClass(obj);

            syncedClass.TypeID   = typeID;
            syncedClass.EntityId = entityID;
            syncedClass.Serialize(bs);

            RegisterSynced(syncedClass);

            ((MyRakNetServer)Static.m_peer).BroadcastMessage(bs, PacketPriorityEnum.LOW_PRIORITY, PacketReliabilityEnum.RELIABLE, 0, RakNetGUID.UNASSIGNED_RAKNET_GUID);
        }
        internal static void Sync(MySyncedClass mySyncedClass)
        {
            Debug.Assert(mySyncedClass.entityId != 0);
            Debug.Assert(Static != null);
            Debug.Assert(Static.m_peer is MyRakNetServer);

            BitStream bs = new BitStream(null);

            bs.Write((byte)MessageIDEnum.SYNC_FIELD);
            bs.Write((long)mySyncedClass.entityId);
            mySyncedClass.Serialize(bs);

            ((MyRakNetServer)Static.m_peer).BroadcastMessage(bs, PacketPriorityEnum.LOW_PRIORITY, PacketReliabilityEnum.UNRELIABLE, 0, RakNetGUID.UNASSIGNED_RAKNET_GUID);
        }
        private static void Sync(uint networkID, MySyncedClass sync, int clientIndex)
        {
            Debug.Assert(networkID != 0);
            Debug.Assert(Static != null);
            Debug.Assert(Static.m_peer is MyRakNetServer);

            BitStream bs = new BitStream(null);

            bs.Write((byte)MessageIDEnum.SYNC_FIELD);
            bs.WriteCompressed(networkID);
            sync.Serialize(bs, clientIndex);

            var steamID = Static.m_clientIndexToSteamID[clientIndex];

            // TODO:SK use UNRELIABLE_WITH_ACK_RECEIPT
            var packetID = ((MyRakNetServer)Static.m_peer).SendMessage(bs, steamID, PacketPriorityEnum.LOW_PRIORITY, PacketReliabilityEnum.UNRELIABLE);
        }
        internal static void Sync(MySyncedClass mySyncedClass)
        {
            Debug.Assert(mySyncedClass.EntityId != 0);
            Debug.Assert(Static != null);
            Debug.Assert(Static.m_peer is MyRakNetServer);

            BitStream bs = new BitStream(null);
            bs.Write((byte)MessageIDEnum.SYNC_FIELD);
            bs.Write((long)mySyncedClass.EntityId);
            mySyncedClass.Serialize(bs);

            // TODO:SK use UNRELIABLE_WITH_ACK_RECEIPT
            ((MyRakNetServer)Static.m_peer).BroadcastMessage(bs, PacketPriorityEnum.LOW_PRIORITY, PacketReliabilityEnum.UNRELIABLE, 0, RakNetGUID.UNASSIGNED_RAKNET_GUID);
        }