Example #1
0
        public async Task <LoginResult> Login(Player player, string password)
        {
            UserDto user;

            if (m_UserData.TryGetValue(player.Name, out user))
            {
                return(Validate(user, password, player));
            }
            else
            {
                UserDto u = await RemoteApi.GetUserData(player.Name);

                if (u == null)
                {
                    return(new LoginResult()
                    {
                        Result = player.Name + " does not exist. Sign up at hqmpubstars.com."
                    });
                }
                else
                {
                    m_UserData[u.Name] = u;
                    return(Validate(u, password, player));
                }
            }
        }
Example #2
0
 public ActionResult Remote([FromBody] RemoteApi remoteApi)
 {
     if (remoteApi == null)
     {
         return(Json(new ResultsJson(new Message(CodeMessage.PostNull, "PostNull"), null)));
     }
     return(Json(Global.BUSS.BussResults(this, remoteApi)));
 }
Example #3
0
 void getFisler()
 {
     urunList.Clear();
     foreach (ImageForApiModel item in images)
     {
         ReceiptStr fis = RemoteApi.GetFisFromApi(item.imageArray, item.fileName);
         fisler.Add(fis);
         totalAmount += Convert.ToDecimal(fis.GrandTotal);
         totalTax    += Convert.ToDecimal(fis.TaxTotal);
         urunList.AddRange(fis.RecipeItems);
     }
 }
Example #4
0
        public async Task Init()
        {
            var userData = await RemoteApi.GetUserData();

            if (userData != null)
            {
                m_UserData.Init(userData);
                m_CommandListener.AddCommand("join", Login);
                m_CommandListener.AddCommand("info", Info);
                Console.WriteLine("LoginManager initialized successfully.");
            }
            else
            {
                Console.WriteLine("LoginManager failed to initialize.");
                Console.ReadLine();
            }
        }
Example #5
0
        public ActionResult Submit(string method)
        {
            var template = RemoteApi.GetViewTemplateFromLocalStore(method);

            var builder = new GMUIGroupBuilder(template.ControlGroups, Request.Form);

            builder.Build();

            if (RemoteApi.Submit(method, builder.Values))
            {
                return(RedirectToAction("ViewTemplate", "Home", new { method }));
            }
            else
            {
                return(RedirectToAction("ViewTemplate", "Home", new { method }));
            }
        }
Example #6
0
        public ActionResult ViewTemplate(string method)
        {
            var template = RemoteApi.GetViewTemplate(method, Request.QueryString);
            var colclass = "col-lg-4 col-md-6 col-sm-12"; //默认横向放三个

            if (template.ControlGroups.Count() < 3)       //一个card占满一行
            {
                colclass = "col-md-12";
            }


            var builder = new GMUIGroupBuilder(template.ControlGroups, Request.QueryString);

            builder.Build();

            ViewBag.Method   = method;
            ViewBag.ShowForm = template.ControlGroups.Any();
            ViewBag.ColClass = colclass;

            return(View(template));
        }
Example #7
0
        public async Task OnEnter()
        {
            Console.WriteLine("EndGame - OnEnter");

            int redScore  = GameInfo.RedScore;
            int blueScore = GameInfo.BlueScore;

            var redTeam = m_Context.LoggedInPlayers
                          .Where(x => x.Team == HQMTeam.Red)
                          .Select(x => x.Name);

            var blueTeam = m_Context.LoggedInPlayers
                           .Where(x => x.Team == HQMTeam.Blue)
                           .Select(x => x.Name);

            List <GameDto.PlayerStatLine> stats = CreateStatLines(redTeam, blueTeam);

            GameDto report = new GameDto()
            {
                RedScore    = redScore,
                BlueScore   = blueScore,
                WinningTeam = redScore > blueScore ? "Red" : "Blue",
                PlayerStats = stats,
                Date        = DateTime.UtcNow
            };

            Chat.SendMessage(">> Game over. Stats have been Recorded.");
            m_Warden.Stop();

            if (!await RemoteApi.SendGameResult(report))
            {
                await RemoteApi.GetToken();

                if (!await RemoteApi.SendGameResult(report))
                {
                    Console.WriteLine("Could not post game result");
                }
            }
        }
Example #8
0
        /// <summary>
        /// 左侧导航
        /// </summary>
        /// <returns></returns>
        public ActionResult Nav()
        {
            ViewBag.Navs = RemoteApi.GetNavs();

            return(PartialView());
        }