Ejemplo n.º 1
0
        //show scoreboard
        public void ShowPlayerScores(List <string> login)
        {
            bool isOnline = false;

            for (int i = 0; i < login.Count; i++)
            {
                if (login[i] == authorization)
                {
                    isOnline = true;
                }
            }
            if (!isOnline)
            {
                string data   = "\nuser is not logged in \n";
                string status = "404 Not found";
                string mime   = "text/plain";
                ServerResponse(status, mime, data);
                return;
            }

            string scoreboard = Database.selectPlayerScoreboard();

            if (scoreboard == "0")
            {
                string data   = "\nDatabase Error \n";
                string status = "404 Not found";
                string mime   = "text/plain";
                ServerResponse(status, mime, data);
            }
            else
            {
                string status = "200 Success";
                string mime   = "text/plain";
                ServerResponse(status, mime, scoreboard);
            }
        }