static void ChangePermSuccess(ref ChangePermMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            MyLaserAntenna la = (entity as MyLaserAntenna);

            if (la == null)
            {
                return;
            }
            la.DoSetIsPerm(msg.IsPerm != 0);
        }
 public void ChangePerm(bool isPerm)
 {
     if (!Sync.MultiplayerActive)
     {
         m_Parent.DoSetIsPerm(isPerm);
     }
     else
     {
         var msg = new ChangePermMsg();
         msg.EntityId = m_Parent.EntityId;
         msg.IsPerm   = (byte)(isPerm?1:0);
         Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
     }
 }
        static void ChangePermRequest(ref ChangePermMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            MyLaserAntenna la = (entity as MyLaserAntenna);

            if (la == null)
            {
                return;
            }
            if (la.DoSetIsPerm(msg.IsPerm != 0))
            {
                Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
            }
        }