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; } }
/// <summary> /// Create GIM GameInfo Freeform entity from Monitor GIM GameInfo Taget /// </summary> /// <param name="monTgtMsg"></param> /// <returns></returns> private FFMsg_H2G Create_H2G_GIM_GameInfo_Entity(MonitorEntity_MsgTgt monEntity) { try { MonTgt_H2G_GIM_GameIDInfo monTgtMsg = monEntity as MonTgt_H2G_GIM_GameIDInfo; if (monTgtMsg == null) { return(null); } FFMsg_H2G ffMsg = new FFMsg_H2G(); FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM(); FFTgt_H2G_GIM_GameIDInfo ffTgtMsg = new FFTgt_H2G_GIM_GameIDInfo() { SourceAddress = monTgtMsg.SourceAddress, AssetNumberInt = monTgtMsg.AssetNumberInt, PokerGamePrefix = monTgtMsg.PokerGamePrefix }; ffTgtGIMMSg.AddTarget(ffTgtMsg); ffMsg.AddTarget(ffTgtGIMMSg); return(ffMsg); } catch (Exception ex) { ExceptionManager.Publish(ex); return(null); } }
/// <summary> /// Create GIM AuxNetworkEnableDisable Freeform entity from Monitor GIM AuxNetworkEnableDisable Taget /// </summary> /// <param name="monTgtMsg"></param> /// <returns></returns> private FFMsg_H2G Create_H2G_GIM_AuxNetworkEnableDisable(MonitorEntity_MsgTgt monEntity) { try { MonTgt_H2G_GIM_AuxNetworkEnableDisable monTgtMsg = monEntity as MonTgt_H2G_GIM_AuxNetworkEnableDisable; if (monTgtMsg == null) { return(null); } FFMsg_H2G ffMsg = new FFMsg_H2G(); FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM(); FFTgt_H2G_GIM_AuxNetworkEnableDisable ffTgtMsg = new FFTgt_H2G_GIM_AuxNetworkEnableDisable() { EnableDisable = monTgtMsg.EnableDisable, Display = monTgtMsg.Display }; ffTgtGIMMSg.AddTarget(ffTgtMsg); ffMsg.AddTarget(ffTgtGIMMSg); return(ffMsg); } catch (Exception ex) { ExceptionManager.Publish(ex); return(null); } }
/// <summary> /// Create GIM GameIdRequest Freeform entity from Monitor GIM GameIdRequest Target /// </summary> /// <param name="monEntity"></param> /// <returns></returns> private FFMsg_H2G Create_H2G_GIM_GameIdRequest(MonitorEntity_MsgTgt monEntity) { try { MonTgt_H2G_GIM_GameIDRequest monTgtMsg = monEntity as MonTgt_H2G_GIM_GameIDRequest; if (monTgtMsg == null) { return(null); } FFMsg_H2G ffMsg = new FFMsg_H2G(); FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM(); FFTgt_H2G_GIM_GameIDRequest ffTgtMsg = new FFTgt_H2G_GIM_GameIDRequest() { }; ffTgtGIMMSg.AddTarget(ffTgtMsg); ffMsg.AddTarget(ffTgtGIMMSg); return(ffMsg); } catch (Exception ex) { ExceptionManager.Publish(ex); return(null); } }
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 OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { int slotID = context.G2HMessage.InstallationNo; context.H2GTargets.Add(new MonTgt_H2G_GVA_TSSlotID_Response() { SlotID = slotID, }); return true; }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { int ticketNumber = Math.Max(1, ExCommsDataContext.Current.GetLastTicketNumber(context.G2HMessage.InstallationNo)); context.H2GTargets.Add(new MonTgt_H2G_GVA_TN_Response() { TicketNumber = ticketNumber, }); return true; }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { short expiryDays = (short)Math.Max(1, this.GetExpireDays()); DateTime expiryDate = DateTime.Now.AddDays(expiryDays); context.H2GTargets.Add(new MonTgt_H2G_GVA_TED_Response() { Date = expiryDate, ExipreDays = expiryDays, }); return true; }
public static MonitorEntity_MsgTgt GetMessage(int faultType, int faultSource) { MonitorEntity_MsgTgt bmcMessage = null; KeyValuePair <int, int> pair = new KeyValuePair <int, int>(faultType, faultSource); if (_monEntitymsg.ContainsKey(pair)) { bmcMessage = _monEntitymsg[pair]() as MonitorEntity_MsgTgt; } return(bmcMessage); }
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; }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { MonTgt_G2H_Ticket_Void tgtSrc = target as MonTgt_G2H_Ticket_Void; int result = TicketPrintCancel(context.G2HMessage.InstallationNo, tgtSrc.Barcode); MonTgt_H2G_AckNack tgtDest = new MonTgt_H2G_AckNack() { Nack = (result == 0), }; context.H2GTargets.Add(tgtDest); return true; }
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); }
/// <summary> /// Converts Freeform entity message to Moitor entity message /// </summary> /// <param name="request"></param> /// <returns></returns> public MonMsg_G2H CreateEntity(FFMsg_G2H request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "CreateEntity")) { MonMsg_G2H result = null; try { result = _monMsgParserG2H.CreateEntity(null, request) as MonMsg_G2H; if (result == null) { Log.Info("Unable to create the monitor message"); return(null); } Stack <IFreeformEntity> st = new Stack <IFreeformEntity>(); request.CopyTo(st); // push all the grandchildren into stack and process again while (st.Count != 0) { IFreeformEntity child = st.Pop() as IFreeformEntity; if (child.IsLeafNode) { continue; } MonitorEntity_MsgTgt target = this.CreateTargetEntity(child as IFreeformEntity_MsgTgt); if (target != null) { result.AddTarget(target); } if (target is MonTgt_G2H_Status_CardBase) { result.CardNumber = (target as MonTgt_G2H_Status_CardBase).CardNumber; } child.CopyTo(st); } } catch (Exception ex) { method.Exception(ex); } return(result); } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod("MonitorHandler_CompListChangedXC", "ProcessG2HMessageInternal")) { try { ExCommsDataContext.Current.ResetCompVerificationRequestStatus(context.G2HMessage.InstallationNo, ""); } catch (Exception ex) { ExceptionManager.Publish(ex); } return true; } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { MonTgt_G2H_Ticket_Printed_Request tgtSrc = target as MonTgt_G2H_Ticket_Printed_Request; bool result = ExCommsDataContext.Current.CreateTicketCompleteMC300( context.G2HMessage.InstallationNo, tgtSrc.BarCode, (int)tgtSrc.Amount, context.G2HMessage.FaultDate, tgtSrc.SequenceNo, tgtSrc.Type.GetGmuIdInt8(), DateTime.Now); context.H2GTargets.Add(new MonTgt_H2G_Ticket_Printed_Response() { Status = (result ? FF_AppId_ResponseStatus_Types.Success : FF_AppId_ResponseStatus_Types.Fail), }); return true; }
/// <summary> /// Converts Freeform entity message to Moitor entity message /// </summary> /// <param name="request"></param> /// <returns></returns> public MonitorEntity_MsgTgt CreateTargetEntity(IMonitorEntity parent, IFreeformEntity_MsgTgt request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "CreateTargetEntity")) { MonitorEntity_MsgTgt result = null; try { IFreeformEntity child = request; if (child.IsLeafNode) { return(null); } string key = child.GetType().FullName; if (!child.EntityKey.IsEmpty()) { key += "_" + child.EntityKey; } if (_tgtParserMappingsByTypeG2H.ContainsKey(key)) { IMonTgtParser parser = _tgtParserMappingsByTypeG2H[key]; MonTgtParserMappingG2HAttribute mappingAttribute = parser.MappingAttributeG2H; result = parser.CreateEntity(parent, child) as MonitorEntity_MsgTgt; if (result != null) { result.FaultSource = mappingAttribute.FaultSource; if (mappingAttribute.FaultType != -1) { result.FaultType = mappingAttribute.FaultType; } result.ExtraAttribute = mappingAttribute; } } } catch (Exception ex) { method.Exception(ex); } return(result); } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { Log.Info("Started Abandoned Card"); ForceMeterRead(context, target); MonMsg_G2H request = context.G2HMessage; CurrentEPIMsgProcessor.DeleteEPIMessage(request.InstallationNo); if (HandlerHelper.Current.IsGamePlayInfoRequiredForSession) { Log.Info("Close GamePlay Session For CardedPlay" + request.InstallationNo.ToString()); ExCommsDataContext.Current.CloseUserSessionForCardedGamePlay(request.InstallationNo); } if (!CurrentEPIManager.EPIProcessExists(request.InstallationNo)) { Log.Info("Abandoned card..."); return false; } return SDTMessages.Instance.ProcessPlayerCardOut(request, target as MonTgt_G2H_Status_PlayerCardOut); }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { MonMsg_G2H request = context.G2HMessage; Log.Info("Player Card In Started for : " + request.CardNumber); // remove the existing card in CurrentEPIManager.RemoveTimeoutsIfExists(request.InstallationNo); // delete the epi message CurrentEPIMsgProcessor.DeleteEPIMessage(request.InstallationNo); // process the card in bool result = SDTMessages.Instance.ProcessPlayerCardIn(request, target as MonTgt_G2H_Status_PlayerCardIn); // open session for carded play if (_configStore.GamePlayInfoRequiredForSession) { Log.InfoV("Open GamePlay Session For CardedPlay {0:D}", request.InstallationNo); CurrentDataContext.OpenUserSessionForCardedGamePlay(request.InstallationNo); } return result; }
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; try { DateTime faultDate = request.FaultDate; ExCommsDataContext.Current.CreateTickeException_Handpay(request.InstallationNo, 0, request.BarPositionNo, true, "", faultDate); ExCommsDataContext.Current.UpdateFloorFinancialSession(request.InstallationNo, "HP", ""); ExCommsDataContext.Current.UpdateFloorFinancialSession(request.InstallationNo, "INIT", ""); this.ForceMeterRead(context, target); } catch (Exception ex) { method.Exception(ex); } return result; } }
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); }
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; }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnExecuteInternal")) { MonMsg_G2H msgSrc = context.G2HMessage; MonTgt_G2H_Ticket_Redemption_Request tgtSrc = target as MonTgt_G2H_Ticket_Redemption_Request; ICallWebService ticketService = CallWebServiceFactory.Current; try { long ticketAmount = 0; long ticketType = 0; string barcode = tgtSrc.Barcode; string stockNo = msgSrc.Asset; string playerCardNo = msgSrc.CardNumber; string siteCode = msgSrc.SiteCode; string ticketSiteCode = barcode.Substring(0, 4); method.InfoV("TICKET_REDEEM_START: Local Site Code : {0}, Ticket Site Code : {1}", siteCode, ticketSiteCode); // is TIS printed ticket if (ticketService.IsTISPrintedTicketPrefix(barcode)) { method.InfoV("TICKET_REDEEM_START (TIS): TIS Printed Ticket ({0})", barcode); short tisTicketType = 0; short tisRetCode = 0; if (ticketService.TisTicketRedeemStart(barcode, stockNo, playerCardNo, out ticketAmount, out tisTicketType, out tisRetCode) != 0) { /*Rejecting the Ticket*/ method.InfoV("TICKET_REDEEM_START (TIS): Error while redeeming amount for Barcode : {0}", barcode); ticketAmount = 0; ticketType = 0; } else { method.InfoV("TICKET_REDEEM_START (TIS): Success while redeeming amount for Barcode : {0}", barcode); ticketType = tisTicketType; } } // cross ticketing enabled and ticket site code not matched else if (_configStore.IsCrossTicketingEnabled && !siteCode.IgnoreCaseCompare(ticketSiteCode))//CrossTickeing From Setting { method.InfoV("TICKET_REDEEM_START (CROSS SITE): Ticket Printed in Site {1} ({0})", barcode, ticketSiteCode); long siteTicketType = 0; long siteRetCode = 0; if (ticketService.TicketRedeemStart(barcode, stockNo, out ticketAmount, out siteTicketType, out siteRetCode) != 0) { /*Rejecting the Ticket*/ method.InfoV("TICKET_REDEEM_START (CROSS SITE): Error while redeeming amount for Barcode : {0}", barcode); ticketAmount = 0; ticketType = 0; } else { method.InfoV("TICKET_REDEEM_START (TIS): Success while redeeming amount for Barcode : {0}", barcode); ticketType = siteTicketType; } } // ticket printed in local site else { int? localAmount = 0; int? localRetCode = 0; int? localTicketType = 0; string barCodeTemp = barcode; if (!ExCommsDataContext.Current.RedeemTicketStart(ref barCodeTemp, stockNo, siteCode, 0, playerCardNo, ref localAmount, ref localRetCode, ref localTicketType)) { /*Rejecting the Ticket*/ method.InfoV("TICKET_REDEEM_START (LOCAL SITE): Error while redeeming amount for Barcode : {0}, Error Code : {1:D}", barcode, localRetCode.SafeValue()); ticketAmount = 0; ticketType = 0; } else { method.InfoV("TICKET_REDEEM_START (LOCAL): Success while redeeming amount for Barcode : {0}", barcode); ticketAmount = localAmount.SafeValue(); ticketType = localTicketType.SafeValue(); } } MonTgt_H2G_Ticket_Redemption_Response response = new MonTgt_H2G_Ticket_Redemption_Response() { Amount = ticketAmount, Barcode = barcode, Type = (FF_AppId_TicketTypes)ticketType }; context.H2GTargets.Add(response); } catch (Exception ex) { method.Exception(ex); } return true; } }
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; } }
protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { return base.OnExecuteInternal(context, target); }
protected override void OnCreateTicketException(MonMsg_G2H request, MonitorEntity_MsgTgt target) { InstallationDetailsForMSMQ dbData = request.Extra as InstallationDetailsForMSMQ; ExCommsDataContext.Current.CreateTickeException_Handpay(request.InstallationNo, 0, dbData.Bar_Pos_Name, true, "MYSTERY", request.FaultDate); }
public bool Execute(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "Execute")) { bool result = default(bool); string key = (target != null ? target.TypeFaultSourceTypeKey : string.Empty); try { if (!key.IsEmpty()) method.Info("!&! HANDLER STARTED FOR : " + key); // force meters add this.OnForceMeterRead(context, target); // execute the target result = this.OnExecuteInternal(context, target); } catch (Exception ex) { method.Exception(ex); } finally { if (!key.IsEmpty()) method.Info("!&! HANDLER COMPLETED FOR : " + key); } return result; } }
internal void SetTicketResponseMeters(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { this.ForceMeterReadAndGetLatest(context, target, (i, h, j, v) => { ExCommsDataContext.Current.UpdateTicketExceptionResponseMeters(i, h, j, v); }); }
internal void ForceMeterReadAndGetLatest(MonitorExecutionContext context, MonitorEntity_MsgTgt target, Action<int, int, int, int> action) { int installationNo = context.G2HMessage.InstallationNo; EPIMeterValueTypes valueType = EPIMeterValueTypes.Start; using (EPIMeterValueDictionary meterValues = this.ForceMeterReadAndGetLatest(context, target)) { action(installationNo, (int)meterValues[EPIMeterTypes.Handpay][valueType], (int)meterValues[EPIMeterTypes.Jackpot][valueType], (int)meterValues[EPIMeterTypes.VouchersOut][valueType]); } }
internal EPIMeterValueDictionary ForceMeterReadAndGetLatest(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { this.ForceMeterRead(context, target); EPIMeterValueDictionary result = new EPIMeterValueDictionary(); result.GetLatestMeters(context.G2HMessage.InstallationNo, EPIMeterValueTypes.Start); return result; }
public virtual void ForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { Log.Info("ForceMeterRead : " + target.TypeFaultSourceTypeKey); this.ProcessMeters(context, target); }
protected bool ProcessMeters(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { return this.MeterHandler.Execute(context, target); }
protected virtual void OnCreateTicketException(MonMsg_G2H request, MonitorEntity_MsgTgt target) { }
public virtual void ForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { }
public virtual void AddTarget(MonitorEntity_MsgTgt target) { _targets.Add(target); }
protected virtual void OnForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { }
protected override void OnForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { string key = target.FaultSourceTypeKey; if (_forceMeterRead || _configStore.ForceMeterReads.ContainsKey(key)) { this.ForceMeterRead(context, target); } }
protected virtual bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target) { return true; }