Send extension message before disconnect user programmatical

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Send extension message before disconnect user programmatical

Postby grhwood » 14 Nov 2012, 20:05

Hi,

Is there anyway to send extension message before disconnect user programmatically like the following:

Code: Select all

zone.getExtension().send("ext", emptyParams, user);
sfsApi.disconnectUser(user);


when i try it, it throws the NPE:

Code: Select all

java.lang.NullPointerException
        com.smartfoxserver.bitswarm.core.SocketWriter.processRegularSession(SocketWriter.java:261)
        com.smartfoxserver.bitswarm.core.SocketWriter.processSessionQueue(SocketWriter.java:200)
        com.smartfoxserver.bitswarm.core.SocketWriter.run(SocketWriter.java:176)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        java.lang.Thread.run(Thread.java:722)


Thanks
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Send extension message before disconnect user programmat

Postby Bax » 15 Nov 2012, 08:59

You should use the "kick" feature, which allows you to send a message to the user before disconnecting him.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 95 guests