getUserByID() stop extention

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
frcol
Posts: 96
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

getUserByID() stop extention

Postby frcol » 28 Mar 2015, 15:19

I want to disconnect a NPC when the user disconnects from SFS.

The code below shows on trace:

idNPC: 161
-1-

simply stops on:
var userNPC = _server.getUserById(idNPC);

Code: Select all

function handleInternalEvent(evt) {
if (evt.name == "loginRequest")
   { }
} else if (evt.name == "userLost") {
      var usr = evt.user;
      var idNPC = usr.getVariable("idNPC").getValue();
      trace("idNPC: "+idNPC);
      trace("-1-")
      var userNPC = _server.getUserById(idNPC);
      trace("-2-");
      trace("apelido NPC: "+userNPC.getVariable("apelido").getValue());
      _server.disconnectUser(userNPC);


Any help?
Fabio Colombini
Brazil
User avatar
Lapo
Site Admin
Posts: 19988
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: getUserByID() stop extention

Postby Lapo » 28 Mar 2015, 20:13

No errors logged in the console?
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
frcol
Posts: 96
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: getUserByID() stop extention

Postby frcol » 29 Mar 2015, 06:23

No errors in Zone Brownser - trace windows (Remote admin).
No errors in Logs (Remote admin).

Is there another way to get a user (the NPCuser) to disconnect it?
Fabio Colombini
Brazil

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 1 guest