Class GroupManager

java.lang.Object
games.stendhal.server.core.rp.group.GroupManager
All Implemented Interfaces:
LoginListener, TurnListener

public class GroupManager extends Object implements TurnListener, LoginListener
manages player groups
Author:
hendrik
  • Constructor Details

    • GroupManager

      public GroupManager()
      creates a new GroupManager.
  • Method Details

    • getGroup

      public Group getGroup(String playerName)
      returns the group the specified player is a member of.
      Parameters:
      playerName - name of player
      Returns:
      Group or null if the player is not a member of any group
    • createGroup

      public Group createGroup(String playerName)
      Creates a new group
      Parameters:
      playerName - name of player
      Returns:
      the new group or null if the group could not be created
    • destroyGroup

      public boolean destroyGroup(String playerName)
      destroys a group
      Parameters:
      playerName - name of player
      Returns:
      true, if the group was destroyed; false otherwise
    • clean

      public void clean()
      handles timeouts and removes empty groups
    • onTurnReached

      public void onTurnReached(int currentTurn)
      cleans up
      Specified by:
      onTurnReached in interface TurnListener
      Parameters:
      currentTurn - current turn number
    • onLoggedIn

      public void onLoggedIn(Player player)
      tell the reconnecting client if he is in a group
      Specified by:
      onLoggedIn in interface LoginListener
      Parameters:
      player - the player who has logged in