Package io.sockit.gameserver
Interface SessionListener
public interface SessionListener
Interface for Session event callbacks
-
Method Summary
Modifier and Type Method Description voidonLoggedIn(Session session, boolean firstTime)Event-Handler/Callback called when user loginsvoidonLoggedOff(Session session)Event-Handler/Callback called when user logffsvoidonMesg(Session session, String command, byte[] data)Event-Handler/Callback called when server receives a custom binary message from the clientvoidonMesg(Session session, String command, String data)Event-Handler/Callback called when server receives a custom text message from the clientvoidonMesg(Session session, String command, JsonObject dataAsJson)Event-Handler/Callback called when server receives a custom json message from the clientvoidonSessionTimedOut(Session session)Event-Handler/Callback called when session times outvoidonShutDown(Session session)Event-Handler/Callback called when server begins shuts down but before shutdown message is sent to client
-
Method Details
-
onLoggedIn
Event-Handler/Callback called when user logins- Parameters:
session- - the user's sessionfirstTime- - whether its the first time that the user has logged in
-
onLoggedOff
Event-Handler/Callback called when user logffs- Parameters:
session- - the user's session
-
onSessionTimedOut
Event-Handler/Callback called when session times out- Parameters:
session- - the user's session
-
onShutDown
Event-Handler/Callback called when server begins shuts down but before shutdown message is sent to client- Parameters:
session- - the user's session
-
onMesg
Event-Handler/Callback called when server receives a custom json message from the client- Parameters:
session- - the user's sessioncommand- - the message commanddataAsJson- - the message data
-
onMesg
Event-Handler/Callback called when server receives a custom text message from the client- Parameters:
session- - the user's sessioncommand- - the message commanddata- - the message data
-
onMesg
Event-Handler/Callback called when server receives a custom binary message from the client- Parameters:
session- - the user's sessioncommand- - the message commanddata- - the message data
-