Class AddRemotePlayerInfo
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPlayer(RemotePlayer player) Add a player that shall be added to the arena.addPlayers(RemotePlayer... players) Add multiple players that shall be added to the arena.addPlayers(Collection<RemotePlayer> players) Add multiple players that shall be added to the arena.clone()All players that also are being concidered for the auto-team assignation.getCause()Returns the cause that made him join the arena- Defined usingsetCause(AddPlayerCause).@Nullable StringGet the arena picker string to fallback to in case the targeted arena is full.Returns all players that have been added so far.@Nullable TeamReturns the target team that has been specified usinggetTargetTeam().booleanWhether auto-assign has been enabled usingsetAutoAssignTeam(boolean).booleanReturns whether all players are being forcefully being removed from their existing arenas.booleanWhether they shall fallback as spectators.parseAndFitFallbackArenaPicker(int availableSlots) Parses the fallback arena picker and adds an additional condition.setAutoAssignTeam(boolean autoAssign) Whether a team shall be automatically assigned.Set all players that shall also be concidered for the auto-team assignation.setCause(AddPlayerCause cause) Define the cause that made the player join the arena.setFallbackArenaPicker(@Nullable String fallbackArenaPicker) Set the arena picker string to fallback to in case the targeted arena is full.setForcefully(boolean force) Whether it should ignore that he's already playing within an arena.setSpectatorFallback(boolean enableFallback) Define whether players shall fall back as spectators when the arena is running.setTargetTeam(@Nullable Team targetTeam) Set the team which the player shall automatically enter when he joins the arena.
-
Constructor Details
-
AddRemotePlayerInfo
public AddRemotePlayerInfo()Creates a new instance.
-
-
Method Details
-
addPlayer
Add a player that shall be added to the arena.- Parameters:
player- The player who shall be added- Returns:
- This instance
-
addPlayers
Add multiple players that shall be added to the arena.- Parameters:
players- The player who shall be added- Returns:
- This instance
-
addPlayers
Add multiple players that shall be added to the arena.- Parameters:
players- The player who shall be added- Returns:
- This instance
-
getPlayers
Returns all players that have been added so far.- Returns:
- A (unmodifiable) list of all players that have been added
-
setTargetTeam
Set the team which the player shall automatically enter when he joins the arena.nullby default.Setting it as
nullcauses him to not join any arena automatically.- Parameters:
targetTeam- His target team. May benull- Returns:
- This instance
-
getTargetTeam
Returns the target team that has been specified usinggetTargetTeam().- Returns:
- The target team. May be
null
-
setAutoAssignTeam
Whether a team shall be automatically assigned.falseby default.The difference to
setTargetTeam(Team)withnullas a parameter, is that this method tries to add all given players into the same arena. This may not succed every time when a team is already fully occupied. In this case, the remaining players won't enter any team. The team is still going to be filled.- Parameters:
autoAssign- Whether all players shall be assigned to the same team- Returns:
- This instance
-
isAutoAssignTeam
public boolean isAutoAssignTeam()Whether auto-assign has been enabled usingsetAutoAssignTeam(boolean).- Returns:
- Either true or false
-
setAutoAssignTeamIncludePlayers
Set all players that shall also be concidered for the auto-team assignation.The collection should only contain players that are already playing within the arena.
- Parameters:
players- All players that shall also have their team changed to the same one- Returns:
- This instance
-
getAutoAssignTeamIncludePlayers
All players that also are being concidered for the auto-team assignation.The collection should only contain players that are already playing within the arena.
- Returns:
- All players that are also being concidered for the auto-team assignation
-
setSpectatorFallback
Define whether players shall fall back as spectators when the arena is running.falseby default.- Parameters:
enableFallback- Whether they shall fall back as a spectator- Returns:
- This instance
-
isSpectatorFallbackActive
public boolean isSpectatorFallbackActive()Whether they shall fallback as spectators. Defined usingsetSpectatorFallback(boolean).This is only used in case the arena's status is
ArenaStatus.RUNNING. Otherwise, it will fail as usual (unless the arena is in aArenaStatus.LOBBYstate, in which case the player is being added as a regular player).- Returns:
- Either true or false
-
setCause
Define the cause that made the player join the arena.AddPlayerCause.PLUGINby default.- Parameters:
cause- The cause that made him join the arena- Returns:
- This instance
-
getCause
Returns the cause that made him join the arena- Defined usingsetCause(AddPlayerCause).- Returns:
- The cause that made him join the arena
-
setForcefully
Whether it should ignore that he's already playing within an arena.They won't rejoin an arena in case they are already playing inside it.
- Parameters:
force- Force him to leave his existing arena- Returns:
- This instance
-
isForcefully
public boolean isForcefully()Returns whether all players are being forcefully being removed from their existing arenas.They won't rejoin an arena in case they are already playing inside it.
- Returns:
- Whether they are being forced to join the given arena
-
setFallbackArenaPicker
Set the arena picker string to fallback to in case the targeted arena is full.Used for high traffic servers, where the sending server doesn't get updated of player counts in time.
- Parameters:
fallbackArenaPicker- The arena picker to fallback to.nullto instead always attempt to only join the one arena- Returns:
- This instance
-
getFallbackArenaPicker
Get the arena picker string to fallback to in case the targeted arena is full.Used for high traffic servers, where the sending server doesn't get updated of player counts in time.
- Returns:
- The arena picker to fallback to.
nullto instead always attempt to only join the one arena
-
parseAndFitFallbackArenaPicker
public ArenaPicker parseAndFitFallbackArenaPicker(int availableSlots) throws IllegalStateException, ArenaConditionParseException, ArenaPickerParseException Parses the fallback arena picker and adds an additional condition.- Parameters:
availableSlots- Adds aArenaConditionVariableType.REMAINING_SLOTSwith greater than this number- Returns:
- The parsed arena picker, potentially with extra condition for availableSlots
- Throws:
IllegalStateException- If there is no fallback arena pickerArenaConditionParseException- When it failed to parse the condition (because of e.g. malformed syntax)ArenaPickerParseException- When it failed to parse the picker (because of e.g. malformed syntax)
-
clone
-