예제 #1
0
            public static async Task <BRInfo> BRInfo(string gamertag, platforms platform)
            {
                try
                {
                    var stats = await Stats(gamertag, platform);

                    var lifetime = stats.data.lifetime;
                    if (lifetime == null)
                    {
                        return(null);
                    }
                    var br      = lifetime.mode.br?.properties;
                    var plunder = lifetime.mode.br_dmz?.properties;
                    var all     = lifetime.mode.br_all?.properties;
                    var info    = new BRInfo
                    {
                        br      = br.CastClass <BRInfo.Info>(),
                        plunder = plunder.CastClass <BRInfo.Info>(),
                        all     = all.CastClass <BRInfo.Info>()
                    };
                    return(info);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Exception: {ex.Message}");
                    return(null);
                }
            }
예제 #2
0
 public static async Task <WZStats> Stats(string gamertag, platforms platform)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         var type = platform == platforms.uno ? "id" : "gamer";
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         gamertag = Uri.EscapeDataString(gamertag);
         var url =
             $"{defaultUri}/stats/cod/v1/title/mw/platform/{platform}/{type}/{gamertag}/profile/type/wz";
         return(await Handler.GET <WZStats>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #3
0
 public static async Task <dynamic> Search(string query, platforms platform = platforms.all)
 {
     try
     {
         query = Uri.EscapeDataString(query);
         var url = $"{defaultUri}/crm/cod/v2/platform/{platform}/username/{query}/search";
         return(await Handler.GET(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #4
0
        private FixProblemInstruction checkAndGetInstruction(string relativePath, platforms platform)
        {
            EnablePluginForPlatform instr = null;
            var imp = AssetImporter.GetAtPath(relativePath) as PluginImporter;

            if (imp == null)
            {
                return(instr);
            }
            bool isChecked;

            switch (platform)
            {
            case platforms.any:
                isChecked = imp.GetCompatibleWithAnyPlatform();
                break;

            case platforms.editor:
                isChecked = imp.GetCompatibleWithEditor();
                break;

            case platforms.android:
                isChecked = imp.GetCompatibleWithPlatform(BuildTarget.Android);
                break;

            case platforms.ios:
                isChecked = imp.GetCompatibleWithPlatform(BuildTarget.iOS);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(platform), platform, null);
            }

            if (isChecked)
            {
                return(instr);
            }
            var desc = "Plugin " + relativePath + " should be enabled for platform: " + platform +
                       ".\n";

            if (relativePath.Contains(AppodealUnityUtils.combinePaths("Assets", "Plugins", "Android")))
            {
                desc +=
                    "If you wan't to exclude this network from your game, don't forget to add Appodeal.disableNetwork(networkname) before initialization.";
            }
            instr = new EnablePluginForPlatform(desc, true, relativePath, platform);

            return(instr);
        }
예제 #5
0
 public static async Task <dynamic> setProfileVisibility(platforms platform, friendVisibility visibility)
 {
     try
     {
         var blockedEnums = new[] { platforms.acti, platforms.uno, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         var url = $"https://profile.callofduty.com/cod/setGamerPreference/{platform}/data_visible/{visibility}";
         return(await Handler.POST(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #6
0
 public static async Task <string> Leaderboard(int page, platforms platform)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.acti, platforms.uno, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         var url = $"{defaultUri}/leaderboards/v2/title/mw/platform/{platform}/time/alltime/type/core/mode/career/page/{page}";
         return(await Handler.GET <string>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #7
0
 public static async Task <dynamic> getPlatforms(string gamertag, platforms platform)
 {
     try
     {
         var type = platform == platforms.uno ? "id" : "gamer";
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         gamertag = Uri.EscapeDataString(gamertag);
         var url = $"{defaultUri}/crm/cod/v2/accounts/platform/{platform}/{type}/{gamertag}";
         return(await Handler.GET(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #8
0
        public static async Task <codPoints> getCodPoints(string gamertag, platforms platform)
        {
            var blockedEnums = new[] { platforms.all };

            if (blockedEnums.Contains(platform))
            {
                throw new Exception($"{platform} not a valid platform for this endpoint.");
            }
            var type = platform == platforms.uno ? "id" : "gamer";

            if (platform == platforms.acti)
            {
                platform = platforms.uno;
            }
            gamertag = Uri.EscapeDataString(gamertag);
            var url = $"{defaultUri}/inventory/v1/title/mw/platform/{platform}/{type}/{gamertag}/currency";

            return(await Handler.POST <codPoints>(url));
        }
예제 #9
0
 public static async Task <dynamic> friendAction(string gamertag, platforms platform, friendActions action)
 {
     try
     {
         var type = platform == platforms.uno ? "id" : "gamer";
         gamertag = Uri.EscapeDataString(gamertag);
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         var url = $"{defaultUri}/codfriends/v1/{action}/{platform}/{type}/{gamertag}";
         return(await Handler.POST(url, JsonConvert.SerializeObject(new {}), "text/plain"));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #10
0
        public void Add()
        {
            if (Name == null || Site == null || PlatformsID <= 0)
            {
                return;
            }

            mydbContext mydb     = new mydbContext();
            platforms   platform = mydb.platforms.Single(el => el.id == PlatformsID);

            programs prog = new programs
            {
                name      = Name,
                off_site  = Site,
                platforms = platform
            };

            mydb.programs.Add(prog);
            mydb.SaveChanges();
        }
예제 #11
0
 public static async Task <MWMapList> MapList(platforms platform)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         var url = $"{defaultUri}/ce/v1/title/mw/platform/{platform}/gameType/mp/communityMapData/availability";
         return(await Handler.GET <MWMapList>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #12
0
 public static async Task <FullMatchData> FullMatchData(string matchId, platforms platform)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         var url = $"{defaultUri}/crm/cod/v2/title/mw/platform/{platform}/fullMatch/wz/{matchId}/en";
         return(await Handler.GET <FullMatchData>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #13
0
 public static async Task <Analysis> Analysis(string gamertag, platforms platform)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         var type = platform == platforms.uno ? "id" : "gamer";
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         gamertag = Uri.EscapeDataString(gamertag);
         var url = $"{defaultUri}/ce/v2/title/mw/platform/{platform}/gametype/all/{type}/{gamertag}/summary/match_analysis/contentType/full/end/0/matchAnalysis/mobile/en";
         return(await Handler.GET <Analysis>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }
예제 #14
0
 public static async Task <MatchInfo> MatchInfo(string gamertag, platforms platform, long start = 0, long end = 0)
 {
     try
     {
         var blockedEnums = new[] { platforms.steam, platforms.all };
         if (blockedEnums.Contains(platform))
         {
             throw new Exception($"{platform} not a valid platform for this endpoint.");
         }
         var type = platform == platforms.uno ? "id" : "gamer";
         if (platform == platforms.acti)
         {
             platform = platforms.uno;
         }
         gamertag = Uri.EscapeDataString(gamertag);
         var url = $"{defaultUri}/crm/cod/v2/title/mw/platform/{platform}/{type}/{gamertag}/matches/wz/start/{start}/end/{end}";
         return(await Handler.GET <MatchInfo>(url));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Exception: {ex.Message}");
         throw new Exception(ex.Message);
     }
 }