Ejemplo n.º 1
0
        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 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);
            }
        }
Ejemplo n.º 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));
        }
        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;
            }
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
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;
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 18
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;
 }
Ejemplo n.º 19
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);
        }
Ejemplo n.º 20
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));
        }
Ejemplo n.º 21
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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 23
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;
        }
Ejemplo n.º 24
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);
            }
        }
        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;
            }
        }
Ejemplo n.º 27
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);
        }
Ejemplo n.º 28
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;
        }
Ejemplo n.º 29
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);
        }
Ejemplo n.º 30
0
        protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
        {
            using (ILogMethod method = Log.LogMethod("MonitorHandler_GIM", "OnExecuteInternal"))
            {
                try
                {
                    MonMsg_G2H msgSrc = context.G2HMessage;
                    MonTgt_G2H_GIM_GameIDInfo tgtSrc = target as MonTgt_G2H_GIM_GameIDInfo;
                    method.Info("GIM (CALL): IP Address : " + msgSrc.IpAddress +
                            ", Asset No : " + tgtSrc.AssetNumber.ToStringSafe() +
                            ", GMU No : " + tgtSrc.GMUNumber.ToStringSafe() +
                            ", Serial No : " + tgtSrc.SerialNumber.ToStringSafe());

                    int? installationNo = 0;
                    int? assetNo = 0;
                    string pokerGamePrefix = string.Empty;

                    if (ExCommsDataContext.Current.InsertGMULogin(tgtSrc, msgSrc.IpAddress,
                        ref installationNo, ref assetNo, ref pokerGamePrefix))
                    {
                        int assetNoInt = assetNo.SafeValue();
                        IPAddress hostIPAddress = null;

                        // get the ip address 
                        if (_configExchange.Honeyframe_Cashmaster_Exchange_EnableDhcp == 1)
                        {
                            hostIPAddress = _configExchange.Honeyframe_Cashmaster_BMCDHCP_ServerIP.ToIPAddress();
                        }
                        else
                        {
                            hostIPAddress = _configExchange.Honeyframe_Cashmaster_Exchange_interface.ToIPAddress();
                        }
                        method.InfoV("GIM (Success): Installation no ({1:D}), Asset No : {2:D}, Game Prefix : {3} for IP : {0}, from Host : {4}",
                            msgSrc.IpAddress, installationNo, assetNoInt,
                            pokerGamePrefix, hostIPAddress.ToString());
                        int installationNo2 = installationNo.SafeValue();

                        if (installationNo2 > 0)
                        {
                            MonMsg_H2G msgDest = new MonMsg_H2G()
                            {
                                InstallationNo = installationNo2,
                                IpAddress = msgSrc.IpAddress,
                            };
                            MonTgt_H2G_GIM_GameIDInfo tgtDest = new MonTgt_H2G_GIM_GameIDInfo();
                            tgtDest.SourceAddress = hostIPAddress;
                            tgtDest.EnableNetworkMessaging = true;
                            if (_configStore.Iview3AssetNum)
                            {
                                tgtDest.AssetNumberInt = assetNoInt;
                                tgtDest.PokerGamePrefix = pokerGamePrefix.ToString();
                            }

                            // update the installation no
                            ExMonitorServerImpl.Current
                                .UpdateCommsServerHostAddress(installationNo2, msgSrc.HostIpAddress)
                                .UpdateInstallatioIpAddress(installationNo2, msgSrc.IpAddress);

                            // add the target and process
                            msgSrc.InstallationNo = installationNo2;
                            msgDest.Targets.Add(tgtDest);
                            context.H2GMessage = msgDest;
                            return true;
                        }
                    }
                    else
                    {
                        method.InfoV("GIM (Failure): Unable to get the installation no for IP : {0}", msgSrc.IpAddress);
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
                return false;
            }
        }
Ejemplo n.º 31
0
 protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     return base.OnExecuteInternal(context, target);
 }
Ejemplo n.º 32
0
        protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
        {
            using (ILogMethod method = Log.LogMethod("MonitorHandler_Meter", "ProcessG2HMessageInternal"))
            {
                try
                {
                    MonTgt_G2H_Meters monMeters = context.G2HMessage.Meters;
                    if (monMeters == null)
                    {
                        method.Info("Meters are null. No need to update the meters.");
                        return true;
                    }

                    if (ExCommsDataContext.Current.UpdateFloorFinancialsFromMeter(
                                                    context.G2HMessage.InstallationNo,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cancelled_Credits].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_100000].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_In].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_Out].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_Drop].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Jackpot].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Bet].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Won].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Door_Open].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Power_Reset].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_1].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_5].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_10].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_20].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_50].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_100].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_250].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_10000].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_20000].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_25000].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_50000].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Lost].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Current_Credits].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.External_Coin_Amount].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.True_Coin_In].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.True_Coin_Out].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Handpay_Cancelled_Credits].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_In_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_Out_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_In_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_Out_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_In_Qty].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_Out_Qty].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_In_Qty].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_Out_Qty].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Progressive_Win_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Progressive_Win_Handpay_Value].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Mystery_Machine_Paid].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Mystery_Attendant_Paid].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Promo_Cashable_EFT_In].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Promo_Cashable_EFT_Out].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Noncashable_EFT_In].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Noncashable_EFT_Out].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cashable_EFT_In].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cashable_EFT_Out].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_200].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_500].CoalesceIntValue,
                                                    null,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_2].CoalesceIntValue,
                                                    monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Since_Power_Up_Meter].CoalesceIntValue,
                                                    null,
                                                    monMeters.Source))
                        return true;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
                return false;
            }
        }
