Identifing NPC user in as3/server side

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
Malini
Posts: 4
Joined: 15 Oct 2011, 03:53

Identifing NPC user in as3/server side

Post 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???
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Identifing NPC user in as3/server side

Post 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.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Post Reply