Пример #1
0
        public async Task <IActionResult> GetFullCharacterAvatar(string characterName)
        {
            var character = await RankingCharacter.GetCharacter(characterName);

            CharacterLook look = character.GetAvatarLook();

            int[] items = new int[] { look.Cap, look.Cape, look.Coat, look.EarAccessory, look.EyeAccessory, look.Face, look.FaceAccessory, look.Glove, look.Hair, look.Pants, look.Shield, look.Shoes, look.Weapon }
            .Where(c => c != -1).ToArray();

            return(LocalRedirect($"/api/gms/latest/character/{2000 + look.Skin}/{string.Join(",", items)}"));
        }
Пример #2
0
        public async Task <IActionResult> GetCharacterAvatar(string characterName)
        {
            var character = await RankingCharacter.GetCharacter(characterName);

            byte[] avatarData = System.IO.File.ReadAllBytes(Path.Combine(ContentRootPath, "wwwroot", "images/no-avatar.png"));

            try
            {
                avatarData = await character.GetAvatar();
            }
            catch (Exception ex)
            {
                // Nexon's Avatar stuff is broken atm, we probably don't need to log this.
            }

            return(File(avatarData, "image/png"));
        }
Пример #3
0
        public async Task <IActionResult> GetCharacter(string characterName)
        {
            var character = await RankingCharacter.GetCharacter(characterName);

            return(Json(character));
        }