コード例 #1
0
ファイル: EventHandler.cs プロジェクト: kraxarn/dashe4
        private int GetPlayerLevel(ulong userID64)
        {
            var level = 0;

            /*
             * TODO
             * Like some other Steam Web API calls,
             * this can be called using the methods
             * provided by SteamKit2 instead of doing
             * it like this. Before that though, try
             * and make sure it works properly
             */

            if (kraxbot.TryGetJson($"http://api.steampowered.com/IPlayerService/GetSteamLevel/v1/?key={kraxbot.Api.Steam}&steamid={userID64}", out var json))
            {
                if (json.response.player_level != null)
                {
                    level = (int)json.response.player_level;
                }
            }

            return(level);
        }