protected override bool ProcessG2HMessageInternal(MonMsg_G2H request) { if (request == null) { return(false); } using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessG2HMessageInternal")) { bool result = false; string key = request.FaultSourceTypeKey; try { method.Info("!&! HANDLER STARTED FOR : " + key); result = _handlerMappings.ContainsKey(key) ? _handlerMappings[key].ProcessG2HMessage(request) : _faultHandler.ProcessG2HMessage(request); } catch (Exception ex) { method.Exception(ex); } finally { method.Info("!&! HANDLER COMPLETED FOR : " + key); } return(result); } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { MonMsg_G2H request = context.G2HMessage; MonTgt_G2H_Status_DescriptionBase tgtSrc = target as MonTgt_G2H_Status_DescriptionBase; try { DateTime faultDate = request.FaultDate; // add the fault event this.AddFaultEvent(context, target, tgtSrc.Description, false); // create the ticket exception this.OnCreateTicketException(request, target); // add the meters this.ForceMeterRead(context, target); } catch (Exception ex) { ExceptionManager.Publish(ex); } return(true); } }
protected override bool ProcessG2HMessageInternal(MonMsg_G2H request) { using (ILogMethod method = Log.LogMethod("MonitorHandler_EPI_23_3", "ProcessG2HMessageInternal")) { try { MonTgt_G2H_EFT_DepositRequest monDepositRequest = request.Targets[0] as MonTgt_G2H_EFT_DepositRequest; if (monDepositRequest == null) { return(false); } //DeleteEPIMessage(request.InstallationNo); if (DoDepositRequest(request, monDepositRequest)) { method.Info("Deposit Request Transfer done"); } else { method.Info("Deposit Request Could not complete your transaction"); } return(true); } catch (Exception ex) { //EPIMsgProcessor.Current.SendEPIMessage(monBalanceResponse); //EPIMsgProcessor.Current.DisplayBallyWelcomeMsg(request.InstallationNo, ); method.Exception(ex); } return(false); } }
protected override bool ProcessG2HMessageInternal(MonMsg_G2H request) { MonTgt_G2H_GameCapping_StartEnd tgt_G2H_GameCapping_Start = request.Targets[0] as MonTgt_G2H_GameCapping_StartEnd; ExCommsDataContext.Current.AlertGameCappingSessionExpires(request.InstallationNo); return(true); }
private bool DoDepositComplete(MonMsg_G2H request, MonTgt_G2H_EFT_DepositComplete monDepositRequest) { InstallationDetailsForMSMQ installationDetails = ExCommsDataContext.Current.GetInstallationDetailsByDatapak(request.InstallationNo); HandlerHelper.Current.SaveSDTRequest(monDepositRequest.CardNumber, request.InstallationNo); Log.Info("TransactionID used in Deposit Request " + installationDetails.TransactionID.ToString()); string asset = HandlerHelper.Current.GetAssetByStockPrefix(request.Asset); DateTime transDate = DateTime.Now; //Authentication - To do DepositRequest depositRequest = new DepositRequest { //AccountType = monDepositRequest.ac, CashableFunds = Convert.ToInt32((monDepositRequest.CashableAmount * 100)), NonCashableFunds = Convert.ToInt32((monDepositRequest.NonCashableAmount * 100)), //Authentication = BarPosition = installationDetails.Bar_Pos_Name, CardNo = monDepositRequest.CardNumber, InstallationNo = request.InstallationNo, SlotIndex = installationDetails.Bar_Pos_Name, SlotNumber = asset, Stand = installationDetails.Bar_Pos_Name, TransactionDate = transDate.ToString("yyyyMMdd").PadLeft(8, '0'), TransactionID = installationDetails.TransactionID.ToString().PadLeft(3, '0').Substring(0, 3), TransactionTime = transDate.ToString("HHmmss").PadLeft(6, '0'), SiteCode = request.SiteCode }; HandlerHelper.PlayerGatewayInstance.DepositComplete(depositRequest, this.DepositCompleteResp); return(true); }
protected override bool ProcessMessageInternal(ILogMethod method, FFMsg_G2H message) { if (message == null) { method.Info("Freeform message (G2H) was null."); return(false); } this.OnModifyMessage(method, message); // convert the monitor message from freeform message MonMsg_G2H monMsg = MonitorEntityFactory.CreateEntity(message); if (monMsg == null) { method.Info("Unable to convert the monitor message from freeform message."); return(false); } // post the monitor message into monitor processor if (!this.MonitorProcessor.ProcessG2HMessage(monMsg)) { method.Info("Unable to post the message to monitor processor."); return(false); } return(true); }
private PCEnrollParamorStatusRequest GetStatusRequestEntity(MonMsg_G2H request, MonTgt_G2H_PC_StatusRequest statusRequest) { string encryptedPin = HandlerHelper.Current.GetEncryptedPIN(Crypto.Crypto.AsciiToHex(statusRequest.PlayerPIN, HandlerHelper.Current.Encode)); string asset = HandlerHelper.Current.GetAssetByStockPrefix(request.Asset); DateTime transDate = DateTime.Now; InstallationDetailsForMSMQ installationDetails = ExCommsDataContext.Current.GetInstallationDetailsByDatapak(request.InstallationNo); Log.Info("Encrypted Pin " + encryptedPin); PCEnrollParamorStatusRequest pgStatusRequest = new PCEnrollParamorStatusRequest() { CardNo = request.CardNumber, CardLength = request.CardNumber.Length, EncryptedPin = encryptedPin, EventDate = transDate.Date.ToString("yyyyMMdd"), EventTime = transDate.Date.ToString("HHmmss"), SlotNo = asset, Stand = installationDetails.Bar_Pos_Name, BarPosition = installationDetails.Bar_Pos_Name, Asset = asset }; return(pgStatusRequest); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { bool status = default(bool); MonMsg_G2H request = context.G2HMessage; try { InstallationDetailsForMSMQ dbData = request.Extra as InstallationDetailsForMSMQ; int installationNo = Convert.ToInt32(request.InstallationNo); System.DateTime dDate = request.FaultDate; if (ExCommsDataContext.Current.CreateDoorEvent(installationNo, target.FaultType, true, dDate)) { status = true; } // modify the floor status.. if (ExCommsDataContext.Current.UpdateFloorStatus(installationNo, dDate, target.FaultType)) { status = true; } } catch (Exception ex) { Log.Exception(ex); } return(status); }
private bool ProcessBalanceRequest(MonMsg_G2H request) { try { ModuleProc PROC = new ModuleProc("EPIHandler", "ProcessBalanceRequest"); MonTgt_G2H_EFT_BalanceRequest balnceRequest = request.Targets[0] as MonTgt_G2H_EFT_BalanceRequest; if (balnceRequest == null) { return(false); } string _pin = Crypto.Crypto.AsciiToHex(balnceRequest.Pin, _handlerInstance.IsASCIIEncoding() ? Encoding.ASCII : ASCIIEncoding.Default); string _encryptedPin = Crypto.Crypto.EncryptHexString(_handlerInstance.EncryptionKey, _pin, _handlerInstance.IsASCIIEncoding() ? Encoding.ASCII : ASCIIEncoding.Default); Log.Info("Encrypted Pin " + _encryptedPin); InstallationDetailsForMSMQ installationDetails = EFT_DataAccess.GetInstance().GetInstallationDetailsByDatapak(request.InstallationNo); return(false); } catch (Exception ex) { Log.Exception(ex); return(false); } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { MonMsg_G2H request = context.G2HMessage; Log.Info("Player Card Out Started for : " + request.CardNumber); // delete the epi message CurrentEPIMsgProcessor.DeleteEPIMessage(request.InstallationNo); // check if the card in exists in the local dictionary if (!this.CheckCardInSession(request, (r) => { CurrentEPIManager.PlayerCardOut(request.InstallationNo, request.CardNumber); })) { return(false); } if (_configStore.GamePlayInfoRequiredForSession) { // close game session for carded play Log.InfoV("Close GamePlay Session For CardedPlay {0:D}", request.InstallationNo); CurrentDataContext.CloseUserSessionForCardedGamePlay(request.InstallationNo); } // process the card in return(SDTMessages.Instance.ProcessPlayerCardOut(request, target as MonTgt_G2H_Status_PlayerCardOut)); }
private PCIntervalRatings GetIntervalRatingEntity(MonMsg_G2H request) { InstallationDetailsForMSMQ installationDetails = ExCommsDataContext.Current.GetInstallationDetailsByDatapak(request.InstallationNo); MeterDeltaForPCSessionResult meterdelta = ExCommsDataContext.Current.GetMeterDeltaForPCSession(request.InstallationNo, request.CardNumber, "IR"); string asset = HandlerHelper.Current.GetAssetByStockPrefix(request.Asset); DateTime endDate = DateTime.Now; PCIntervalRatings pgStatusRequest = new PCIntervalRatings() { CardNo = request.CardNumber, CardLength = request.CardNumber.Length, SlotNo = asset, Stand = installationDetails.Bar_Pos_Name, StartDate = meterdelta.SessionStartDate.GetValueOrDefault().ToString("yyyyMMdd"), StartTime = meterdelta.SessionStartDate.GetValueOrDefault().ToString("HHmmss"), EndDate = endDate.Date.ToString("yyyyMMdd"), EndTime = endDate.ToString("HHmmss"), CoinsBet = Convert.ToInt64(meterdelta.CoinsIn), CoinsWon = Convert.ToInt64(meterdelta.CoinsOut), GamesPlayed = Convert.ToInt64(meterdelta.GamesPlayed), BarPosition = installationDetails.Bar_Pos_Name, Asset = asset, SiteCode = request.SiteCode, RatingBasis = HandlerHelper.Current.PCRatingBasis }; return(pgStatusRequest); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { bool result = default(bool); MonMsg_G2H request = context.G2HMessage; MonTgt_G2H_Status_NovoTicketCreate tgtSrc = target as MonTgt_G2H_Status_NovoTicketCreate; try { InstallationDetailsForMSMQ dbData = request.Extra as InstallationDetailsForMSMQ; int installationNo = request.InstallationNo; method.InfoV("Creating novo ticket for {0:D} Ticket value {1:D} Ticket Number {2:D}", installationNo, tgtSrc.TicketAmount, tgtSrc.TicketNumber); result = ExCommsDataContext.Current.InsertTicket(installationNo, dbData.Machine_No, installationNo, tgtSrc.TicketAmount, tgtSrc.TicketNumber, tgtSrc.PrintDate); } catch (Exception ex) { method.Exception(ex); } return(result); } }
private void TicketReedeemFail(MonTgt_G2H_Ticket_Redemption_Close tgtSrc, MonMsg_G2H msgSrc, ICallWebService ticketService, ref int?voucherID) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "TicketReedeemFail")) { try { long retCode = 0; if (tgtSrc.Status != FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem) { if (_configStore.IsCrossTicketingEnabled) { if ((string.Equals(HandlerHelper.Current.LocalSiteCode, msgSrc.SiteCode)) || ticketService.IsTISPrintedTicketPrefix(tgtSrc.Barcode)) { if (!ExCommsDataContext.Current.RedeemTicketComplete(tgtSrc.Barcode, msgSrc.Asset, ref voucherID, msgSrc.SiteCode, msgSrc.CardNumber)) { Log.Info("TICKET_REDEEM_CLOSE_FAIL (TIS or LOCAL SITE): No proper Ticket Redeemption!!"); } } else { Log.Info("TICKET_REDEEM_CLOSE_FAIL (CROSS SITE): Foreign Ticket Rdm Cmpt cancel"); if (msgSrc.InstallationNo == 0 || string.IsNullOrEmpty(msgSrc.Asset)) { Log.Info("TICKET_REDEEM_CLOSE_FAIL (CROSS SITE): Installation detail in " + msgSrc.InstallationNo.ToString() + " lID DeviceID " + msgSrc.Asset); if (ticketService.TicketRedeemCancel(tgtSrc.Barcode, msgSrc.Asset, 0, out retCode) != 0) { Log.Info("TICKET_REDEEM_CLOSE_FAIL (CROSS SITE): Problem while sending the Ticket Redeem complete msg to DB!"); } } else { Log.Info("TICKET_REDEEM_CLOSE_FAIL (CROSS SITE): Stored Installation detail in " + msgSrc.InstallationNo.ToString() + " lID DeviceID " + msgSrc.Asset); if (ticketService.TicketRedeemCancel(tgtSrc.Barcode, msgSrc.Asset, 0, out retCode) != 0) { Log.Info("TICKET_REDEEM_CLOSE_FAIL (CROSS SITE): Problem while sending the Ticket Redeem complete msg to DB!"); } } } } else { if (!ExCommsDataContext.Current.RedeemTicketComplete(tgtSrc.Barcode, msgSrc.Asset, ref voucherID, msgSrc.SiteCode, msgSrc.CardNumber)) { Log.Info("TICKET_REDEEM_CLOSE_FAIL (LOCAL SITE): No proper Ticket Redeemption!!"); } } } } catch (Exception ex) { method.Exception(ex); } } }
void OnProcessG2HMessageFromWorker(MonMsg_G2H request) { if (!_isMonProcessorStandalone) { ((IExMonServer4MonProcessorCallback)_monitorServer).ProcessG2HMessage(request); } else { // monitor server processor mappings should be coming here } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { InstallationDetailsForMSMQ dbData = null; string sText = null; string CardID = null; DateTime dDate; int installationNo = default(int); bool status = default(bool); MonMsg_G2H request = context.G2HMessage; try { long lFaultSource = 0; long lFaultType = 0; dbData = request.Extra as InstallationDetailsForMSMQ; installationNo = request.InstallationNo; dDate = default(System.DateTime); dDate = request.FaultDate; sText = ""; if (request.FaultSource == 21 & request.FaultType == 21) { lFaultSource = 200; lFaultType = request.FaultType; } else { lFaultSource = request.FaultSource; lFaultType = request.FaultType; } try { CardID = dbData.EmployeeCardNumber; } catch (Exception ex) { CardID = string.Empty; } if (ExCommsDataContext.Current.CreateFaultEvent(installationNo, (int)lFaultSource, (int)lFaultType, sText, true, dDate, CardID)) { status = true; } } catch (Exception ex) { status = false; } return(status); }
public bool ProcessG2HMessage(MonMsg_G2H request) { try { return(exMonProxy.ProcessG2HMessage(request)); } catch (Exception ex) { ExceptionManager.Publish(ex); return(false); } }
private void FillRequestValues(MonMsg_G2H request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "FillRequestValues")) { try { InstallationDetailsForMSMQ data = ModuleHelper.Current.GetInstallationFromCache(request.FaultSourceTypeKey, request.InstallationNo); request.Extra = data; request.SiteCode = data.SiteCode; request.Asset = data.Stock_No; } catch (Exception ex) { method.Exception(ex); } } }
protected override bool ProcessG2HMessageInternal(MonMsg_G2H request) { using (ILogMethod method = Log.LogMethod("MonitorHandler_PC_33_12", "ProcessG2HMessageInternal")) { try { PCIntervalRatings pgIntervalRating = GetIntervalRatingEntity(request); HandlerHelper.PlayerGatewayInstance.PCIntervalRatingUpdates(pgIntervalRating); return(true); } catch (Exception ex) { method.Exception(ex); } return(false); } }
/// <summary> /// Process GIM G2H Message /// </summary> /// <param name="request"></param> /// <returns></returns> protected override bool ProcessG2HMessageInternal(MonMsg_G2H request) { try { if (_gimMsg_G2H.ContainsKey(request.FaultType)) { return(_gimMsg_G2H[request.FaultType](request)); } return(false); } catch (Exception ex) { Log.Exception(ex); return(false); } }
private PCEnrollmentRequest GetPCPlayerEnrollmentRequestEntity(MonMsg_G2H request, MonTgt_G2H_PC_PlayerEnrollmentRequest playerEnrollmentReq) { string asset = HandlerHelper.Current.GetAssetByStockPrefix(request.Asset); DateTime transDate = DateTime.Now; InstallationDetailsForMSMQ installationDetails = ExCommsDataContext.Current.GetInstallationDetailsByDatapak(request.InstallationNo); PCEnrollmentRequest pgEnrollParamStatReq = new PCEnrollmentRequest() { CardNo = request.CardNumber, CardLength = request.CardNumber.Length, SlotNo = installationDetails.Bar_Pos_Name, Stand = asset, BarPosition = installationDetails.Bar_Pos_Name, EventDate = transDate.Date.ToString("yyyyMMdd"), EventTime = transDate.Date.ToString("HHmmss"), IsDayTimeBasis = playerEnrollmentReq.IsDayTimeBasis, DayTargetTime = playerEnrollmentReq.DayDefaultTime.ToString(), IsWeekTimeBasis = playerEnrollmentReq.IsWeekTimeBasis, WeekTargetTime = playerEnrollmentReq.WeekTargetTime.ToString(), IsMonthTimeBasis = playerEnrollmentReq.IsMonthTimeBasis, MonthTargetTime = playerEnrollmentReq.MonthTargetTime.ToString(), IsDayLossBasis = playerEnrollmentReq.IsDayLossBasis, DayTargetLoss = Convert.ToInt32((playerEnrollmentReq.DayTargetLossValue * 100)), IsWeekLossBasis = playerEnrollmentReq.IsWeekLossBasis, WeekTargetLoss = Convert.ToInt32((playerEnrollmentReq.WeekTargetLossValue * 100)), IsMonthLossBasis = playerEnrollmentReq.IsMonthLossBasis, MonthTargetLoss = Convert.ToInt32((playerEnrollmentReq.MonthTargetLossValue * 100)), IsDayWagerBasis = playerEnrollmentReq.IsDayWagerBasis, DayTargetWagers = Convert.ToInt32((playerEnrollmentReq.DayTargetWager * 100)), IsWeekWagerBasis = playerEnrollmentReq.IsWeekWagerBasis, WeekTargetWagers = Convert.ToInt32((playerEnrollmentReq.WeekTargetWager * 100)), IsMonthWagerBasis = playerEnrollmentReq.IsMonthWagerBasis, MonthTargetWagers = Convert.ToInt32((playerEnrollmentReq.MonthTargetWager * 100)) }; return(pgEnrollParamStatReq); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { MonMsg_G2H request = context.G2HMessage; Log.Info("Withdrawwal Request Started for : " + request.CardNumber); // delete the epi message CurrentEPIMsgProcessor.DeleteEPIMessage(request.InstallationNo); // check if the card in exists in the local dictionary if (!this.CheckCardInSession(request, null)) { return(false); } // process the card in return(SDTMessages.Instance.ProcessWithdrawComplete(context.G2HMessage, target as MonTgt_G2H_EFT_WithdrawalComplete)); }
bool IExMonServer4MonProcessorCallback.ProcessG2HMessage(MonMsg_G2H request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessG2HMessage")) { bool result = default(bool); try { result = MonitorHandlerFactory.Current.Execute(new MonitorExecutionContext(request)); } catch (Exception ex) { method.Exception(ex); } return(result); } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, ExComms.Contracts.DTO.Monitor.MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { try { MonMsg_G2H request = context.G2HMessage; string faultDesc = request.FaultType == (int)FaultType_NonPriorityEvent.CommsStopped ? "Polling Failed" : "Polling Resumed"; base.AddFaultEvent(request.InstallationNo, request.FaultSource, request.FaultType, faultDesc, true, request.FaultDate); return(base.OnExecuteInternal(context, target)); } catch (Exception ex) { method.Exception(ex); return(false); } } }
protected bool CheckCardInSession(MonMsg_G2H request, Action <MonMsg_G2H> doWork) { // check if the card in exists in the local dictionary if (!CurrentEPIManager.EPIProcessExists(request.InstallationNo)) { // no card in, ok check in the database if (!CurrentDataContext.IsCardSessionExists(request.InstallationNo, request.CardNumber.ConvertToInt32())) { // still no card in, so exit now if (doWork != null) { doWork(request); } Log.Info("No card in .. Exiting"); return(false); } } return(true); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, ExComms.Contracts.DTO.Monitor.MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { try { MonMsg_G2H request = context.G2HMessage; request.FaultSource = 200; base.AddFaultEvent(request.InstallationNo, request.FaultSource, request.FaultType, string.Empty, true, request.FaultDate); return(base.OnExecuteInternal(context, target)); } catch (Exception ex) { method.Exception(ex); return(false); } } }
public bool ProcessG2HMessage(MonMsg_G2H request) { bool result = false; try { // force meters add //this.ForceMeterRead(request); // processing result = this.ProcessG2HMessageInternal(request); } catch (Exception ex) { Log.Exception(ex); } return(result); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, ExComms.Contracts.DTO.Monitor.MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { bool result = default(bool); try { MonMsg_G2H request = context.G2HMessage; DateTime dDate = request.FaultDate; return(ExCommsDataContext.Current.InsertGeneralEvents(request.InstallationNo, target.FaultType, true, dDate, target.FaultSource)); } catch (Exception ex) { method.Exception(ex); } return(result); } }
protected virtual bool PostMessageToMonitorServer(ILogMethod method, FFMsg_G2H message) { // convert the monitor message from freeform message MonMsg_G2H monMsg = MonitorEntityFactory.CreateEntity(message); if (monMsg == null) { method.Info("Unable to convert the monitor message from freeform message."); return(false); } // post the monitor message into monitor processor if (!this.MonitorProcessor.ProcessG2HMessage(monMsg)) { method.Info("Unable to post the message to monitor processor."); return(false); } return(true); }
public virtual bool ProcessG2HMessage(MonMsg_G2H request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessG2HMessageInWorker")) { bool result = false; try { // find the queue executor by fault source and type IThreadPoolExecutor <MonMsg_G2H> executor = this.GetExecutorG2H(request); executor.QueueWorkerItem(request); result = true; } catch (Exception ex) { method.Exception(ex); } return(result); } }
protected virtual bool AddFaultEvent(MonitorExecutionContext context, MonitorEntity_MsgTgt target, string description, bool polled) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "AddFaultEvent")) { bool result = default(bool); try { MonMsg_G2H request = context.G2HMessage; method.InfoV("FAULT EVENT : Inserting fault event for {0:D}/{1:D}", target.FaultSource, target.FaultType); result = this.AddFaultEvent(request.InstallationNo, target.FaultSource, target.FaultType, description, polled, request.FaultDate); } catch (Exception ex) { method.Exception(ex); } return(result); } }