Ejemplo n.º 1
0
 /// <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();
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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 }
     };
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 public void test() {
     CharacterKey key = new CharacterKey(1, "");
     var result = key.GetAccountStatus().Result;
 }