void OnUpdateFlags(ref MyEventFlags msg)
        {
            LogDevelop("ON FLAGS");

            MyEntity entity;
            if (MyEntities.TryGetEntityById(msg.EntityId.ToEntityId(), out entity))
            {
                var old = entity.IsDummy;
                entity.IsDummy = true;
                ProcessFlag(entity, msg.Flag, msg.Param);
                entity.IsDummy = old;
            }

            if (IsHost)
            {
                Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered, 0);
            }
        }
        public void UpdateFlags(MyEntity entity, MyFlagsEnum flag, bool param = false)
        {
            Debug.Assert(entity.EntityId.HasValue, "Entity ID must have value!");
            LogDevelop("UPDATE FLAGS");

            if (!entity.EntityId.HasValue) return; // Nothing to report

            var msg = new MyEventFlags();
            msg.Flag = flag;
            msg.EntityId = entity.EntityId.Value.NumericValue;
            msg.Param = param;

            if (IsHost)
            {
                Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered, 0);
            }
            else
            {
                Peers.SendHost(ref msg);
            }
        }