Exemplo n.º 1
0
        /// <summary>
        /// Create GIM GameIdRequest Freeform entity from Monitor GIM GameIdRequest Target
        /// </summary>
        /// <param name="monEntity"></param>
        /// <returns></returns>
        private FFMsg_H2G Create_H2G_GIM_GameIdRequest(MonitorEntity_MsgTgt monEntity)
        {
            try
            {
                MonTgt_H2G_GIM_GameIDRequest monTgtMsg = monEntity as MonTgt_H2G_GIM_GameIDRequest;
                if (monTgtMsg == null)
                {
                    return(null);
                }

                FFMsg_H2G     ffMsg       = new FFMsg_H2G();
                FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM();

                FFTgt_H2G_GIM_GameIDRequest ffTgtMsg = new FFTgt_H2G_GIM_GameIDRequest()
                {
                };

                ffTgtGIMMSg.AddTarget(ffTgtMsg);
                ffMsg.AddTarget(ffTgtGIMMSg);
                return(ffMsg);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create GIM GameInfo Freeform entity from Monitor GIM GameInfo Taget
        /// </summary>
        /// <param name="monTgtMsg"></param>
        /// <returns></returns>
        private FFMsg_H2G Create_H2G_GIM_GameInfo_Entity(MonitorEntity_MsgTgt monEntity)
        {
            try
            {
                MonTgt_H2G_GIM_GameIDInfo monTgtMsg = monEntity as MonTgt_H2G_GIM_GameIDInfo;
                if (monTgtMsg == null)
                {
                    return(null);
                }

                FFMsg_H2G     ffMsg       = new FFMsg_H2G();
                FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM();

                FFTgt_H2G_GIM_GameIDInfo ffTgtMsg = new FFTgt_H2G_GIM_GameIDInfo()
                {
                    SourceAddress   = monTgtMsg.SourceAddress,
                    AssetNumberInt  = monTgtMsg.AssetNumberInt,
                    PokerGamePrefix = monTgtMsg.PokerGamePrefix
                };

                ffTgtGIMMSg.AddTarget(ffTgtMsg);
                ffMsg.AddTarget(ffTgtGIMMSg);
                return(ffMsg);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create GIM AuxNetworkEnableDisable Freeform entity from Monitor GIM AuxNetworkEnableDisable Taget
        /// </summary>
        /// <param name="monTgtMsg"></param>
        /// <returns></returns>
        private FFMsg_H2G Create_H2G_GIM_AuxNetworkEnableDisable(MonitorEntity_MsgTgt monEntity)
        {
            try
            {
                MonTgt_H2G_GIM_AuxNetworkEnableDisable monTgtMsg = monEntity as MonTgt_H2G_GIM_AuxNetworkEnableDisable;
                if (monTgtMsg == null)
                {
                    return(null);
                }

                FFMsg_H2G     ffMsg       = new FFMsg_H2G();
                FFTgt_B2B_GIM ffTgtGIMMSg = new FFTgt_B2B_GIM();

                FFTgt_H2G_GIM_AuxNetworkEnableDisable ffTgtMsg = new FFTgt_H2G_GIM_AuxNetworkEnableDisable()
                {
                    EnableDisable = monTgtMsg.EnableDisable,
                    Display       = monTgtMsg.Display
                };

                ffTgtGIMMSg.AddTarget(ffTgtMsg);
                ffMsg.AddTarget(ffTgtGIMMSg);
                return(ffMsg);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return(null);
            }
        }
Exemplo n.º 4
0
        public void Buf2FF_GIM_GameIDInfo_H2G()
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G()
            {
                PollCode      = FF_AppId_H2G_PollCodes.FreeformNoResponse,
                SessionID     = FF_AppId_SessionIds.GIM,
                TransactionID = 1,
            });

            FFTgt_B2B_GIM tgt = new FFTgt_B2B_GIM();

            msg.AddTarget(tgt);

            FFTgt_H2G_GIM_GameIDInfo tgt2 = new FFTgt_H2G_GIM_GameIDInfo();

            tgt.AddTarget(tgt2);

            tgt2.AssetNumberInt         = 00012345;
            tgt2.DisplayMessage         = "Success!";
            tgt2.EnableNetworkMessaging = true;
            tgt2.SourceAddress          = Extensions.GetIpAddress(-1);
            tgt2.PokerGamePrefix        = "G";

            byte[] buffer  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg);
            string sBuffer = buffer.GetConvertBytesToHexString(string.Empty);

            Assert.AreEqual(sBuffer,
                            "[05][FB][17][01][00][01][00][01][00][1C][17][1A][02][09][01][53][75][63][63][65][73][73][21][03][04][0A][02][1E][68][04][04][00][01][23][45][05][01][47][3C]");
        }
        public void Entity_TicketRedeem_Start_H2G()
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G()
            {
                PollCode      = FF_AppId_H2G_PollCodes.FreeformResponse,
                SessionID     = FF_AppId_SessionIds.Tickets,
                TransactionID = 1,
            });

            FFTgt_B2B_TicketInfo tgt = new FFTgt_B2B_TicketInfo();

            msg.AddTarget(tgt);

            FFTgt_H2G_Ticket_Redemption_Response tgt2 = new FFTgt_H2G_Ticket_Redemption_Response();

            tgt.AddTarget(tgt2);

            tgt2.Barcode = "100000000078789098";
            tgt2.Amount  = 9976;
            tgt2.Type    = FF_AppId_TicketTypes.Cashable;

            byte[] buffer  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg);
            string sBuffer = buffer.GetConvertBytesToHexString(string.Empty);

            Assert.AreEqual(sBuffer,
                            "[05][FB][8A][01][00][01][00][01][00][11][0A][0F][03][10][00][00][00][00][78][78][90][98][00][00][99][76][00][0F]");
        }
        public void Entity_TicketRedeem_End_H2G()
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G()
            {
                PollCode      = FF_AppId_H2G_PollCodes.FreeformResponse,
                SessionID     = FF_AppId_SessionIds.Tickets,
                TransactionID = 1,
            });

            FFTgt_B2B_TicketInfo tgt = new FFTgt_B2B_TicketInfo();

            msg.AddTarget(tgt);

            FFTgt_H2G_Ticket_Redemption_Close tgt2 = new FFTgt_H2G_Ticket_Redemption_Close();

            tgt.AddTarget(tgt2);

            tgt2.Status = FF_AppId_ResponseStatus_Types.Fail;

            byte[] buffer  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg);
            string sBuffer = buffer.GetConvertBytesToHexString(string.Empty);

            Assert.AreEqual(sBuffer,
                            "[05][FB][8A][01][00][01][00][01][00][04][0A][02][04][00][5F]");
        }
