Exemple #1
0
        public void StartManipulation(MyManipulationTool.MyState state, MyEntity otherEntity, Vector3D hitPosition, ref MatrixD ownerWorldHeadMatrix)
        {
            Debug.Assert(Sync.IsServer);
            if (!Sync.IsServer)
            {
                return;
            }

            StartManipulationMsg msg = new StartManipulationMsg();

            msg.EntityId             = m_entityId;
            msg.ToolState            = state;
            msg.OtherEntity          = otherEntity.EntityId;
            msg.HitPosition          = hitPosition;
            msg.OwnerWorldHeadMatrix = ownerWorldHeadMatrix;

            MyManipulationTool manipulationTool;

            if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool))
            {
                bool manipulationStarted = manipulationTool.StartManipulation(state, otherEntity, hitPosition, ref ownerWorldHeadMatrix);
                if (manipulationStarted && manipulationTool.IsHoldingItem)
                {
                    MySession.Static.SyncLayer.SendMessageToAll(ref msg);
                }
            }
        }
 static void StartManipulationCallback(ref StartManipulationMsg msg, MyNetworkClient sender)
 {
     MyManipulationTool manipulationTool;
     MyEntity otherEntity;
     if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool) && MyEntities.TryGetEntityById(msg.OtherEntity, out otherEntity))
     {
         manipulationTool.StartManipulation(msg.ToolState, otherEntity, msg.HitPosition, ref msg.OwnerWorldHeadMatrix, true);
     }
 }
        static void StartManipulationCallback(ref StartManipulationMsg msg, MyNetworkClient sender)
        {
            MyManipulationTool manipulationTool;
            MyEntity           otherEntity;

            if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool) && MyEntities.TryGetEntityById(msg.OtherEntity, out otherEntity))
            {
                manipulationTool.StartManipulation(msg.ToolState, otherEntity, msg.HitPosition, ref msg.OwnerWorldHeadMatrix);
            }
        }
        public void StartManipulation(MyManipulationTool.MyState state, MyEntity otherEntity, Vector3D hitPosition, ref MatrixD ownerWorldHeadMatrix)
        {
            StartManipulationMsg msg = new StartManipulationMsg();
            msg.EntityId = m_entityId;
            msg.ToolState = state;
            msg.OtherEntity = otherEntity.EntityId;
            msg.HitPosition = hitPosition;
            msg.OwnerWorldHeadMatrix = ownerWorldHeadMatrix;

            MySession.Static.SyncLayer.SendMessageToAllAndSelf(ref msg);
        }
        public void StartManipulation(MyManipulationTool.MyState state, MyEntity otherEntity, Vector3D hitPosition, ref MatrixD ownerWorldHeadMatrix)
        {
            StartManipulationMsg msg = new StartManipulationMsg();

            msg.EntityId             = m_entityId;
            msg.ToolState            = state;
            msg.OtherEntity          = otherEntity.EntityId;
            msg.HitPosition          = hitPosition;
            msg.OwnerWorldHeadMatrix = ownerWorldHeadMatrix;

            MySession.Static.SyncLayer.SendMessageToAllAndSelf(ref msg);
        }
 static void StartManipulationCallback(ref StartManipulationMsg msg, MyNetworkClient sender)
 {
     MyManipulationTool manipulationTool;
     MyEntity otherEntity;
     if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool) && MyEntities.TryGetEntityById(msg.OtherEntity, out otherEntity))
     {
         manipulationTool.StartManipulation(msg.ToolState, otherEntity, msg.HitPosition, ref msg.OwnerWorldHeadMatrix, true);
         if (Sync.IsServer)
         {
             Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
         }
     }
 }
Exemple #7
0
        static void StartManipulationCallback(ref StartManipulationMsg msg, MyNetworkClient sender)
        {
            MyManipulationTool manipulationTool;
            MyEntity           otherEntity;

            if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool) && MyEntities.TryGetEntityById(msg.OtherEntity, out otherEntity))
            {
                manipulationTool.StartManipulation(msg.ToolState, otherEntity, msg.HitPosition, ref msg.OwnerWorldHeadMatrix, true);
                if (Sync.IsServer)
                {
                    Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
                }
            }
        }
        public void StartManipulation(MyManipulationTool.MyState state, MyEntity otherEntity, Vector3D hitPosition, ref MatrixD ownerWorldHeadMatrix)
        {
            StartManipulationMsg msg = new StartManipulationMsg();
            msg.EntityId = m_entityId;
            msg.ToolState = state;
            msg.OtherEntity = otherEntity.EntityId;
            msg.HitPosition = hitPosition;
            msg.OwnerWorldHeadMatrix = ownerWorldHeadMatrix;

            MyManipulationTool manipulationTool;
            if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool))
            {
                manipulationTool.StartManipulation(state, otherEntity, hitPosition, ref ownerWorldHeadMatrix);
                if (!Sync.IsServer && manipulationTool.IsHoldingItem)
                    MySession.Static.SyncLayer.SendMessageToServer(ref msg);
            }
        }