Page 1 of 1

Identifing NPC user in as3/server side

Posted: 14 Jul 2012, 10:16
by Malini
Hi,

I am trying to differentiate real player users and NPC's in as3 /server side. But I am unable to do so. Because there is no default functions available in as3/server side...Is there any functions available??? If so please let us know..
In sfs2x isNPC() function is available. Is there any similar function available in 1.6.6???

Re: Identifing NPC user in as3/server side

Posted: 14 Jul 2012, 12:14
by rjgtav
Hi.
Hmm... Maybe you can use the getIpAddress() method from the User object? It should probably return either 127.0.0.1 or null if it is a NPC.
Otherwise, when you create the NPC, you can set a simple boolean as a property like user.put("npc", true), which you can later use for identifying npcs.