Example #1
0
        static void RotateManipulatedEntityCallback(ref RotateManipulatedEntityMsg msg, MyNetworkClient sender)
        {
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }

            MyManipulationTool manipulationTool;

            if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool))
            {
                manipulationTool.RotateManipulatedEntity(ref msg.Rotation);
            }
        }
Example #2
0
        public void RotateManipulatedEntity(Quaternion rotation)
        {
            RotateManipulatedEntityMsg msg = new RotateManipulatedEntityMsg();

            msg.EntityId = m_entityId;
            msg.Rotation = rotation;

            if (Sync.IsServer)
            {
                MySession.Static.SyncLayer.SendMessageToAll(ref msg);
            }
            else
            {
                MySession.Static.SyncLayer.SendMessageToServer(ref msg);
            }
        }