Ejemplo n.º 33
0
 protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
 {
     return(base.OnExecuteInternal(context, target));
 }
Ejemplo n.º 34
0
        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 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_Close tgtSrc = target as MonTgt_G2H_Ticket_Redemption_Close;
                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);
                    int installationNo = msgSrc.InstallationNo;
                    int? voucherID = 0;
                    long retCode = 0;
                    bool isLocalTicket = false;
                    bool sendAck = false;
                    method.InfoV("TICKET_REDEEM_CLOSE: Local Site Code : {0}, Ticket Site Code : {1}", siteCode, ticketSiteCode);

                    if (tgtSrc.Amount > 0 &&
                        tgtSrc.Status == FF_AppId_TicketRedemption_Close_Status.Success)
                    {
                        // is TIS printed ticket
                        if (ticketService.IsTISPrintedTicketPrefix(barcode))
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (TIS): TIS Printed Ticket ({0})", barcode);

                            if (ExCommsDataContext.Current.RedeemTicketComplete(barcode, stockNo, ref voucherID, siteCode, playerCardNo))
                            {
                                method.Info("TICKET_REDEEM_CLOSE (TIS): Send ticket: " + barcode + " redeem information to TIS");
                                ticketService.TisTicketRedeemComplete(barcode);
                                method.Info("TICKET_REDEEM_CLOSE (TIS): Redeem information send to TIS for ticket: " + barcode);
                            }
                            else
                            {
                                method.Info("TICKET_REDEEM_CLOSE: Problem while sending the Tkt Redeem complete msg to DB!");
                                tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                            }
                        }
                        // cross ticketing enabled and ticket site code not matched
                        else if (_configStore.IsCrossTicketingEnabled)//CrossTickeing From Setting
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (CROSS SITE): Ticket Printed in Site {1} ({0})", barcode, ticketSiteCode);

                            // local site
                            if (!siteCode.IgnoreCaseCompare(ticketSiteCode))
                            {
                                isLocalTicket = true;
                            }
                            else
                            {
                                //foreign site
                                if (installationNo == 0 ||
                                    string.IsNullOrEmpty(stockNo))
                                {
                                    method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Installation detail for ticket " + barcode + " in " + installationNo.ToString() + " for DeviceID " + stockNo);
                                    if (ticketService.TicketRedeemComplete(barcode, stockNo, out retCode) != 0)
                                    {
                                        method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Problem while sending the Tkt Redeem complete msg to WS!");
                                        tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                                    }
                                }
                                else
                                {
                                    method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Stored Installation detail for ticket " + barcode + " in " + installationNo.ToString() + " for DeviceID" + stockNo);
                                    if (ticketService.TicketRedeemComplete(barcode, stockNo, out retCode) != 0)
                                    {
                                        method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Stored Problem while sending the Tkt Redeem complete msg to WS!");
                                        tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                                    }
                                }
                            }
                        }
                        // local site ticket
                        else
                        {
                            isLocalTicket = true;
                        }
                        sendAck = true;
                    }

                    // local site ticket
                    if (isLocalTicket)
                    {
                        method.Info("TICKET_REDEEM_CLOSE (LOCAL): Ticket: " + barcode + " Sitecode : " + siteCode + " Inst  : " + installationNo.ToString());
                        if (!ExCommsDataContext.Current.RedeemTicketComplete(barcode, stockNo, ref voucherID, siteCode, playerCardNo))
                        {
                            method.Info("TICKET_REDEEM_CLOSE (LOCAL):Problem while sending the Tkt Redeem complete msg to DB!");
                        }
                        else
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (LOCAL): Success while redeeming amount for Barcode : {0}", barcode);
                        }
                    }
                    else
                    {
                        //else nota a valid amount or redeem status
                        method.Info("TICKET_REDEEM_CLOSE: No proper Ticket Redeemption!");
                        this.TicketReedeemFail(tgtSrc, msgSrc, ticketService, ref voucherID);
                        sendAck = true;
                    }

                    // send the acknowledgement
                    if (sendAck)
                    {
                        method.Info("TICKET_REDEEM_CLOSE: Sending redeem complete acknowledement");
                        MonTgt_H2G_Ticket_Redemption_Close response = new MonTgt_H2G_Ticket_Redemption_Close()
                        {
                            Status = (tgtSrc.Status == FF_AppId_TicketRedemption_Close_Status.Success) ? FF_AppId_ResponseStatus_Types.Success : FF_AppId_ResponseStatus_Types.Fail
                        };
                        context.H2GTargets.Add(response);
                        method.Info("TICKET_REDEEM_CLOSE: Successfully sent redeem complete acknowledement");
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return true;
            }
        }
        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;
            }
        }
