Ejemplo n.º 1
0
        //show Deck from user------------------------------------------------
        public void ShowDeck(List <string> login, int show)
        {
            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);

            List <string> myDeck  = Database.selectPlayerDeck(playername, show);
            string        message = "";

            foreach (string card in myDeck)
            {
                message += card + "\n\n";
            }
            string mystatus = "200 Success";
            string mymime   = "text/plain";

            ServerResponse(mystatus, mymime, message);
            return;
        }