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);
            }
        }
Example #2
0
        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);
        }
Example #3
0
        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));
        }
 internal void SetTicketResponseMeters(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     this.ForceMeterReadAndGetLatest(context, target, (i, h, j, v) =>
     {
         ExCommsDataContext.Current.UpdateTicketExceptionResponseMeters(i, h, j, v);
     });
 }
        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)
        {
            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);
            }
        }
 protected virtual bool OnProcessMessageG2HExternal_GMU(FFTgtExecutionContext context, IFreeformEntity_MsgTgt target)
 {
     MonitorEntity_MsgTgt monitorTarget = MonitorEntityFactory.CreateTargetEntity(target);
     if (monitorTarget != null)
     {
         context.MonitorTargets.Value.Add(monitorTarget);
     }
     return true;
 }
Example #8
0
        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);
        }
Example #9
0
        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 void OnForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
        {
            string key = target.FaultSourceTypeKey;

            if (_forceMeterRead ||
                _configStore.ForceMeterReads.ContainsKey(key))
            {
                this.ForceMeterRead(context, target);
            }
        }
Example #11
0
        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);
        }
Example #12
0
        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);
        }
        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]);
            }
        }
Example #15
0
        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);
            }
        }
Example #16
0
        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);
        }
Example #17
0
        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));
        }
Example #18
0
        public int EnableDisableAFT(int installatioNo, bool enable)
        {
            MonMsg_H2G message = new MonMsg_H2G()
            {
                InstallationNo = installatioNo,
            };
            MonitorEntity_MsgTgt target = null;

            if (enable)
            {
                target = new MonTgt_H2G_EFT_SystemEnable();
            }
            else
            {
                target = new MonTgt_H2G_EFT_SystemDisable();
            }
            message.Targets.Add(target);
            return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(message) ? 0 : -1);
        }
Example #19
0
        public void SendCommand(int installationNo, MonitorEntity_MsgTgt target)
        {
            try
            {
                target.InstallationNo = installationNo;
                MonMsg_H2G msg = new MonMsg_H2G();
                msg.AddTarget(target);

                MonitorExecutionContext ctx = new MonitorExecutionContext()
                {
                    H2GMessage = msg
                };

                MonitorHandlerFactory.Current.Execute(ctx);
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }
        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);
            }
        }
Example #21
0
        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);
        }
Example #22
0
        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)
        {
            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);
            }
        }
        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);
        }
 protected virtual void OnForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
 }
 protected bool ProcessMeters(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     return(this.MeterHandler.Execute(context, target));
 }
 protected virtual bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     return(true);
 }
Example #28
0
 protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     return(base.OnExecuteInternal(context, target));
 }
 public virtual void ForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
 }
 public virtual void ForceMeterRead(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     Log.Info("ForceMeterRead : " + target.TypeFaultSourceTypeKey);
     this.ProcessMeters(context, target);
 }