Uses of Class
io.sockit.gameserver.Session
| Package | Description |
|---|---|
| io.sockit.gameserver |
This is the core package for the Sockit Multiplayer Game (Server) Engine and provides the classes necessary to implement the server side of a multiplayer turn based game.
|
-
Uses of Session in io.sockit.gameserver
Fields in io.sockit.gameserver declared as Session Modifier and Type Field Description SessionPlayer. sessionThe client session of the player.Methods in io.sockit.gameserver that return types with arguments of type Session Modifier and Type Method Description Iterable<Session>Room. getSpectators()returns all the client session who are spectatorsMethods in io.sockit.gameserver with parameters of type Session Modifier and Type Method Description protected booleanRoom. canSeatBeTaken(Session session, int seatNo, JsonObject data)Callback called when a session takes seat to check whether session should be allowed to take seat or not.voidRoom. debug(Session session, String txt)Logs debug messages along with the user name when debug is enabledbooleanRoom. isSeated(Session session)Returns whether the specified client session is seated or notbooleanRoom. isSpectator(Session session)returns whether specified client session is a spectator or not.voidRoom. leave(Session session)Evicts the specified client session from the room.voidRoom. leaveSeat(Session session)Evicts the specified client session from his/her seatprotected abstract PlayerRoom. newPlayer(Session session, int SeatNo, JsonObject data)Factory method called to instantiate a new player.protected abstract voidGame. onEnterGame(Session session, boolean firstTime)Event-Handler/Callback - called when a client session enters the Game (i.e.protected abstract voidGame. onExitGame(Session session)Event-Handler/Callback - called when a client session exits the Game (i.e.voidSessionListener. onLoggedIn(Session session, boolean firstTime)Event-Handler/Callback called when user loginsvoidSessionListener. onLoggedOff(Session session)Event-Handler/Callback called when user logffsvoidSessionListener. onMesg(Session session, String command, byte[] data)Event-Handler/Callback called when server receives a custom binary message from the clientvoidSessionListener. onMesg(Session session, String command, String data)Event-Handler/Callback called when server receives a custom text message from the clientvoidSessionListener. onMesg(Session session, String command, JsonObject dataAsJson)Event-Handler/Callback called when server receives a custom json message from the clientprotected voidRoom. onRoomJoined(Session session)Event-Handler/Callback called after session is added to room but before joinedRoom message is sent to the client.protected voidRoom. onRoomLeft(Session session, boolean isLoggingOut)Event-Handler/Callback called after room Left but before room Left message is sent to playervoidSessionListener. onSessionTimedOut(Session session)Event-Handler/Callback called when session times outvoidSessionListener. onShutDown(Session session)Event-Handler/Callback called when server begins shuts down but before shutdown message is sent to clientvoidRoom. sendJsonMessageToAll(String command, JsonObject data, Session sessionNotToSend)Sends a Json message to all sessions in the room except the one specified.voidRoom. sendJsonMessageToPlayers(String command, JsonObject data, Session sessionNotToSend)Sends a Json message to all players in the room except the one specified.voidRoom. sendJsonMessageToSpectators(String command, JsonObject data, Session sessionNotToSend)Sends a Json message to all spectators in the room except the one specified.voidRoom. sendRoomDataToSession(Session session)Sends Room Data to the specified sessionvoidRoom. sendTxtMessageToAll(String command, String data, Session sessionNotToSend)Sends a text message to all sessions in the room except the one specified.voidRoom. sendTxtMessageToPlayers(String command, String data, Session sessionNotToSend)Sends a text message to all players in the room except the one specified.voidRoom. sendTxtMessageToSpectators(String command, String data, Session sessionNotToSend)Sends a text message to all spectators in the room except the one specified.Constructors in io.sockit.gameserver with parameters of type Session Constructor Description Player(Session session, int seatNo)Creates a Player whose session is the specified session and whose seat number is the specified seat number