public JsonResult SaveMicrogamingNanoGameSession(long domainID, long id, string _sid , decimal balance , string userType , string lcid , string sessionId , string token ) { string cacheKey = string.Format("MG_NANO_GAME_SESSION_{0}_{1}", domainID, _sid); MicrogamingNanoGameSessionInfo info = new MicrogamingNanoGameSessionInfo() { Balance = balance, UserType = userType, LocalConnectionID = lcid, SessionId = sessionId, Token = token, }; HttpRuntime.Cache[cacheKey] = info; return(this.Json(new { @success = true }, JsonRequestBehavior.AllowGet)); }
public ActionResult MicrogamingNanoXpro(long domainID, string id, string _sid) { List <ceDomainConfigEx> domains = DomainManager.GetDomains(); ceDomainConfigEx domain = domains.FirstOrDefault(d => d.DomainID == domainID); if (domain == null) { this.ViewData["ErrorMessage"] = "Invalid Url Parameter(s)!"; return(this.View("Error")); } Dictionary <string, ceCasinoGameBaseEx> games = CacheManager.GetGameDictionary(domainID); ceCasinoGameBaseEx game; if (!games.TryGetValue(id, out game)) { this.ViewData["ErrorMessage"] = "Error, cannot find the game!"; return(this.View("Error")); } SessionPayload session = null; if (!string.IsNullOrWhiteSpace(_sid)) { using (DbManager db = new DbManager()) { session = _agentClient.GetSessionByGuid(_sid); if (session == null || session.IsAuthenticated != true || session.DomainID != domainID) { this.ViewData["ErrorMessage"] = "Error, invalid session id!"; return(this.View("Error")); } } } MicrogamingNanoGameSessionInfo info = null; if (session != null) { string cacheKey = string.Format("MG_NANO_GAME_SESSION_{0}_{1}", domainID, session.Guid); info = HttpRuntime.Cache[cacheKey] as MicrogamingNanoGameSessionInfo; this.ViewData["HandlerUrl"] = this.Url.Action("SaveMicrogamingNanoGameSession" , new { @domainID = domainID, @id = id, @_sid = session.Guid } ); } this.ViewData["UserSession"] = session; this.ViewData["Domain"] = domain; this.ViewData["MicrogamingNanoGameSessionInfo"] = info; this.ViewData["UserSession"] = session; this.ViewData["VendorID"] = game.VendorID; this.ViewData["GameID"] = game.GameID; this.ViewData["CasinoBaseGameID"] = game.ID; this.ViewData["CasinoGameID"] = game.CasinoGameId; this.ViewData["GameCode"] = game.GameCode; Dictionary <int, ceCasinoVendor> vendors = CacheManager.GetVendorDictionary(domain.DomainID); this.ViewData["UseGmGaming"] = (vendors.ContainsKey((int)game.VendorID)) && vendors[(int)game.VendorID].EnableGmGamingAPI; this.ViewData["EnableLogging"] = (vendors.ContainsKey((int)game.VendorID)) && vendors[(int)game.VendorID].EnableLogging; return(this.View("MicrogamingNanoXpro", game)); }