Пример #1
0
        private static string BuildRequest(long domainID,
                                           bool isMobile,
                                           VendorID vendor,
                                           string gameCode,
                                           int maxRecords)
        {
            using (StringWriter sw = new StringWriter())
                using (JsonTextWriter writer = new JsonTextWriter(sw))
                {
                    writer.WriteStartObject();

                    writer.WritePropertyName("RequestTime");
                    writer.WriteValue(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture));

                    writer.WritePropertyName("GameType");
                    writer.WriteValue(isMobile ? "mobile" : "desktop");

                    writer.WritePropertyName("GameVendor");
                    writer.WriteValue(vendor.ToString());

                    writer.WritePropertyName("GameCode");
                    writer.WriteValue(gameCode);

                    writer.WritePropertyName("TopN");
                    writer.WriteValue(maxRecords);

                    writer.WritePropertyName("DomainSpecific");
                    writer.WriteValue(domainID);

                    writer.WriteEndObject();

                    return(sw.ToString());
                }
        }
Пример #2
0
 public CashTransporter(SessionPayload session, long domainId, VendorID vendor)
 {
     _vendorApi   = new VendorApiClient(vendor.ToString());
     _domainId    = domainId;
     _userSession = session;
     _vendor      = vendor;
 }
Пример #3
0
        public void SaveTo(XmlTextWriter xw)
        {
            xw.WriteAttributeString("type", MappedType.ToString());
            xw.WriteAttributeString("source", Source.ToString());
            xw.WriteAttributeString("uuid", UUID.ToString());

            if (Source == SourceType.RawInput)
            {
                xw.WriteAttributeString("vid", VendorID.ToString("X"));
                xw.WriteAttributeString("pid", ProductID.ToString("X"));
                xw.WriteAttributeString("rpt_hash", ReportHash.ToString());
                xw.WriteAttributeString("idx", DeviceIndex.ToString());
            }
            else if (Source == SourceType.XInput)
            {
                xw.WriteAttributeString("idx", DeviceIndex.ToString());
            }
            else if (Source == SourceType.MUNIA)
            {
                xw.WriteAttributeString("devicepath", DevicePath);
            }
            else if (Source == SourceType.Arduino)
            {
                xw.WriteAttributeString("arduino_port", ArduinoPort.Name);
                xw.WriteAttributeString("arduino_type", ArduinoSource.ToString());
            }

            xw.WriteStartElement("buttons");
            foreach (var btn in ButtonMaps)
            {
                btn.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("axes");
            foreach (var axis in AxisMaps)
            {
                axis.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("buttons_to_axis");
            foreach (var btn in ButtonToAxisMaps)
            {
                btn.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("axis_to_buttons");
            foreach (var axis in AxisToButtonMaps)
            {
                axis.SaveTo(xw);
            }
            xw.WriteEndElement();
        }
        public ActionResult VendorWizards(VendorID vendorID)
        {
            string           viewName = string.Format("VendorWizards_{0}", vendorID.ToString());
            ViewEngineResult result   = ViewEngines.Engines.FindView(ControllerContext, viewName, null);
            bool             exists   = (result.View != null);

            if (!exists)
            {
                viewName = "VendorWizards_Basic";
            }
            ViewData["vendorID"] = vendorID;
            return(this.View(viewName));
        }
Пример #5
0
        public XElement Serialize()
        {
            var xel = new XElement("Joystick",
                                   new XAttribute("Name", Name),
                                   new XAttribute("Code", Code),
                                   new XAttribute("VendorID", VendorID.ToString("X4")),
                                   new XAttribute("ProductID", ProductID.ToString("X4")),
                                   new XAttribute("ReportStructure", ReportStructure ?? ""),
                                   new XAttribute("ID", ID));

            foreach (var joystickControl in __Controls)
            {
                xel.Add(joystickControl.Serialize());
            }

            return(xel);
        }
        ///<summary>
        ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbDeviceDescriptor"/>.
        ///</summary>
        ///
        ///<param name="prefixSeperator">The field prefix string.</param>
        ///<param name="entitySperator">The field/value seperator string.</param>
        ///<param name="suffixSeperator">The value suffix string.</param>
        ///<returns>A formatted representation of the <see cref="UsbDeviceDescriptor"/>.</returns>
        public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
        {
            Object[] values =
            {
                Length,                         DescriptorType,                  "0x" + BcdUsb.ToString("X4"),    Class, "0x" + SubClass.ToString("X2"),
                "0x" + Protocol.ToString("X2"), MaxPacketSize0,
                "0x" + VendorID.ToString("X4"), "0x" + ProductID.ToString("X4"), "0x" + BcdDevice.ToString("X4"),
                ManufacturerStringIndex,        ProductStringIndex,              SerialStringIndex,               ConfigurationCount
            };
            string[] names =
            {
                "Length",                  "DescriptorType",     "BcdUsb",            "Class", "SubClass", "Protocol", "MaxPacketSize0", "VendorID", "ProductID",
                "BcdDevice",
                "ManufacturerStringIndex", "ProductStringIndex", "SerialStringIndex", "ConfigurationCount"
            };

            return(Helper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
        }
Пример #7
0
        public static string ConvertToReportVendorID(VendorID vendorID)
        {
            switch (vendorID)
            {
            case VendorID.OneXTwoGaming:
                return("1x2Gaming");

            case VendorID.BallyGaming:
                return("Bally");

            case VendorID.ISoftBet:
                return("iSoftBet");

            case VendorID.NYXGaming:
                return("NYX");

            default:
                return(vendorID.ToString());
            }
        }
Пример #8
0
 protected override void OnError(EventArgs e)
 {
     if (EnableLogging)
     {
         GmLogger.Instance.ErrorException(Server.GetLastError(), StartupParams, "Error in Loader {0}, {1}", new[] { VendorID.ToString(), GameID });
     }
     base.OnError(e);
 }
Пример #9
0
 protected void LogGmClientRequest(string sessionId, string responseParam, string responseParamName = null)
 {
     if (EnableLogging)
     {
         GmLogger.Instance.Trace("{0}GetSessionRequest at Domain:{1}, User:{2} | {3} | {4}, {6}:{5}", VendorID.ToString(), UserSession.DomainID, UserSession.Username, UserSession.UserID, sessionId, responseParam, responseParamName ?? "Token");
     }
 }
Пример #10
0
        public void InitLoader()
        {
            try
            {
                this.VendorID         = (VendorID)ViewData["VendorID"];
                this.Domain           = ViewData["Domain"] as ceDomainConfigEx;
                this.UserSession      = ViewData["UserSession"] as SessionPayload;
                this.FunMode          = (ViewData["FunMode"] == null) || (bool)ViewData["FunMode"];
                this.UseGmGaming      = (bool)ViewData["UseGmGaming"];
                this.EnableLogging    = (bool)ViewData["EnableLogging"];
                this.GameID           = ViewData["GameID"] as string;
                this.GameCode         = ViewData["GameCode"] as string;
                this.Slug             = ViewData["Slug"] as string;
                this.TableID          = ViewData["TableID"] as string;
                this.CasinoGameID     = (long)ViewData["CasinoGameID"];
                this.CasinoBaseGameID = (long)ViewData["CasinoBaseGameID"];

                if (this.Domain == null)
                {
                    throw new Exception("Invalid Domain");
                }

                if (!string.IsNullOrEmpty(Request["cashierurl"]))
                {
                    this.Domain.CashierUrl       = Request["cashierurl"];
                    this.Domain.MobileCashierUrl = Request["cashierurl"];
                }

                if (!string.IsNullOrEmpty(Request["casinolobbyurl"]))
                {
                    this.Domain.LobbyUrl       = Request["casinolobbyurl"];
                    this.Domain.MobileLobbyUrl = Request["casinolobbyurl"];
                }

                this.Language = GetLanguage();

                if (EnableLogging)
                {
                    var userState = (UserSession == null) ? "NULL" : UserSession.Username + " | " + UserSession.UserID + (FunMode ? " | FunMode" : "");
                    StartupParams.Add("VendorID", VendorID);
                    StartupParams.Add("DomainID", Domain.DomainID);
                    StartupParams.Add("UserSession", userState);
                    StartupParams.Add("FunMode", FunMode);
                    StartupParams.Add("Language", Language);
                    StartupParams.Add("UseGmGaming", UseGmGaming);
                    StartupParams.Add("GameID", GameID);
                    StartupParams.Add("GameCode", GameCode);
                    StartupParams.Add("Slug", Slug);
                    StartupParams.Add("CasinoGameID", CasinoGameID);
                    StartupParams.Add("CasinoBaseGameID", CasinoBaseGameID);
                    StartupParams.Add("TableID", TableID);
                    GmLogger.Instance.Trace(StartupParams, "GameStarted at {0}, {1} {2}, User:{3}", new[] { VendorID.ToString(), GameID, GameCode, userState });
                }
            }
            catch (Exception ex)
            {
                if (EnableLogging)
                {
                    GmLogger.Instance.ErrorException(ex, StartupParams, "InitLoader Exception {0}, {1}", new[] { VendorID.ToString(), GameID });
                }
                throw;
            }
        }
Пример #11
0
 public override string ToString()
 {
     return(String.Format("{0}:{1}", VendorID.ToString("x").PadLeft(4, '0'), ProductID.ToString("x").PadLeft(4, '0')));
 }