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); }
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); }