| Pages: [1] :: one page |
| Author |
Thread Statistics | Show CCP posts - 2 post(s) |

Captain Xero
|
Posted - 2008.07.23 16:41:00 -
[1]
Hi there,
I was wondering if there was any programmatic way to establish what "type" an ID in a field like ownerID1 would be (NPC corp, player corp, player character, agent etc)?
I tried doing this based on number ranges, but I believe Player Corporations and Player Character IDs share the same range? I know that a name comes down in the XML as well, but it would be nice to be able to tie this ID field to one of my backend tables (So I could create a new player character row if I came across someone I hadn't had a transaction with before for example).
Has anyone else solved this?
|

Vessper
Indicium Technologies
|
Posted - 2008.07.23 22:47:00 -
[2]
I haven't solved the issue of which is a player and which is a player corp but I use this to determine what type of entity it is for my standings app:
Select Case CLng(ID) Case 500000 To 599999 Type = "Faction" Case 1000000 To 1099999 Type = "NPC Corporation" Case 3000000 To 3099999 Type = "Agent" Case Else Type = "Player/Corp" End Select
- - -
EveHQ Character App | Item Database |

Captain Xero
|
Posted - 2008.07.24 08:48:00 -
[3]
Hi Vessper,
Thanks for that, sorts me out for most of the information.
I've been looking to see if there are any API methods that could be called with an ID which would return any clues as to whether it is a character or a corporation. Only the portrait image server seems to do this. So I guess I could fire a request to that and if I get the white ! on a black background I'd know it was a corporation, or a borked character! I'm not sure how well that would work though.
Maybe I'll just have to work this out as best as I can from the context of the call and the reference type of the row.
|

Vessper
Indicium Technologies
|
Posted - 2008.07.24 09:29:00 -
[4]
Personally, I wouldn't rely on the image approach. New characters will always be a problem and if there's issues with the portrait server for any reason, it could produce some strange results.
I'm just about to start coding something of my own for the wallet/journal and I'm just going to treat Player and Player Corps as one and the same. Is there any particular reason you would need to differentiate between the two?
- - -
EveHQ Character App | Item Database |

Captain Xero
|
Posted - 2008.07.24 12:18:00 -
[5]
I agree, parsing portraits would send anyone raving mad.
I have a "player_character" table and a "player_corporation" table, so when I'm pulling information from the api it would be nice to know which table to drop the name into. This then lets you have a screen for looking at all the player character you have come across and all the player corporations you have had dealings with. Which I think would be quite neat.
I think I need to introduce a third table "player_entity", which would have details common to both characters and corporations (name being the only one I can think of). I can then populate "player_character" and "player_corporataion" with further details if I happen to know that the entity is a player or a corporation (If it's my corporation for example).
Thanks for the help, it's good to get a fresh brain on the problem.
|
|

CCP Lingorm
C C P

|
Posted - 2008.07.24 12:40:00 -
[6]
The ID's for Characters and Corporations are unique (there are no duplicates at all, not even between Characters and Corporations), so you should be able to put them into a single table and store the name. The put a filed that lets you know if it is a character or Corp (the best way would be to try to get the Corp Details for that ID, and if you get a result then mark it is a Corp), once you have it saved then you do not need to change update it as the ID's do not change for characters and Corporations once created.
CCP Lingorm CCP Quality Assurance QA Engineering Team Leader
Originally by: Lord Fitz Eve is to WoW as Wow is to an 8 player game of Unreal Tournament.
|
|

Vessper
Indicium Technologies
|
Posted - 2008.07.24 13:05:00 -
[7]
Originally by: CCP Lingorm The put a filed...
I assume you mean "Then put a flag..." 
Originally by: CCP Lingorm ...that lets you know if it is a character or Corp (the best way would be to try to get the Corp Details for that ID, and if you get a result then mark it is a Corp), once you have it saved then you do not need to change update it as the ID's do not change for characters and Corporations once created.
When you say Corp Details, are you referring to the CorporationSheet in the API? If so, how would this be done if the Corp is not in an alliance?
- - -
EveHQ Character App | Item Database |

Matalino
Gallente Ki Tech Industries
|
Posted - 2008.07.24 15:23:00 -
[8]
Originally by: Vessper
Originally by: CCP Lingorm ...that lets you know if it is a character or Corp (the best way would be to try to get the Corp Details for that ID, and if you get a result then mark it is a Corp), once you have it saved then you do not need to change update it as the ID's do not change for characters and Corporations once created.
When you say Corp Details, are you referring to the CorporationSheet in the API? If so, how would this be done if the Corp is not in an alliance?
When I first read this post I was going to suggest that it is impractical because of this specific reason.
How can you automate the process of finding out if an ID is for a corp or player if the corp is not in an alliance? |
|

CCP Lingorm
C C P

|
Posted - 2008.07.24 15:43:00 -
[9]
Hmm ... I just tried it ...
We will look into changing the Corp page so that it will return public information on ANY corp.
Will try to get you an time frame for that.
CCP Lingorm CCP Quality Assurance QA Engineering Team Leader
Originally by: Lord Fitz Eve is to WoW as Wow is to an 8 player game of Unreal Tournament.
|
|

Matalino
Gallente Ki Tech Industries
|
Posted - 2008.07.24 16:38:00 -
[10]
Originally by: CCP Lingorm We will look into changing the Corp page so that it will return public information on ANY corp.
Cool 
|

Captain Xero
Gallente 3 Star Industries
|
Posted - 2008.07.24 17:16:00 -
[11]
Well that sounds great, it would certainly make it easy to figure out what the ID relates to. It would also be great to be able to get at that information for non-alliance corporations.
As a workaround for now, a single table with the ID, Name and a flag for players and player corporations seem to be the way to go. Where you can be sure that the row is a corporation or a character the flag can be set, where we're not sure it can just be set to "unknown" for now.
Thanks for the ideas everyone, and I look forward to hearing a time scale for that change Lingorm. Thanks again.
|

Gigi Barbagrigia
58th Syndicate
|
Posted - 2008.07.25 11:21:00 -
[12]
I'd be calling /eve/AllianceList.xml.aspx periodically and keeping alliances and their members updated. Then query ownerID against that table and if there is no match call /eve/CharacterID.xml.aspx. If that returns nothing (haven't tested what you get if ID points to agent but those are static anyway and available) you have either freshly made alliance or corporation that's not in alliance.
|

Captain Xero
Gallente 3 Star Industries
|
Posted - 2008.07.25 12:14:00 -
[13]
Yeah, I think I will be calling /eve/AllianceList.xml.aspx in order to keep my tables up to date with IDs we know are corporations. You could also use Lingorm's approach of calling CorporationSheet.xml.aspx?corporationID=xxx, which would tell you that an ID belonged to a corporation in an alliance as well.
However, I don't think calling /eve/CharacterName.xml.aspx (I assume you meant CharacterName rather then CharacterID?) with a corporation ID will return blank.
Try, http://api.eve-online.com/eve/CharacterName.xml.aspx?ids=858194518
That will return <row name="3 Star Industries" characterID="858194518"/>, which gives us no clues as to whether that is a character or a corporation. Note that it returns information even though I sent a corporation ID.
|
| |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |