Ejemplo n.º 1
0
        public void SendPowerDistributorState(MyMultipleEnabledEnum enabledState, long playerId)
        {
            var msg = new PowerProducerStateMsg();
            msg.GridEntityId = Entity.EntityId;
            msg.Enabled = enabledState;
            msg.PlayerId = playerId;

            Sync.Layer.SendMessageToServer(ref msg);
        }
Ejemplo n.º 2
0
        private static void OnPowerProducerStateRequest(MySyncGrid sync, ref PowerProducerStateMsg msg, MyNetworkClient sender)
        {
            var handler = sync.PowerProducerStateChanged;
            if (handler != null) handler(msg.Enabled, msg.PlayerId);

            if (Sync.IsServer)
                Sync.Layer.SendMessageToAll(ref msg);
        }