These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Determining NPC/Player from CharacterID

Author
Kronus Heilgar
Science and Trade Institute
Caldari State
#1 - 2013-07-08 03:34:51 UTC
Problem:
I have a character ID, and I need to determine whether it is an NPC or a player character. I cannot do this via the CharacterInfo API because it returns a "bad request", and I do not desire being blacklisted.

Someone mentioned in a different post that it may be possible using the SDE, but I have explored that and only see Agent NPCs in it.

Can anyone think of a good way to do this?

Thanks!

This is not the signature you're looking for.

ItsmeHcK1
Immortalis Inc.
Shadow Cartel
#2 - 2013-07-08 18:21:24 UTC  |  Edited by: ItsmeHcK1
Easiest way is definitely calling CharacterInfo.

CCP Prism X also recently added typeID's to a lot of API calls recently, more information here.

If you must insist on doing it the hard way, then the most helpful tip I can give you is this: All ID's used to be in certain ranges.
I don't have the exact ranges ready right now, but it's something like this:

1000000 - 1100000 = NPC corps
90000000 - 9xxxxxxx = characters
98000000 - 9xxxxxxx = corps

This stopped being true a while ago though, so it will not work out most of the time.
You should really be using Prism's new stuffs.
Kronus Heilgar
Science and Trade Institute
Caldari State
#3 - 2013-07-09 17:26:53 UTC  |  Edited by: Kronus Heilgar
The typeIDs are great, except they're not on every API. For example, if all I have is a characterID, and I want to find the CEO of his corporation. The normal progression for this would be:
- call CharacterInfo to get CorpID
- call CorporationSheet to get CeoID
- call CharacterInfo to get Ceo's info

And the problem is when the original character is in an NPC corp, meaning his CEO is an NPC. I can't rely on using the SDE because only agent NPCs are in there.

For a large application, would calling CharacterInfo with NPC ids (getting a "bad request" response) regularly lead to blacklisting?

This is not the signature you're looking for.

ItsmeHcK1
Immortalis Inc.
Shadow Cartel
#4 - 2013-07-10 08:58:04 UTC  |  Edited by: ItsmeHcK1
Not unless you do it 500 times a minute...
Generally, unless you literally have 10 threads going 24/7, you're good.

As for NPC corps, those are still in the ranges listed above. (Or heck, you could even compile a list quickly by simply copying them from Eve.)