Exemplo n.º 7
0
        public void Buffer_WithdrawalAuthorization()
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G()
            {
                PollCode      = FF_AppId_H2G_PollCodes.FreeformResponse,
                SessionID     = FF_AppId_SessionIds.ECash,
                TransactionID = 1,
            });
            FFTgt_B2B_EFT tgt = new FFTgt_B2B_EFT();

            msg.AddTarget(tgt);
            FFTgt_H2G_EFT_WithdrawalAuthorization tgt2 = new FFTgt_H2G_EFT_WithdrawalAuthorization();

            tgt.AddTarget(tgt2);
            tgt2.NonCashableAmount = 4550;
            tgt2.CashableAmount    = 2520;
            tgt2.ErrorCode         = 0;
            tgt2.PlayerCardNumber  = "1000500026";
            tgt2.PlayerFlags.Flag3.Flag_DepositCash = true;
            tgt2.DisplayMessage = "Welcome Dinesh, you have 20 points, 100 Cash";
            byte[] buffer  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg);
            string sBuffer = buffer.GetConvertBytesToHexString(string.Empty);

            Assert.IsNotNull(buffer);
        }
Exemplo n.º 8
0
        static void EncryptSecurity()
        {
            FFMsg_G2H msg = FreeformEntityFactory.CreateEntity <FFMsg_G2H>(FF_FlowDirection.G2H,
                                                                           new FFCreateEntityRequest_G2H_ResponseRequired()
            {
                Command       = FF_AppId_G2H_Commands.ResponseRequest,
                MessageType   = FF_AppId_G2H_MessageTypes.FreeForm,
                SessionID     = FF_AppId_SessionIds.Security,
                TransactionID = 0xB1,
                IPAddress     = IPADDR,
            });
            FFTgt_B2B_Security tgt = new FFTgt_B2B_Security_ResponseRequired()
            {
                SecurityData = new FFTgt_B2B_Security_KeyExchange_Request(),
            };

            msg.AddTarget(tgt);
            byte[] buf2 = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.G2H, msg);
            var    msgF = FreeformEntityFactory.CreateEntity <FFMsg_G2H>(FF_FlowDirection.G2H, buf2);

            FFMsg_H2G msg2 = msg.CopyTo(FF_FlowDirection.H2G, new FFCreateEntityRequest_H2G_ResponseRequired()
            {
                PollCode = FF_AppId_H2G_PollCodes.FreeformResponse,
            }) as FFMsg_H2G;
            FFTgt_B2B_Security tgt2 = new FFTgt_B2B_Security()
            {
                SecurityData = new FFTgt_B2B_Security_KeyExchange_PartialKey()
                {
                    PartialKey = new byte[] { 10, 11, 12, 34, 56, 78, 96, 89, 44 },
                }
            };

            msg2.AddTarget(tgt2);

            byte[] buf3  = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg2);
            var    msgF3 = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G, buf3, IPADDR);

            ExecutionStepFactory.Current.Execute(msg);
            //byte[] buf1 = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, msg2);
            //UdpFreeformEntity buffer = FreeformEntityFactory.CreateUdpEntity(FF_FlowDirection.G2H, buf1);
            //IFreeformEntity ff = FreeformEntityFactory.CreateEntity(FF_FlowDirection.G2H, buffer);
            //byte[] buf2 = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.G2H, msg);
        }