Beispiel #1
0
        public static void RemoveFracturePiece(long entityId, float blendTime)
        {
            var msg = new RemoveFracturePieceMsg();

            msg.EntityId  = entityId;
            msg.BlendTime = blendTime;
            MySession.Static.SyncLayer.SendMessageToAll(ref msg);
        }
Beispiel #2
0
        static void OnRemoveFracturePieceMessage(ref RemoveFracturePieceMsg msg, MyNetworkClient sender)
        {
            MyFracturedPiece fracturePiece;

            if (MyEntities.TryGetEntityById(msg.EntityId, out fracturePiece))
            {
                MyFracturedPiecesManager.Static.RemoveFracturePiece(fracturePiece, msg.BlendTime, fromServer: true, sync: false);
            }
            else
            {
                System.Diagnostics.Debug.Fail("Not existing fracture piece");
            }
        }
        static void OnRemoveFracturePieceMessage(ref RemoveFracturePieceMsg msg, MyNetworkClient sender)
        {
            Debug.Assert(!Sync.IsServer);

            MyFracturedPiece fracturePiece;
            if (MyEntities.TryGetEntityById(msg.EntityId, out fracturePiece))
            {
                MyFracturedPiecesManager.Static.RemoveFracturePiece(fracturePiece, msg.BlendTime, fromServer: true, sync: false);
            }
            else
            {
                System.Diagnostics.Debug.Fail("Not existing fracture piece");
            }
        }
        public static void RemoveFracturePiece(long entityId, float blendTime)
        {
            Debug.Assert(Sync.IsServer);

            var msg = new RemoveFracturePieceMsg();
            msg.EntityId = entityId;
            msg.BlendTime = blendTime;
            MySession.Static.SyncLayer.SendMessageToAll(ref msg);
        }