Ejemplo n.º 37
0
        protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
        {
            using (ILogMethod method = Log.LogMethod("MonitorHandler_Meter", "ProcessG2HMessageInternal"))
            {
                try
                {
                    MonTgt_G2H_Meters monMeters = context.G2HMessage.Meters;
                    if (monMeters == null)
                    {
                        method.Info("Meters are null. No need to update the meters.");
                        return(true);
                    }

                    if (ExCommsDataContext.Current.UpdateFloorFinancialsFromMeter(
                            context.G2HMessage.InstallationNo,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cancelled_Credits].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_100000].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_In].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_Out].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Coins_Drop].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Jackpot].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Bet].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Won].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Door_Open].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Power_Reset].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_1].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_5].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_10].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_20].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_50].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_100].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_250].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_10000].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_20000].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_25000].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_50000].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Lost].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Current_Credits].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.External_Coin_Amount].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.True_Coin_In].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.True_Coin_Out].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Handpay_Cancelled_Credits].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_In_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_Out_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_In_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_Out_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_In_Qty].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Cashable_Out_Qty].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_In_Qty].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Tickets_Noncashable_Out_Qty].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Progressive_Win_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Progressive_Win_Handpay_Value].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Mystery_Machine_Paid].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Mystery_Attendant_Paid].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Promo_Cashable_EFT_In].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Promo_Cashable_EFT_Out].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Noncashable_EFT_In].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Noncashable_EFT_Out].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cashable_EFT_In].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Cashable_EFT_Out].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_200].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_500].CoalesceIntValue,
                            null,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Bill_2].CoalesceIntValue,
                            monMeters.Meters[MonTgt_G2H_Meter_MeterType.Games_Since_Power_Up_Meter].CoalesceIntValue,
                            null,
                            monMeters.Source))
                    {
                        return(true);
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
                return(false);
            }
        }
