/// <summary> /// Creates a new Character. If the CharacterKey is initialized, the Character will also be initialized with data from /// the Key. /// </summary> /// <param name="apiKey">A valid CharacterKey</param> /// <param name="characterId">A valid Eve Online Character ID</param> public Character(CharacterKey apiKey, long characterId) { Contract.Requires(apiKey != null); ApiKey = apiKey; CharacterId = characterId; if (ApiKey.IsInitialized) ensureInitialized(); }
internal Character(CharacterKey apiKey, ApiKeyInfo.ApiKeyEntity entity) { ApiKey = apiKey; CharacterId = entity.CharacterId; CharacterName = entity.CharacterName; CorporationId = entity.CorporationId; CorporationName = entity.CorporationName; AllianceId = entity.AllianceId; AllianceName = entity.AllianceName; FactionId = entity.FactionId; FactionName = entity.FactionName; BaseUri = apiKey.BaseUri; IsInitialized = true; }
public async Task<model.Character> CharacterFromApi(model.ApiKey apiKey, int charId) { var charKey = new CharacterKey(apiKey.Id, apiKey.Secret); await charKey.InitAsync(); var apiChar = new ApiCharacter(charKey, charId); var charInfo = (await apiChar.GetCharacterInfoAsync()).Result; var charSheet = (await apiChar.GetCharacterSheetAsync()).Result; var skillQueue = (await apiChar.GetSkillQueueAsync()).Result; return new model.Character { Id = charId, Name = charInfo.CharacterName, CorpName = charInfo.CorporationName, CloneName = charSheet.CloneName, CloneSP = charSheet.CloneSkillPoints, SP = charInfo.SkillPoints, SecStatus = charInfo.SecurityStatus, SkillQueue = SkillQueue(skillQueue), ApiKey = new model.ApiKey { Id = charKey.KeyId, Secret = charKey.VCode } }; }
/// <summary> /// Creates a new Character using the provided key data and character id. /// </summary> /// <param name="keyId">Eve API Key ID</param> /// <param name="vCode">Eve API Verification Code (vCode)</param> /// <param name="characterId">Eve Character ID</param> public Character(int keyId, string vCode, long characterId) { ApiKey = new CharacterKey(keyId, vCode); CharacterId = characterId; }
public void test() { CharacterKey key = new CharacterKey(1, ""); var result = key.GetAccountStatus().Result; }