Pages: [1] 2 :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Cuhlen
Crucible Labs
0
|
Posted - 2012.06.03 14:54:00 -
[1] - Quote
I've decided to release the C# library I wrote for accessing the public eve API.
While there are other .net libraries out there, none that I know of both support all of the API calls, and include the full source.
EVE.Net supports all current API calls, including the image server, contains the full C# source code and is released under the Boost library. Modify/use as you see fit.
You can download it from here. EVE.Net 1.0
The project is written in Visual Studio 2010. You will need some version of that to compile it, though converting it to 2005 or 2008 should be trivial. The library is compiled against .NET 2.0, so it should be mono compatible, though I have not tested that.
The only API calls I could not test are the ones that deal with sovereignty and outposts. If any 0.0 corp directors get a chance to test those calls, I would appreciate it if you would let me know if they work or not.
Example use:
CharacterSheet charSheet = new CharacterSheet(keyID, vCode, charID); charSheet.Query();
Console.WriteLine(" Name: {0}", charSheet.name); Console.WriteLine(" ID: {0}", charSheet.characterID); Console.WriteLine(" Date of Birth: {0}", charSheet.DoB); Console.WriteLine(" Race: {0}", charSheet.race); Console.WriteLine(" Bloodline: {0}", charSheet.bloodLine);
Email me with any problems you may have.
|
Osku Rei
Black Aces Against ALL Authorities
9
|
Posted - 2012.06.06 13:19:00 -
[2] - Quote
Cuhlen wrote:I've decided to release the C# library I wrote for accessing the public eve API. While there are other .net libraries out there, none that I know of both support all of the API calls, and include the full source. EVE.Net supports all current API calls, including the image server, contains the full C# source code and is released under the Boost library. Modify/use as you see fit. You can download it from here. EVE.Net 1.0The project is written in Visual Studio 2010. You will need some version of that to compile it, though converting it to 2005 or 2008 should be trivial. The library is compiled against .NET 2.0, so it should be mono compatible, though I have not tested that. The only API calls I could not test are the ones that deal with sovereignty and outposts. If any 0.0 corp directors get a chance to test those calls, I would appreciate it if you would let me know if they work or not. Example use: CharacterSheet charSheet = new CharacterSheet(keyID, vCode, charID); charSheet.Query(); Console.WriteLine(" Name: {0}", charSheet.name); Console.WriteLine(" ID: {0}", charSheet.characterID); Console.WriteLine(" Date of Birth: {0}", charSheet.DoB); Console.WriteLine(" Race: {0}", charSheet.race); Console.WriteLine(" Bloodline: {0}", charSheet.bloodLine); Email me with any problems you may have.
One thing I noticed is that you don't follow 'CamelCase' naming convention for properties (standard in all(?) CSD's, including microsofts) I havent looked at any of the code, but following a standard CSD for a public released API might be a good idea. Next generation of lottery tracker coming soon! http://evelotterytracker.com/
Please like my post if it has helped you :) |
Etil DeLaFuente
New Eclipse Initiative Mercenaries
9
|
Posted - 2012.06.06 17:34:00 -
[3] - Quote
that's because he's using reflection to map an xml attribute to the object property. You could use the same method by declaring a custom attribute on object properties so you can respect CamelCase.
Good work otherwise, even if reflection is damn slow. |
Cuhlen
Crucible Labs
0
|
Posted - 2012.06.06 17:47:00 -
[4] - Quote
Etil DeLaFuente wrote:that's because he's using reflection to map an xml attribute to the object property. You could use the same method by declaring a custom attribute on object properties so you can respect CamelCase.
Good work otherwise, even if reflection is damn slow.
That's exactly right.
There are a few cases in the xml that are not consistent, so I did include a custom attribute (XmlIdentifier) which could be used to do just that. In fact, that was how I started the library, but I found that I was adding the custom attribute to each public property - and I felt that besides being somewhat tedious, it needlessly complicated the library.
Anyway - library design is interesting. The decisions you make are always tradeoffs between something.
|
Etil DeLaFuente
New Eclipse Initiative Mercenaries
9
|
Posted - 2012.06.06 22:01:00 -
[5] - Quote
All the API are read only so you could expose interfaces instead of classes and keep your implementation private. It would solve the problem without rewriting everything. |
Takahiro Tanaka
Tanaka Stuff and Supplies
0
|
Posted - 2012.06.22 17:59:00 -
[6] - Quote
Excellent work !
I tried to extract some wallet transactions. Seems that the price of an item gets parsed without the decimal point.
For example: Tritanium shows in the XML as follows .... price="6.28" .... The value in the WalletTransactions.Transaction.price shows 628.00 |
Cuhlen
Crucible Labs
0
|
Posted - 2012.06.23 22:32:00 -
[7] - Quote
Takahiro Tanaka wrote:Excellent work !
I tried to extract some wallet transactions. Seems that the price of an item gets parsed without the decimal point.
For example: Tritanium shows in the XML as follows .... price="6.28" .... The value in the WalletTransactions.Transaction.price shows 628.00
Can you double-check this Takahiro? I am not able to reproduce the problem.
Xml output
Test result
|
Takahiro Tanaka
Tanaka Stuff and Supplies
0
|
Posted - 2012.06.24 11:26:00 -
[8] - Quote
Problem identified. It has to do with the localization settings in Windows. In my culture we use an comma instead of an dot for the decimal point, that caused the issue.
Example how it works on my machine, without the cultureinfo it would ignore the dot:
string price = "10.95"; decimal dec; decimal.TryParse(price, NumberStyles.Number, CultureInfo.GetCultureInfo("EN"), out dec);
Also see this thread on stackoverflow.
If you could adapt your parsing process accordingly, it will work on all machines.
Thanks again for this great library ! |
Desmont McCallock
186
|
Posted - 2012.06.24 11:48:00 -
[9] - Quote
@Cuhlen Try applying CA (Code Analysis) rules for Globalization in your project. http://msdn.microsoft.com/en-us/library/dd264912 Overall it's a good practice to CA any project. |
Cuhlen
Crucible Labs
0
|
Posted - 2012.06.24 20:36:00 -
[10] - Quote
That's good advice. Thanks. I've sent Takahiro a build that should resolve the issue. I'll update things here when I hear back from him.
|
|
Cuhlen
Crucible Labs
0
|
Posted - 2012.06.25 00:22:00 -
[11] - Quote
An update has been posted which should resolve the issue.
Thanks for the help guys.
|
Takahiro Tanaka
Tanaka Stuff and Supplies
2
|
Posted - 2012.06.25 09:23:00 -
[12] - Quote
Confirmed, I get decimal points now too
Good work, keep it up mate. |
Cuhlen
Crucible Labs
5
|
Posted - 2012.07.04 16:20:00 -
[13] - Quote
Just an update...
As I mentioned, I had considered adding a data access layer to the API. However, I would prefer to leave the EVE.Net api small and focused.
That said, I am in the process of writing an additional library which provides data access to the static database dump provided by CCP. Currently, I have the library accessing the database, and have written some basic accessor methods, such as:
public DataTable GetDataTable(string sql_query, params object[] args)
While developing all of this, I wrote a test application which I'm considering releasing as well, (with some cleanup, it would make a decent EVE application development environment). Here are some screenshots...
api test manage accounts sql query docking
The sql query view has syntax highlighting for SQL and for the data tables and columns. I am still toying with the idea of adding intellisence to the editor, but that will likely be down the road a bit.
I've still got plenty of work to do on the data access layer, as I want to provide methods to convert EVE.Net results to data that is more usable in a UI. The test application is written in C# using WPF, so I will probably have the data access layer convert api results to view models that WPF can work with.
The only real gotcha to this data access layer is the size. The test application installer is nearly 80 megs, and uncompresses to around 400mb, nearly all of that is the sqlite database itself.
|
Cuhlen
Blood Raven Assault Squadron
5
|
Posted - 2012.07.15 18:14:00 -
[14] - Quote
v1.2 has been released to resolve an issue with a 'Method not found' exception for bool.Parse.
|
Cuhlen
Blood Raven Assault Squadron
5
|
Posted - 2012.07.19 14:24:00 -
[15] - Quote
Update posted that resolves an issue with cache file names being too long in certain cases. (very long argument strings for api requests).
|
Cryten Jones
Advantage Inc The Matari Consortium
78
|
Posted - 2012.08.13 21:17:00 -
[16] - Quote
Hi there.
I am VERY new to C# etc and was looking for a pointer. I have learned enough PHP, SQL and javascript on my own to use the PHP based api's but I want to have a play with some windows based stuff.
My issue is I have no idea what to do with the eve.net zip. I am assuming that I need to compile the contents and then make it available to my actual project...
I am using Vis Studio Express for C#
Any help would be much appreciated.
Thanks
|
Cuhlen
Blood Raven Assault Squadron
5
|
Posted - 2012.08.14 19:56:00 -
[17] - Quote
Cryten Jones wrote: I am VERY new to C# etc and was looking for a pointer. I have learned enough PHP, SQL and javascript on my own to use the PHP based api's but I want to have a play with some windows based stuff.
My issue is I have no idea what to do with the eve.net zip. I am assuming that I need to compile the contents and then make it available to my actual project...
In a nutshell, yes.
The zip file contains a visual studio project file 'Eve.Net.csproj' that you can add to your Visual Studio solution. You will need to essentially;
(In Visual Studio) Create a solution for your project. This will create a solution file and a project file for your project. In the solution explorer, 'add|existing', browse to the eve.net project file you downloaded and add that. In your solution, you should now have both projects. Under your new one, right click and select 'add reference', select the 'projects' tab and select Eve.Net
You should now be able to use the eve.net library in your project.
Alternately, at the eve.net project wiki you can download the entire source project which includes an 'AppTemplate' visual studio solution which I use to test Eve.Net - you can use that as a starting point for your own project. There are instructions on the wiki page (under the 'Source' option) for downloading the code that way.
|
Virppi Jouhinen
Xiphias Ltd.
6
|
Posted - 2012.08.15 14:25:00 -
[18] - Quote
Looks very interesting, might switch Elinor to your lib.
102KB is a very convincing argument vs the 6MB lib I currently use. Elinor - lightweight semi-automatic daytrading helper Current version: 1.0.10 Beta |
Cuhlen
Blood Raven Assault Squadron
6
|
Posted - 2012.08.15 16:45:00 -
[19] - Quote
Virppi Jouhinen wrote:Looks very interesting, might switch Elinor to your lib.
102KB is a very convincing argument vs the 6MB lib I currently use.
That's a pretty significant difference. I can only guess that you must get alot more functionality. If all you need though is direct API access (no database information), then yeah, Eve.Net is pretty lightweight. For me though, the argument always came back to the source code. I just don't like using libraries that I don't have the source to.
|
Cryten Jones
Advantage Inc The Matari Consortium
78
|
Posted - 2012.08.17 10:35:00 -
[20] - Quote
Thanks for the help :-)
-CJ
|
|
Virppi Jouhinen
Xiphias Ltd.
6
|
Posted - 2012.08.19 23:25:00 -
[21] - Quote
So I'm currently porting and I've run into two problems:
1. I'd like to initialize the API/Library beforehand as the first call takes quite long and I can spare the time during startup but would like the first experience of the users rather not to be to wait a few seconds. What would be the easiest way to do this?
2. The CharacterSheet.Query() method crashes for one of my chars because one roleID exceeds the int limit in ParseRowset(parent, property, xml); It's easily fixed by making the roleID property long instead of int. Elinor - lightweight semi-automatic daytrading helper Current version: 1.1.1 Beta |
Cuhlen
Blood Raven Assault Squadron
6
|
Posted - 2012.08.20 19:18:00 -
[22] - Quote
Virppi Jouhinen wrote:So I'm currently porting and I've run into two problems:
1. I'd like to initialize the API/Library beforehand as the first call takes quite long and I can spare the time during startup but would like the first experience of the users rather not to be to wait a few seconds. What would be the easiest way to do this?
2. The CharacterSheet.Query() method crashes for one of my chars because one roleID exceeds the int limit in ParseRowset(parent, property, xml); It's easily fixed by making the roleID property long instead of int.
Well, I'm not sure why the first call takes so long for you, but one idea would be to use a background worker to make a call to the API status page (which requires no API key data), something like;
// PSEUDO CODE ALERT--- BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += delegate(object sender, DoWorkEventArgs e) { EVE.Net.ServerStatus status = new EVE.Net.ServerStatus(); status.Query(); };
worker.RunWorkerAsync();
Sorry about the roleID, the API wiki is --vague-- on which IDs should be ints and which longs. Thanks for the report though, I'll get that updated in the |
Virppi Jouhinen
Xiphias Ltd.
6
|
Posted - 2012.08.20 19:24:00 -
[23] - Quote
Cuhlen wrote: Well, I'm not sure why the first call takes so long for you, but one idea would be to use a background worker to make a call to the API status page (which requires no API key data), something like;
// PSEUDO CODE ALERT--- BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += delegate(object sender, DoWorkEventArgs e) { EVE.Net.ServerStatus status = new EVE.Net.ServerStatus(); status.Query(); };
worker.RunWorkerAsync();
Sorry about the roleID, the API wiki is --vague-- on which IDs should be ints and which longs. Thanks for the report though, I'll get that updated in the
Running a BackgroundWorker on startup checking for Server Status is exactly what I did in my release. I've ported Elinor now and am quite pleased at the speed and size of your lib, keep up the good work. Elinor - lightweight semi-automatic daytrading helper Current version: 1.1.1 Beta |
Fiat Money
Perkone Caldari State
4
|
Posted - 2012.08.22 19:28:00 -
[24] - Quote
First of all good work, mate!
The API is pretty light weight compared to others. That's a big PLUS! On the other hand what I'm missing is some data acces to item prices.
Are you planning to extend your API to cover EVE central and EVE Marketeer calls? Both are crucial for NAV investigation and price history analysis.
Implementing both would be truly incredible! |
Osku Rei
Black Aces Against ALL Anomalies
11
|
Posted - 2012.08.22 21:35:00 -
[25] - Quote
Cuhlen wrote:[quote=Virppi Jouhinen]Looks very interesting, might switch Elinor to your lib.
I just don't like using libraries that I don't have the source to.
You don't need the source when using a good library
'good' has some tight pre-requisites from my POV though
Next generation of lottery tracker coming soon! http://evelotterytracker.com/
Please like my post if it has helped you :) |
ItsmeHcK1
Kicked.
22
|
Posted - 2012.08.23 00:13:00 -
[26] - Quote
You, sir, are a gentleman and a scholar.
However, there is one little bug I'd like to report; it seems to mess up when importing implants. In a nutshell, it takes the first one and thinks all the others are the same. I've written a bit of a bug report on your google code repository, hopefully you can somehow understand my jibbering. |
Cuhlen
Blood Raven Assault Squadron
6
|
Posted - 2012.08.23 19:08:00 -
[27] - Quote
Fiat Money wrote:First of all good work, mate!
The API is pretty light weight compared to others. That's a big PLUS! On the other hand what I'm missing is some data acces to item prices.
Are you planning to extend your API to cover EVE central and EVE Marketeer calls? Both are crucial for NAV investigation and price history analysis.
Implementing both would be truly incredible!
Honestly, I had not considered it. This is something that I will give serious consideration to.
I am planning/working on a data layer to the API which would ship as a separate module/project. A market lookup tool might fit into that, or possible even it's own separate piece.
|
Cuhlen
Blood Raven Assault Squadron
6
|
Posted - 2012.08.23 23:42:00 -
[28] - Quote
ItsmeHcK1 wrote:You, sir, are a gentleman and a scholar.
However, there is one little bug I'd like to report; it seems to mess up when importing implants. In a nutshell, it takes the first one and thinks all the others are the same. I've written a bit of a bug report on your google code repository, hopefully you can somehow understand my jibbering.
Yikes - nasty little bugger.
I have checked in a tentative fix, but before I put together a new version package I was hoping to get some additional testing on this. If you can download the one changed file 'APIReader.cs' and make sure I've not broken anything else... I would appreciate it. (I have tested 20 some api calls, and all seems good, but an extra set of eyes is always nice).
Thanks for the bug report!
|
ItsmeHcK1
Kicked. Shadow Cartel
22
|
Posted - 2012.08.24 09:49:00 -
[29] - Quote
Will do a check as soon as I can. ^^ Thanks in advance! |
Cuhlen
Blood Raven Assault Squadron
6
|
Posted - 2012.08.24 16:49:00 -
[30] - Quote
ItsmeHcK1 wrote: Ninja-edit: The accessmask in APIKeyInfo can no longer be an int, as CCP have just added another flag, making it larger than an int can handle. (check the API key generator thingy, a flag for Locations has just been added, bringing the total to 268435455)
Good call.
Source updated, thanks.
|
|
|
|
|
Pages: [1] 2 :: one page |
First page | Previous page | Next page | Last page |