private BlackjackResponse send(BlackjackRequest request) { // If the client is configured for single player mode, // just call the enginer directly. if (true == Config.SinglePlayerMode) { return(_singlePlayerEngine.Process(request)); } GameEngineProxy proxy = new GameEngineProxy(); try { proxy.Open(); return(proxy.Process(request)); } finally { if (proxy != null && proxy.State == CommunicationState.Opened) { proxy.Close(); } } }
private string toString(BlackjackRequest request) { try { return(request.ToString()); } catch (Exception exception) { return(exception.Message); } }
/// <summary> /// Processes the incoming blackjack request. /// </summary> /// <param name="request"></param> /// <returns></returns> public BlackjackResponse Process(BlackjackRequest request) { BlackjackResponse response = null; try { response = _engine.Process(request); } catch (Exception exception) { response = new BlackjackResponse( request.Table, BlackjackResult.Failure, exception.Message); LogHelper.Instance().Write( "Error processing request: " + toString(request), LogEntrySeverityEnum.Error, exception); } return(response); }
public BlackjackResponse Process(BlackjackRequest request) { return(Channel.Process(request)); }