Class BotEventAdapter

java.lang.Object
io.sockit.gameserver.bot.BotEventAdapter
All Implemented Interfaces:
BotEventListener

public abstract class BotEventAdapter
extends Object
implements BotEventListener
An abstract adapter class for receiving bot events. The methods in this class are empty. This class exists as convenience for creating BotEventListener objects.
  • Constructor Details

  • Method Details

    • onError

      public void onError​(Bot bot, int errorCode, String errorDesc)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when an error is triggered on the server.
      Specified by:
      onError in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered the error
      errorCode - - the errorCode e.g. ErrorCodes.emailIdAndPasswordDoesNotMatch or ErrorCodes.seatNotFree or ...
      errorDesc - - the error description
    • onLoggedIn

      public void onLoggedIn​(Bot bot)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot successfully logins into the server
      Specified by:
      onLoggedIn in interface BotEventListener
      Parameters:
      bot - - the Bot which loggedIn
    • onLoggedOut

      public void onLoggedOut​(Bot bot)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot successfully logouts from the server
      Specified by:
      onLoggedOut in interface BotEventListener
      Parameters:
      bot - - the bot which loggedOut
    • onSessionTimedOut

      public void onSessionTimedOut​(Bot bot)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot's session times out on the server
      Specified by:
      onSessionTimedOut in interface BotEventListener
      Parameters:
      bot - - the bot whose session timed out
    • onServerShutdown

      public void onServerShutdown​(Bot bot)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the server shutsdown
      Specified by:
      onServerShutdown in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
    • onGetLocations

      public void onGetLocations​(Bot bot, String gameName, List<String> locations)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot receives the location list from the Server
      Specified by:
      onGetLocations in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
      gameName - - the name of the game whose locations were requested by the Bot
      locations - - the list of locations
    • onGetRooms

      public void onGetRooms​(Bot bot, String gameName, String location, RoomType roomtype, List<RoomInfo> rooms)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot receives the room list from the Server
      Specified by:
      onGetRooms in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
      gameName - - the name of the game whose room list was requested by the Bot
      location - - the location whose room list was requested
      roomtype - - the type of room list e.g. RoomType.normal or RoomType.fast
      rooms - - the room list as a collection of RoomInfo objects
    • onRoomJoined

      public void onRoomJoined​(Bot bot, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot joins a room
      Specified by:
      onRoomJoined in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
      room - - the room joined by this Bot
    • onRoomRefreshedFromServer

      public void onRoomRefreshedFromServer​(Bot bot, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the room state is refreshed from the server. Gets triggered when Bot receives a ServerMessageType.roomData message from the Server
      Specified by:
      onRoomRefreshedFromServer in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
      room - - the room joined by the bot
    • onSeatTaken

      public void onSeatTaken​(Bot bot, Player playerSeated, Room room, boolean isSelf)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when any user takes a seat in the room.
      Specified by:
      onSeatTaken in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      playerSeated - - the player which took seat
      room - - the room joined by this bot
      isSelf - - if the user seated is the same as this Bot
    • onSeatLeft

      public void onSeatLeft​(Bot bot, Player playerLeft, Room room, boolean isSelf)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when any user leaves a seat in the room.
      Specified by:
      onSeatLeft in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      playerLeft - - the player which left the seat
      room - - the room joined by this bot
      isSelf - - if the user which left is the same as this Bot
    • onRoomLeft

      public void onRoomLeft​(Bot bot)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot leaves the room
      Specified by:
      onRoomLeft in interface BotEventListener
      Parameters:
      bot - - the Bot which triggered this event
    • onMessageReceivedJson

      public void onMessageReceivedJson​(Bot bot, String command, JsonObject data)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot receives a custom Json message from the server
      Specified by:
      onMessageReceivedJson in interface BotEventListener
      Parameters:
      bot - - the Bot which receives the message
      command - - the message command
      data - - the message data as json
    • onMessageReceivedString

      public void onMessageReceivedString​(Bot bot, String command, String data)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot receives a custom text message from the server
      Specified by:
      onMessageReceivedString in interface BotEventListener
      Parameters:
      bot - - the Bot which receives the message
      command - - the message command
      data - - the message data as String
    • onMessageReceivedBytes

      public void onMessageReceivedBytes​(Bot bot, String command, byte[] data)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot receives a custom binary message from the server
      Specified by:
      onMessageReceivedBytes in interface BotEventListener
      Parameters:
      bot - - the Bot which receives the message
      command - - the message command
      data - - the message data as a byte array
    • onGamePlayStarted

      public void onGamePlayStarted​(Bot bot, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when game play starts in the room
      Specified by:
      onGamePlayStarted in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      room - - the room joined by this bot
    • onNextTurn

      public void onNextTurn​(Bot bot, Player turnPlayer, JsonObject turnData, Room room, boolean isSelfTurn)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when a new turn begins
      Specified by:
      onNextTurn in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      turnPlayer - - the player whose turn it is
      turnData - - the additional data received with the event. For e.g. in a game like Poker it could be {"callValue":20}
      room - - the room joined by this bot
      isSelfTurn - - whether its the turn of the bot which received this event
    • onTurnPlayed

      public void onTurnPlayed​(Bot bot, Player turnPlayer, String playerAction, JsonObject actionData, Room room, boolean isSelf)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when a player plays his/her turn
      Specified by:
      onTurnPlayed in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      turnPlayer - - the player who played the action
      playerAction - - the action played by the player
      actionData - - the action data if any. For e.g. in a game like Poker it could be {"amtBet":20}
      room - - the room joined by this bot
      isSelf - - whether the action was played by the bot which received this event
    • onOutOfTurnPlayed

      public void onOutOfTurnPlayed​(Bot bot, Player outOfTurnPlayer, String playerAction, JsonObject actionData, Room room, boolean isSelf)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when an action is played out of turn by a player
      Specified by:
      onOutOfTurnPlayed in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      outOfTurnPlayer - - the player who played the action
      playerAction - - the action played by the player
      actionData - - the action data if any.
      room - - the room joined by this bot
      isSelf - - whether the action was played by the bot which received this event
    • onGameAction

      public void onGameAction​(Bot bot, String gameAction, JsonObject actionData, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when a game action occurs in the game. For e.f. in a game like poker this could be flop cards dealt
      Specified by:
      onGameAction in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      gameAction - - the game action
      actionData - - the action data. For e.g. in a game like poker this could be the value of the flop cards
      room - - the room joined by this bot
    • onGamePlayEnded

      public void onGamePlayEnded​(Bot bot, Room room, JsonObject endGameData)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when game play ends in the room
      Specified by:
      onGamePlayEnded in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      room - - the room joined by this bot
      endGameData - - the data received with the endGame event. For e.g this could be the winning seat no and the amount won
    • onRoomDestroyed

      public void onRoomDestroyed​(Bot bot, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the room joined by this bot is destroyed
      Specified by:
      onRoomDestroyed in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      room - - the room which was destroyed
    • onAvtarChangedOfSelf

      public void onAvtarChangedOfSelf​(Bot bot, int newAvtarId)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the avtar of the user loggedIn via this bot changes
      Specified by:
      onAvtarChangedOfSelf in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      newAvtarId - - the new avtarId of the user
    • onAvtarChangedOfOtherPlayer

      public void onAvtarChangedOfOtherPlayer​(Bot bot, Player player, int newAvtarId, Room room)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the avtar of another player is changed
      Specified by:
      onAvtarChangedOfOtherPlayer in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      player - - the player whose avtar is changed
      newAvtarId - - the new avtarID
      room - - the room joined by this bot
    • onNotEligibleToPlay

      public void onNotEligibleToPlay​(Bot bot, Player player, Room room, String reason)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when the Bot is not eligible to play the new game play that is starting
      Specified by:
      onNotEligibleToPlay in interface BotEventListener
      Parameters:
      bot - - the Bot which receives this event
      player - - the player linked to this bot
      room - - the room joined by this bot
      reason - - the reason why player is not eligible
    • onInvalidAction

      public void onInvalidAction​(Bot bot, String action, String description, JsonObject errorData, Room room, boolean isOutOfTurn)
      Description copied from interface: BotEventListener
      Event-Handler/Callback called when an action played by the Bot is not valid
      Specified by:
      onInvalidAction in interface BotEventListener
      Parameters:
      bot - - the Bot which triggers this event
      action - - the action played
      description - - the error description
      errorData - - the error data containing more info about the error
      room - - the room joined by the bot
      isOutOfTurn - - true if the action was played out of turn