예제 #1
0
        private void PlayerOrderServiceOnOrdersChanged(object sender, EventArgs eventArgs)
        {
            ServiceClient serviceClient;

            lock (_clientLock)
            {
                if (!_isConnected)
                {
                    return;
                }
                serviceClient = Interlocked.CompareExchange(ref _serviceClient, null, null);
            }
            if (serviceClient == null)
            {
                return;
            }

            try
            {
                var messageOrder = new PlayerOrdersMessage(_playerOrderService.Orders, _playerOrderService.AutoTurn);
                serviceClient.EndTurn(messageOrder);
            }
            catch (Exception e)
            {
                GameLog.Client.General.ErrorFormat("Exception occurred while submitting end-of-turn orders: {0}", e.Message);
                throw;
            }
        }
예제 #2
0
 public void EndTurn(PlayerOrdersMessage orders) //not combat orders, see below sendCombatOrders
 {
     try { Channel.EndTurn(orders); }
     catch (FaultException) {}
 }