Пример #1
0
        //show points of one player----------------------------------
        public void ShowPlayerStats(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;
            }
            int    lenght     = authorization.IndexOf("-mtcgToken");
            string playername = authorization.Substring(0, lenght);
            string mymessage  = Database.selectPlayerPoints(playername);

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