From ec2d55cdf455174f7b6bb2731ab82b6988437925 Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Wed, 26 Feb 2014 17:16:02 +0100 Subject: [PATCH 1/6] Update README.md Temp save. --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 520aaaf..83a077f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,64 @@ Eve Online Library.NET -======= += + +Eve Online Library.NET is a C# wrapper for CCPs Eve Online API and other popular Eve Online APIs. + +#### CCP API Requests +The library exposes all CCPs Eve API functions through an easy to use API, using C# programming and naming conventions. It uses a structure similar to how the API URIs are structured. See [APIv2] (http://wiki.eve-id.net/APIv2_Page_Index) for a reference. + +The basic structure is as follows: +- `CharacterKey` and `CorporationKey` exposes requests prefixed with /account/. +- `Character` exposes all requests prefixed with /char/. +- `Corporation` exposes all requests prefixed with /corp/. +- `Map` exposes all requests prefixed with /map/. +- `Image` exposes all requests to image.eveonline.com. +- `Core` exposes all other API requests. + +Map, Image and Core does not require any state, and are accessible through any EoLib instance, eg: + + var lib = new EoLib(); + lib.Core.GetStuffFromApi(); + +Character and Corporation require a valid Eve Online API Key, which consist of a key id and a vertification code. +To access these, you need to create a new CharacterKey or CorporationKey. An example using id '123' and vcode 'qwerty': + + var key = EoLib.GetCharacterKey(123, qwerty); + +Using this key, you can access all /account/ calls (note: Only CharacterKey provides GetAccountInfo()): + + key.GetApiKeyInfo(); + +To get access to Character objects, simply access key.Characters, which lazily loads a list of Character objects for all characters this key has access to. You can then pick the character you want, and access the API through it. + + var character = key.Characters.First(); + character.GetCharacterSheet(); + +You can also use LINQ to find a specific character, eg: + + var character = key.Characters.First(c => c.CharacterId = 12345); + var Test = key.Characters.First(c => c.CharacterName = "Test); + +CorporationKey objects work the same way, except it provides access to a single Corporation object, rather than a list of Character objects. + +#### CCP API Responses +All API calls return results in the form of XmlResponse objects, where T is the specific type of response. These objects reflect the structure of the actual XML responses, with a few exceptions. All properties have been renamed in compliance with C# naming conventions, eg. 'characterID' is converted to CharacterId. Also, some properties have been renamed for clarity and consistency, where most changes are extensions of the original names. + +Every XML response has a Version, CachedUntil, Result and Error property. Result is of type T, and contains all request specific data. Error is null unless the API returned an error, in which case it provides access to the error code and description. + +#### CCP API Caching +The library uses the default HttpWebRequest cache (IE Cache) by default, adhering to the CachedUntil values provided by CCP on each request. + +#### CCP API Async +- +The library is currently not threaded in any way. There's not really room for parallelism in the requests, so the only use would be for offloading eg. a GUI thread. I've left this responsibility to the client code, but this can easily be changed if needed. + + + + + +Eve Central API +- + + + -Eve Online Library.NET is a wrapper for CCPs Eve Online API and eve-central.com Market API. From 18c9b5a70200fd5d0fa62b1495d579e4fd142ff2 Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Wed, 26 Feb 2014 17:48:48 +0100 Subject: [PATCH 2/6] Update README.md --- README.md | 66 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 83a077f..539e857 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,18 @@ Eve Online Library.NET = -Eve Online Library.NET is a C# wrapper for CCPs Eve Online API and other popular Eve Online APIs. - -#### CCP API Requests -The library exposes all CCPs Eve API functions through an easy to use API, using C# programming and naming conventions. It uses a structure similar to how the API URIs are structured. See [APIv2] (http://wiki.eve-id.net/APIv2_Page_Index) for a reference. - -The basic structure is as follows: +Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and other popular Eve Online APIs. + +## Features +- Easy to use. +- XML configuration through app.config. +- Access to all popular APIs through one library. +- Adheres to C# and .NET conventions. +- Provides caching for CCP API requests. +- Modular and open source; you can easily change the caching, serialization or any other part of the library. + +## CCP API +The library exposes all CCPs Eve API functions through an easy to use API, using C# programming and naming conventions. It uses a structure similar to how the API URIs are structured. See [APIv2] (http://wiki.eve-id.net/APIv2_Page_Index) for a reference. The basic structure is as follows: - `CharacterKey` and `CorporationKey` exposes requests prefixed with /account/. - `Character` exposes all requests prefixed with /char/. - `Corporation` exposes all requests prefixed with /corp/. @@ -14,51 +20,59 @@ The basic structure is as follows: - `Image` exposes all requests to image.eveonline.com. - `Core` exposes all other API requests. +#### Requests Map, Image and Core does not require any state, and are accessible through any EoLib instance, eg: - + var lib = new EoLib(); - lib.Core.GetStuffFromApi(); + var data =lib.Core.GetStuffFromApi(); Character and Corporation require a valid Eve Online API Key, which consist of a key id and a vertification code. -To access these, you need to create a new CharacterKey or CorporationKey. An example using id '123' and vcode 'qwerty': +To access these, you need to create a new `CharacterKey` or `CorporationKey`. An example using id '123' and vcode 'qwerty': var key = EoLib.GetCharacterKey(123, qwerty); -Using this key, you can access all /account/ calls (note: Only CharacterKey provides GetAccountInfo()): +Using this key, you can access all /account/ calls (note: Only `CharacterKey` provides `GetAccountInfo()`): - key.GetApiKeyInfo(); + var data = key.GetApiKeyInfo(); To get access to Character objects, simply access key.Characters, which lazily loads a list of Character objects for all characters this key has access to. You can then pick the character you want, and access the API through it. var character = key.Characters.First(); - character.GetCharacterSheet(); + var data = character.GetCharacterSheet(); You can also use LINQ to find a specific character, eg: - var character = key.Characters.First(c => c.CharacterId = 12345); - var Test = key.Characters.First(c => c.CharacterName = "Test); + var character = key.Characters.First(c => c.CharacterId == 12345); + var peter = key.Characters.First(c => c.CharacterName == "Peter"); -CorporationKey objects work the same way, except it provides access to a single Corporation object, rather than a list of Character objects. +`CorporationKey` objects work the same way, except it provides access to a single `Corporation` object, rather than a list of `Character` objects. -#### CCP API Responses -All API calls return results in the form of XmlResponse objects, where T is the specific type of response. These objects reflect the structure of the actual XML responses, with a few exceptions. All properties have been renamed in compliance with C# naming conventions, eg. 'characterID' is converted to CharacterId. Also, some properties have been renamed for clarity and consistency, where most changes are extensions of the original names. - -Every XML response has a Version, CachedUntil, Result and Error property. Result is of type T, and contains all request specific data. Error is null unless the API returned an error, in which case it provides access to the error code and description. - -#### CCP API Caching -The library uses the default HttpWebRequest cache (IE Cache) by default, adhering to the CachedUntil values provided by CCP on each request. - -#### CCP API Async -- -The library is currently not threaded in any way. There's not really room for parallelism in the requests, so the only use would be for offloading eg. a GUI thread. I've left this responsibility to the client code, but this can easily be changed if needed. +#### Responses +All API calls return results in the form of `XmlResponse` objects, where `T` is the specific type of response. These objects reflect the structure of the actual XML responses, with a few exceptions. All properties have been renamed in compliance with C# naming conventions, eg. 'characterID' is converted to CharacterId. Also, some properties have been renamed for clarity and consistency, where most changes are extensions of the original names. +Every XML response has a Version, CachedUntil, Result and Error property. Result is of type T, and contains all request specific data. Error is null unless the API returned an error, in which case it provides access to the error code and description. A later version will possibly use exceptions instead. + var data = api.Core.GetServerStatus(); + if (data.Result.Error != null) { + // handle the error + Logger.Log(data.Result.Error.Code + data.Result.Error.Description); + } else { + var players = data.Result.PlayersOnline; + } +#### Caching +The library uses the default HttpWebRequest cache (IE Cache) by default, adhering to the CachedUntil values provided by CCP on each request. +#### Threading +The library is currently not threaded in any way. There's not really room for parallelisation in the requests, so the only use would be for offloading eg. a GUI thread. I've left this responsibility to the client code, but this may change. Eve Central API - +Work in progress. +EveMarketData API +- +Work in progress. From ae6230988f31faa48a86fbb6a241c8660a4518ed Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Wed, 26 Feb 2014 18:18:27 +0100 Subject: [PATCH 3/6] Update README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 539e857..f3b84f4 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,21 @@ Eve Online Library.NET Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and other popular Eve Online APIs. ## Features -- Easy to use. -- XML configuration through app.config. -- Access to all popular APIs through one library. -- Adheres to C# and .NET conventions. -- Provides caching for CCP API requests. -- Modular and open source; you can easily change the caching, serialization or any other part of the library. +* Easy to use. +* XML configuration through app.config. +* Access to all popular APIs through one library. +* Adheres to C# and .NET conventions. +* Provides caching for CCP API requests. +* Modular and open source; you can easily change the caching, serialization or any other part of the library. ## CCP API The library exposes all CCPs Eve API functions through an easy to use API, using C# programming and naming conventions. It uses a structure similar to how the API URIs are structured. See [APIv2] (http://wiki.eve-id.net/APIv2_Page_Index) for a reference. The basic structure is as follows: -- `CharacterKey` and `CorporationKey` exposes requests prefixed with /account/. -- `Character` exposes all requests prefixed with /char/. -- `Corporation` exposes all requests prefixed with /corp/. -- `Map` exposes all requests prefixed with /map/. -- `Image` exposes all requests to image.eveonline.com. -- `Core` exposes all other API requests. +* `CharacterKey` and `CorporationKey` exposes requests prefixed with /account/. +* `Character` exposes all requests prefixed with /char/. +* `Corporation` exposes all requests prefixed with /corp/. +* `Map` exposes all requests prefixed with /map/. +* `Image` exposes all requests to image.eveonline.com. +* `Core` exposes all other API requests. #### Requests Map, Image and Core does not require any state, and are accessible through any EoLib instance, eg: From bbd4a221c106a9548a0e9b89ca7def711e30769d Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Wed, 26 Feb 2014 18:18:48 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3b84f4..f133e8d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Eve Online Library.NET Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and other popular Eve Online APIs. -## Features +### Features * Easy to use. * XML configuration through app.config. * Access to all popular APIs through one library. From 2cc985e964db3ffa2c9304969d3fd93ffac60c9d Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Wed, 26 Feb 2014 18:20:27 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f133e8d..f2c82f1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and * Adheres to C# and .NET conventions. * Provides caching for CCP API requests. * Modular and open source; you can easily change the caching, serialization or any other part of the library. +* A fairly comprehensive set of unit tests, including static xml tests for calls requiring authentication. ## CCP API The library exposes all CCPs Eve API functions through an easy to use API, using C# programming and naming conventions. It uses a structure similar to how the API URIs are structured. See [APIv2] (http://wiki.eve-id.net/APIv2_Page_Index) for a reference. The basic structure is as follows: From 9d58c70d4555c37742c941c1f2f0eff77c5631ae Mon Sep 17 00:00:00 2001 From: Lars Kristian Dahl Date: Thu, 27 Feb 2014 12:09:55 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f2c82f1..d5279dd 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ The library exposes all CCPs Eve API functions through an easy to use API, using #### Requests Map, Image and Core does not require any state, and are accessible through any EoLib instance, eg: - var lib = new EoLib(); - var data =lib.Core.GetStuffFromApi(); + var lib = EveLib.Create(); + var data = lib.Core.GetStuffFromApi(); Character and Corporation require a valid Eve Online API Key, which consist of a key id and a vertification code. To access these, you need to create a new `CharacterKey` or `CorporationKey`. An example using id '123' and vcode 'qwerty': - var key = EoLib.GetCharacterKey(123, qwerty); + var key = EveLib.GetCharacterKey(123, "qwerty"); Using this key, you can access all /account/ calls (note: Only `CharacterKey` provides `GetAccountInfo()`): @@ -41,7 +41,7 @@ To get access to Character objects, simply access key.Characters, which lazily l var character = key.Characters.First(); var data = character.GetCharacterSheet(); -You can also use LINQ to find a specific character, eg: +You can also use LINQ and lambdas to find a specific character, eg: var character = key.Characters.First(c => c.CharacterId == 12345); var peter = key.Characters.First(c => c.CharacterName == "Peter"); @@ -53,7 +53,7 @@ All API calls return results in the form of `XmlResponse` objects, where `T` Every XML response has a Version, CachedUntil, Result and Error property. Result is of type T, and contains all request specific data. Error is null unless the API returned an error, in which case it provides access to the error code and description. A later version will possibly use exceptions instead. - var data = api.Core.GetServerStatus(); + var data = lib.Core.GetServerStatus(); if (data.Result.Error != null) { // handle the error Logger.Log(data.Result.Error.Code + data.Result.Error.Description);