internal void SetCurrentPosition(float m_currentPos)
        {
            var msg = new CurrentPositionMsg();

            msg.EntityId        = Entity.EntityId;
            msg.CurrentPosition = m_currentPos;

            Sync.Layer.SendMessageToAll <CurrentPositionMsg>(ref msg);
        }
        static void OnSetCurrentPosition(MySyncPistonBase sync, ref CurrentPositionMsg msg, MyNetworkClient sender)
        {
            var grid = sync.Entity.CubeGrid;

            if (grid.Physics == null || grid.MarkedForClose || sync.Entity.MarkedForClose)
            {
                return;
            }
            sync.SyncPosition(msg.CurrentPosition);
        }
Esempio n. 3
0
        static void OnSetCurrentPosition(MySyncPistonBase sync, ref CurrentPositionMsg msg, MyNetworkClient sender)
        {
            var grid = sync.Entity.CubeGrid;

            if (grid.Physics == null || grid.MarkedForClose || sync.Entity.MarkedForClose)
            {
                return;
            }
            sync.SyncPosition(msg.CurrentPosition);

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }
        }
Esempio n. 4
0
 static void OnSetCurrentPosition(MySyncPistonBase sync, ref CurrentPositionMsg msg, MyNetworkClient sender)
 {
     var grid = sync.Entity.CubeGrid;
     if (grid.Physics == null || grid.MarkedForClose || sync.Entity.MarkedForClose)
         return;
     sync.SyncPosition(msg.CurrentPosition);
 }
Esempio n. 5
0
        internal void SetCurrentPosition(float m_currentPos)
        {
            var msg = new CurrentPositionMsg();
            msg.EntityId = Entity.EntityId;
            msg.CurrentPosition = m_currentPos;

            Sync.Layer.SendMessageToAll<CurrentPositionMsg>(ref msg);
        }
Esempio n. 6
0
        static void OnSetCurrentPosition(MySyncPistonBase sync, ref CurrentPositionMsg msg, MyNetworkClient sender)
        {
            var grid = sync.Entity.CubeGrid;
            if (grid.Physics == null || grid.MarkedForClose || sync.Entity.MarkedForClose)
                return;
            sync.SyncPosition(msg.CurrentPosition);

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }
        }