Ejemplo n.º 1
0
        bool IExMonServer4CommsServerCallback.ProcessH2GMessage(MonMsg_H2G request)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessH2GMessage"))
            {
                bool result = default(bool);

                try
                {
                    if (request == null)
                    {
                        method.Info("Invalid method received from monitor server");
                        return(false);
                    }

                    FFMsg_H2G h2gMessage = MonitorEntityFactory.CreateEntity(request);
                    if (h2gMessage == null)
                    {
                        method.Info("Unable to convert the freeform message from monitor message");
                        return(false);
                    }

                    method.Info("Processing H2G Message for : " + h2gMessage.IpAddress);
                    ExCommsExecutorFactory.ProcessMessage(h2gMessage);
                    result = true;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
        protected override bool ProcessMessageInternal(ILogMethod method, FFMsg_G2H message)
        {
            if (message == null)
            {
                method.Info("Freeform message (G2H) was null.");
                return(false);
            }

            this.OnModifyMessage(method, message);

            // convert the monitor message from freeform message
            MonMsg_G2H monMsg = MonitorEntityFactory.CreateEntity(message);

            if (monMsg == null)
            {
                method.Info("Unable to convert the monitor message from freeform message.");
                return(false);
            }

            // post the monitor message into monitor processor
            if (!this.MonitorProcessor.ProcessG2HMessage(monMsg))
            {
                method.Info("Unable to post the message to monitor processor.");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
        static void TestMeterMessage()
        {
            string msg = "[C0][A8][02][12][05][A2][B9][0F][B0][00][01][00][01][01][5B][10][2A][01][CF][00][00][00][00][00][0F][08][00][00][00][00][00][00][00][00][00][00][00][00][00][20][30][30][30][00][30][30][30][30][00][00][00][01][30][30][30][00][00][00][00][0F][49][02][01][04][00][00][31][17][02][04][00][50][45][55][03][04][00][09][40][35][04][04][00][00][00][00][05][04][00][00][00][00][06][04][00][00][00][00][29][04][00][01][51][21][2A][04][00][00][05][43][2B][04][00][00][00][00][2C][04][00][00][00][00][30][04][00][00][00][00][31][04][00][00][00][00][0F][3D][02][07][04][00][00][00][01][08][04][00][00][00][01][09][04][00][00][00][01][0A][04][00][00][00][00][0B][04][00][00][00][01][0C][04][00][00][00][00][2E][04][00][00][00][00][2F][04][00][00][00][00][0D][04][00][00][00][00][0E][04][00][00][66][00][0F][3F][02][13][05][00][00][00][85][21][14][05][00][00][15][07][82][15][05][00][00][00][00][00][16][05][00][00][00][00][00][17][04][00][00][00][03][18][04][00][00][00][52][19][04][00][00][00][00][1A][04][00][00][00][00][24][00][25][00][28][04][01][52][51][01][0F][32][02][0F][04][00][00][00][00][10][04][00][00][00][00][11][04][00][00][00][00][12][04][00][00][00][00][1F][04][00][00][00][00][20][04][00][00][00][00][26][05][00][00][00][00][00][27][04][00][00][00][00][0F][21][02][1B][04][01][19][70][00][1C][04][01][37][43][19][1D][04][00][00][00][00][1E][04][00][00][00][00][28][04][01][52][51][01][2D][00][10][0B][07][1D][03][13][24][39][1C][03][02][21][14][D6]";

            byte[]             buf    = GetBuffer(msg);
            UdpFreeformEntity  buffer = FreeformEntityFactory.CreateUdpEntity(FF_FlowDirection.G2H, buf);
            IFreeformEntity    ff     = FreeformEntityFactory.CreateEntity(FF_FlowDirection.G2H, buffer);
            IMonitorEntity_Msg mon    = MonitorEntityFactory.CreateEntity(ff as FFMsg_G2H);
        }
Ejemplo n.º 5
0
        static void TestTicketMessage()
        {
            string msg =
                "[C0][A8][02][12][05][A2][BC][8A][8D][00][01][00][01][00][11][0A][02][06][00][10][0B][07][1D][03][12][57][09][1C][03][02][21][14][57]";

            byte[]             buf    = GetBuffer(msg);
            UdpFreeformEntity  buffer = FreeformEntityFactory.CreateUdpEntity(FF_FlowDirection.G2H, buf);
            IFreeformEntity    ff     = FreeformEntityFactory.CreateEntity(FF_FlowDirection.G2H, buffer);
            IMonitorEntity_Msg mon    = MonitorEntityFactory.CreateEntity(ff as FFMsg_G2H);
        }
Ejemplo n.º 6
0
        //static void InitKeyExchangeStartG2H()
        //{
        //    FreeformEncryptionHelper.InitKeyExchangeStart(
        //        ModuleHelper.Current.CreateH2GMessage(IPADDR,
        //        FF_AppId_SessionIds.Security,
        //        FF_AppId_H2G_PollCodes.FreeformResponse));
        //}

        //static void InitKeyExchangeStartH2G()
        //{
        //    FreeformEncryptionHelper.InitKeyExchangeStart(
        //        ModuleHelper.Current.CreateH2GMessage(IPADDR,
        //        FF_AppId_SessionIds.Security,
        //        FF_AppId_H2G_PollCodes.FreeformResponse));
        //}

        //static void InitKeyExchangeEnd()
        //{
        //    byte[] key = new byte[] { 10, 11, 12, 34, 56, 78, 96, 89, 44 };
        //    FreeformEncryptionHelper.InitKeyExchangeEnd(
        //        ModuleHelper.Current.CreateH2GMessage(IPADDR,
        //        FF_AppId_SessionIds.Security,
        //        FF_AppId_H2G_PollCodes.FreeformResponse),
        //        key);
        //}
        static void TestPIDData()
        {
            return;

            string msg = "[C0][A8][02][10][05][A2][B9][1C][4F][00][01][00][01][00][05][1C][03][0F][01][00][FF]";

            byte[]             buf    = GetBuffer(msg);
            UdpFreeformEntity  buffer = FreeformEntityFactory.CreateUdpEntity(FF_FlowDirection.G2H, buf);
            IFreeformEntity    ff     = FreeformEntityFactory.CreateEntity(FF_FlowDirection.G2H, buffer);
            IMonitorEntity_Msg mon    = MonitorEntityFactory.CreateEntity(ff as FFMsg_G2H);
        }
Ejemplo n.º 7
0
        protected virtual bool PostMessageToMonitorServer(ILogMethod method, FFMsg_G2H message)
        {
            // convert the monitor message from freeform message
            MonMsg_G2H monMsg = MonitorEntityFactory.CreateEntity(message);

            if (monMsg == null)
            {
                method.Info("Unable to convert the monitor message from freeform message.");
                return(false);
            }

            // post the monitor message into monitor processor
            if (!this.MonitorProcessor.ProcessG2HMessage(monMsg))
            {
                method.Info("Unable to post the message to monitor processor.");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public void Mon2FF_GIM_GameIDInfo_H2G()
        {
            MonMsg_H2G monMsg = new MonMsg_H2G()//(FaultSource.GIM_Event, (int)FaultType_GIM.Game_Id_Info_H2G)
            {
                InstallationNo = 4,
            };

            monMsg.Targets.Add(new MonTgt_H2G_GIM_GameIDInfo()
            {
                AssetNumberInt         = 111,
                EnableNetworkMessaging = true,
                PokerGamePrefix        = "A",
                SourceAddress          = Extensions.GetIpAddress(-1),
            });
            IFreeformEntity ff = MonitorEntityFactory.CreateEntity(monMsg);

            Assert.IsNotNull(ff);

            byte[] buffer2  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, ff);
            string sBuffer2 = buffer2.GetConvertBytesToHexString(string.Empty);
        }
        protected virtual bool OnProcessMessageInternal(FFMsg_G2H message, IList <MonitorEntity_MsgTgt> monitorTargets)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "OnProcessMessageInternal(G2H)"))
            {
                bool result = default(bool);

                try
                {
                    if (monitorTargets == null || monitorTargets.Count == 0)
                    {
                        return(true);
                    }

                    // convert the monitor message from freeform message
                    MonMsg_G2H monMsg = MonitorEntityFactory.CreateEntity(message, monitorTargets);
                    if (monMsg == null)
                    {
                        method.Info("Unable to convert the monitor message from freeform message.");
                        return(false);
                    }

                    // post the monitor message into monitor processor
                    if (!this.MonitorProcessor.ProcessG2HMessage(monMsg))
                    {
                        method.Info("Unable to post the message to monitor processor.");
                        return(false);
                    }

                    result = true;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
Ejemplo n.º 10
0
        public void FF2Mon_GIM_GameIDInfo_G2H()
        {
            byte[] buffer = TestHelper.GetBuffer("[C0][A8][02][10][05][A2][BC][17][B1][00][01][00][01][00][5E][17][5C][01][5A][01][05][30][30][30][30][32][02][05][31][32][33][34][35][03][02][42][39][04][0C][30][30][30][30][30][30][30][31][32][33][34][35][05][06][00][16][80][01][47][4D][06][03][36][30][31][07][2B][4F][63][74][20][31][38][20][32][30][31][33][20][31][35][3A][35][32][3A][31][37][20][56][65][72][2D][33][30][30][2E][30][35][2E][31][34][61][20][4F][70][74][69][6F][6E][73][C4]");
            Assert.IsNotNull(buffer);

            UdpFreeformEntity udp = FreeformEntityFactory.CreateUdpEntity(FF_FlowDirection.G2H, buffer);

            Assert.IsNotNull(udp);

            string          sBuffer1 = buffer.GetConvertBytesToHexString(string.Empty);
            IFreeformEntity ff       = FreeformEntityFactory.CreateEntity(FF_FlowDirection.G2H, udp);

            Assert.IsNotNull(ff);

            byte[] buffer2  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.G2H, ff);
            string sBuffer2 = buffer2.GetConvertBytesToHexString(string.Empty);

            Assert.AreEqual(sBuffer1, sBuffer2);

            IMonitorEntity monitor = MonitorEntityFactory.CreateEntity(ff as FFMsg_G2H);

            Assert.IsNotNull(monitor);
        }