/// <summary>
        /// Fetch scores from Game Jolt
        /// </summary>
        static public Dictionary <string, string> FetchScore(string username, string token, string gameid, string limit, string table_id, string privatekey)
        {
            var qs = "";

            if (username != "")
            {
                qs += "username="******"&user_token=" + token;
            }
            if (limit != "")
            {
                if (qs != "")
                {
                    qs += "&";
                }
                qs += "limit=" + limit;
            }
            if (table_id != "")
            {
                if (qs != "")
                {
                    qs += "&";
                }
                qs += "table_id=" + table_id;
            }
            if (qs != "")
            {
                qs += "&";
            }
            qs += "game_id=" + gameid;
            return(GJAPI.gjrequest("scores", qs, privatekey));
        }
        /// <summary>
        /// Submit a guest score. Returns true if succesful!
        /// </summary>
        /// <param name="guestname"></param>
        /// <param name="gameid"></param>
        /// <param name="privatekey"></param>
        /// <param name="score"></param>
        /// <param name="sort"></param>
        /// <param name="table_id"></param>
        /// <returns></returns>
        static public bool SubmitGuestScore(string guestname, string gameid, string privatekey, string score, string sort, string table_id)
        {
            var qs = $"&score={score.Replace(" ", "+")}&sort={sort}";

            if (table_id != "")
            {
                qs += "&table_id" + table_id;
            }
            qs += $"&guest={guestname.Replace(" ", "+")}&game_id={gameid}"; //+"&signature="+getMD5Hash(privatekey)
            var r = GJAPI.gjrequest("scores/add", qs, privatekey);

            return(r["success"] == "true");
        }
        /// <summary>
        /// Fetches all trophies for the game this user has been attached to. Please note that the index numbers are in fact the trophy ID numbers as they are stored on the Game Jolt server!
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        static public Dictionary <int, GJTrophy> FetchAll(GJUser user)
        {
            GJAPI.chat($"Fetching Trophies for {user.gameid}");
            var ret         = new Dictionary <int, GJTrophy>();
            var querystring = $"game_id={user.gameid}&username={user.userid}&user_token={user.token}"; //, user.gamekey);
            var url         = $"https://api.gamejolt.com/api/game/v1/trophies/?{querystring}";

            url += "&signature=" + GJAPI.md5(url + user.gamekey);
            GJAPI.chat($"Request sent: {url}");
            var      ng     = GJAPI.GET(url).Trim().Split('\n');
            GJTrophy trophy = null;

            foreach (string ngline in ng)
            {
                var nglinec = ngline.Trim();
                var p       = nglinec.IndexOf(':');
                var fld     = nglinec.Substring(0, p).ToLower();
                var val     = nglinec.Substring(p + 1);
                if (val[0] == '"')
                {
                    val = val.Substring(1);
                }
                if (val[val.Length - 1] == '"')
                {
                    val = val.Substring(0, val.Length - 1);
                }
                chat($"{fld}:\t'{val}'");
                switch (fld)
                {
                case "success":
                    if (val != "true")
                    {
                        chat("No Success!"); return(null);
                    }
                    break;

                case "id":
                    try {
                        var i = Int32.Parse(val);
                        trophy    = new GJTrophy(user);
                        ret[i]    = trophy;
                        trophy.ID = i;
                    } catch {
                        Console.WriteLine($"Parsing index number ({val}) failed! Is something wrong with the server here?");
                    }
                    break;

                case "title":
                    if (trophy == null)
                    {
                        Console.WriteLine($"Trying to attach a {fld} to a non-existent trophy!"); return(null);
                    }
                    trophy.Name = val;
                    break;

                case "difficulty":
                    if (trophy == null)
                    {
                        Console.WriteLine($"Trying to attach a {fld} to a non-existent trophy!"); return(null);
                    }
                    trophy.TrophyClass = val;
                    break;

                case "description":
                    if (trophy == null)
                    {
                        Console.WriteLine($"Trying to attach a {fld} to a non-existent trophy!"); return(null);
                    }
                    trophy.Description = val;
                    break;

                case "image_url":
                    if (trophy == null)
                    {
                        Console.WriteLine($"Trying to attach a {fld} to a non-existent trophy!"); return(null);
                    }
                    trophy.Image_Url = val;
                    break;

                case "achieved":
                    if (trophy == null)
                    {
                        Console.WriteLine($"Trying to attach a {fld} to a non-existent trophy!"); return(null);
                    }
                    trophy.AchievedDate = val;
                    break;

                default: throw new Exception($"Unknown field {fld}({val})");     // debug! In normal use this line should be on comment
                }
            }
            return(ret);
        }
        internal Dictionary <string, string> qreq(string action, string querystring)
        {
            var self = this;

            return(GJAPI.gjrequest(action, querystring + self.idstring + self.gamestuff, self.gamekey));
        }
 static void chat(string msg) => GJAPI.chat(msg);