Ejemplo n.º 38
0
        protected override bool OnExecuteInternal(MonitorExecutionContext context, MonitorEntity_MsgTgt target)
        {
            using (ILogMethod method = Log.LogMethod("MonitorHandler_GIM", "OnExecuteInternal"))
            {
                try
                {
                    MonMsg_G2H msgSrc = context.G2HMessage;
                    MonTgt_G2H_GIM_GameIDInfo tgtSrc = target as MonTgt_G2H_GIM_GameIDInfo;
                    method.Info("GIM (CALL): IP Address : " + msgSrc.IpAddress +
                                ", Asset No : " + tgtSrc.AssetNumber.ToStringSafe() +
                                ", GMU No : " + tgtSrc.GMUNumber.ToStringSafe() +
                                ", Serial No : " + tgtSrc.SerialNumber.ToStringSafe());

                    int?   installationNo  = 0;
                    int?   assetNo         = 0;
                    string pokerGamePrefix = string.Empty;

                    if (ExCommsDataContext.Current.InsertGMULogin(tgtSrc, msgSrc.IpAddress,
                                                                  ref installationNo, ref assetNo, ref pokerGamePrefix))
                    {
                        int       assetNoInt    = assetNo.SafeValue();
                        IPAddress hostIPAddress = null;

                        // get the ip address
                        if (_configExchange.Honeyframe_Cashmaster_Exchange_EnableDhcp == 1)
                        {
                            hostIPAddress = _configExchange.Honeyframe_Cashmaster_BMCDHCP_ServerIP.ToIPAddress();
                        }
                        else
                        {
                            hostIPAddress = _configExchange.Honeyframe_Cashmaster_Exchange_interface.ToIPAddress();
                        }
                        method.InfoV("GIM (Success): Installation no ({1:D}), Asset No : {2:D}, Game Prefix : {3} for IP : {0}, from Host : {4}",
                                     msgSrc.IpAddress, installationNo, assetNoInt,
                                     pokerGamePrefix, hostIPAddress.ToString());
                        int installationNo2 = installationNo.SafeValue();

                        if (installationNo2 > 0)
                        {
                            MonMsg_H2G msgDest = new MonMsg_H2G()
                            {
                                InstallationNo = installationNo2,
                                IpAddress      = msgSrc.IpAddress,
                            };
                            MonTgt_H2G_GIM_GameIDInfo tgtDest = new MonTgt_H2G_GIM_GameIDInfo();
                            tgtDest.SourceAddress          = hostIPAddress;
                            tgtDest.EnableNetworkMessaging = true;
                            if (_configStore.Iview3AssetNum)
                            {
                                tgtDest.AssetNumberInt  = assetNoInt;
                                tgtDest.PokerGamePrefix = pokerGamePrefix.ToString();
                            }

                            // update the installation no
                            ExMonitorServerImpl.Current
                            .UpdateCommsServerHostAddress(installationNo2, msgSrc.HostIpAddress)
                            .UpdateInstallatioIpAddress(installationNo2, msgSrc.IpAddress);

                            // add the target and process
                            msgSrc.InstallationNo = installationNo2;
                            msgDest.Targets.Add(tgtDest);
                            context.H2GMessage = msgDest;
                            return(true);
                        }
                    }
                    else
                    {
                        method.InfoV("GIM (Failure): Unable to get the installation no for IP : {0}", msgSrc.IpAddress);
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
                return(false);
            }
        }
        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_Close tgtSrc = target as MonTgt_G2H_Ticket_Redemption_Close;
                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);
                    int    installationNo = msgSrc.InstallationNo;
                    int?   voucherID      = 0;
                    long   retCode        = 0;
                    bool   isLocalTicket  = false;
                    bool   sendAck        = false;
                    method.InfoV("TICKET_REDEEM_CLOSE: Local Site Code : {0}, Ticket Site Code : {1}", siteCode, ticketSiteCode);

                    if (tgtSrc.Amount > 0 &&
                        tgtSrc.Status == FF_AppId_TicketRedemption_Close_Status.Success)
                    {
                        // is TIS printed ticket
                        if (ticketService.IsTISPrintedTicketPrefix(barcode))
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (TIS): TIS Printed Ticket ({0})", barcode);

                            if (ExCommsDataContext.Current.RedeemTicketComplete(barcode, stockNo, ref voucherID, siteCode, playerCardNo))
                            {
                                method.Info("TICKET_REDEEM_CLOSE (TIS): Send ticket: " + barcode + " redeem information to TIS");
                                ticketService.TisTicketRedeemComplete(barcode);
                                method.Info("TICKET_REDEEM_CLOSE (TIS): Redeem information send to TIS for ticket: " + barcode);
                            }
                            else
                            {
                                method.Info("TICKET_REDEEM_CLOSE: Problem while sending the Tkt Redeem complete msg to DB!");
                                tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                            }
                        }
                        // cross ticketing enabled and ticket site code not matched
                        else if (_configStore.IsCrossTicketingEnabled)//CrossTickeing From Setting
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (CROSS SITE): Ticket Printed in Site {1} ({0})", barcode, ticketSiteCode);

                            // local site
                            if (!siteCode.IgnoreCaseCompare(ticketSiteCode))
                            {
                                isLocalTicket = true;
                            }
                            else
                            {
                                //foreign site
                                if (installationNo == 0 ||
                                    string.IsNullOrEmpty(stockNo))
                                {
                                    method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Installation detail for ticket " + barcode + " in " + installationNo.ToString() + " for DeviceID " + stockNo);
                                    if (ticketService.TicketRedeemComplete(barcode, stockNo, out retCode) != 0)
                                    {
                                        method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Problem while sending the Tkt Redeem complete msg to WS!");
                                        tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                                    }
                                }
                                else
                                {
                                    method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Stored Installation detail for ticket " + barcode + " in " + installationNo.ToString() + " for DeviceID" + stockNo);
                                    if (ticketService.TicketRedeemComplete(barcode, stockNo, out retCode) != 0)
                                    {
                                        method.Info("TICKET_REDEEM_CLOSE (CROSS SITE): Stored Problem while sending the Tkt Redeem complete msg to WS!");
                                        tgtSrc.Status = FF_AppId_TicketRedemption_Close_Status.CouponRejectedbySystem;
                                    }
                                }
                            }
                        }
                        // local site ticket
                        else
                        {
                            isLocalTicket = true;
                        }
                        sendAck = true;
                    }

                    // local site ticket
                    if (isLocalTicket)
                    {
                        method.Info("TICKET_REDEEM_CLOSE (LOCAL): Ticket: " + barcode + " Sitecode : " + siteCode + " Inst  : " + installationNo.ToString());
                        if (!ExCommsDataContext.Current.RedeemTicketComplete(barcode, stockNo, ref voucherID, siteCode, playerCardNo))
                        {
                            method.Info("TICKET_REDEEM_CLOSE (LOCAL):Problem while sending the Tkt Redeem complete msg to DB!");
                        }
                        else
                        {
                            method.InfoV("TICKET_REDEEM_CLOSE (LOCAL): Success while redeeming amount for Barcode : {0}", barcode);
                        }
                    }
                    else
                    {
                        //else nota a valid amount or redeem status
                        method.Info("TICKET_REDEEM_CLOSE: No proper Ticket Redeemption!");
                        this.TicketReedeemFail(tgtSrc, msgSrc, ticketService, ref voucherID);
                        sendAck = true;
                    }

                    // send the acknowledgement
                    if (sendAck)
                    {
                        method.Info("TICKET_REDEEM_CLOSE: Sending redeem complete acknowledement");
                        MonTgt_H2G_Ticket_Redemption_Close response = new MonTgt_H2G_Ticket_Redemption_Close()
                        {
                            Status = (tgtSrc.Status == FF_AppId_TicketRedemption_Close_Status.Success) ? FF_AppId_ResponseStatus_Types.Success : FF_AppId_ResponseStatus_Types.Fail
                        };
                        context.H2GTargets.Add(response);
                        method.Info("TICKET_REDEEM_CLOSE: Successfully sent redeem complete acknowledement");
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(true);
            }
        }