Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.event.player.PlayerLoginEvent Class Reference

Stores details for players attempting to log in. More...

+ Inheritance diagram for org.bukkit.event.player.PlayerLoginEvent:
+ Collaboration diagram for org.bukkit.event.player.PlayerLoginEvent:

Classes

enum  Result
 Basic kick reasons for communicating to plugins. More...
 

Public Member Functions

 PlayerLoginEvent (final Player player)
 
 PlayerLoginEvent (final Player player, final String hostname)
 
 PlayerLoginEvent (final Player player, final String hostname, final InetAddress address)
 This constructor defaults message to an empty string, and result to ALLOWED.
 
 PlayerLoginEvent (final Player player, final Result result, final String message)
 
 PlayerLoginEvent (final Player player, String hostname, final InetAddress address, final Result result, final String message)
 This constructor pre-configures the event with a result and message.
 
Result getResult ()
 Gets the current result of the login, as an enum.
 
void setResult (final Result result)
 Sets the new result of the login, as an enum.
 
String getKickMessage ()
 Gets the current kick message that will be used if getResult() != Result.ALLOWED.
 
void setKickMessage (final String message)
 Sets the kick message to display if getResult() != Result.ALLOWED.
 
String getHostname ()
 Gets the hostname that the player used to connect to the server, or blank if unknown.
 
void allow ()
 Allows the player to log in.
 
void disallow (final Result result, final String message)
 Disallows the player from logging in, with the given reason.
 
InetAddress getAddress ()
 Gets the InetAddress for the Player associated with this event.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.player.PlayerEvent
 PlayerEvent (final Player who)
 
final Player getPlayer ()
 Returns the player involved in this event.
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 The default constructor is defined for cleaner code.
 
 Event (boolean isAsync)
 This constructor is used to explicitly declare an event as synchronous or asynchronous.
 
String getEventName ()
 
final boolean isAsynchronous ()
 Any custom event that should not by synchronized with other events must use the specific constructor.
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.player.PlayerEvent
Player player
 

Detailed Description

Stores details for players attempting to log in.

Definition at line 11 of file PlayerLoginEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.player.PlayerLoginEvent.PlayerLoginEvent ( final Player  player)
Deprecated:
Address should be provided in other constructor

Definition at line 22 of file PlayerLoginEvent.java.

References org.bukkit.event.player.PlayerEvent.player.

org.bukkit.event.player.PlayerLoginEvent.PlayerLoginEvent ( final Player  player,
final String  hostname 
)
Deprecated:
Address should be provided in other constructor

Definition at line 30 of file PlayerLoginEvent.java.

References org.bukkit.event.player.PlayerEvent.player.

org.bukkit.event.player.PlayerLoginEvent.PlayerLoginEvent ( final Player  player,
final String  hostname,
final InetAddress  address 
)

This constructor defaults message to an empty string, and result to ALLOWED.

Parameters
playerThe Player for this event
hostnameThe hostname that was used to connect to the server
addressThe address the player used to connect, provided for timing issues

Definition at line 41 of file PlayerLoginEvent.java.

org.bukkit.event.player.PlayerLoginEvent.PlayerLoginEvent ( final Player  player,
final Result  result,
final String  message 
)
Deprecated:
Address and hostname should be provided in other constructor

Definition at line 51 of file PlayerLoginEvent.java.

References org.bukkit.event.player.PlayerEvent.player.

org.bukkit.event.player.PlayerLoginEvent.PlayerLoginEvent ( final Player  player,
String  hostname,
final InetAddress  address,
final Result  result,
final String  message 
)

This constructor pre-configures the event with a result and message.

Parameters
playerThe Player for this event
hostnameThe hostname that was used to connect to the server
addressThe address the player used to connect, provided for timing issues
resultThe result status for this event
messageThe message to be displayed if result denies login

Definition at line 64 of file PlayerLoginEvent.java.

References org.bukkit.event.player.PlayerEvent.player.

Member Function Documentation

void org.bukkit.event.player.PlayerLoginEvent.allow ( )

Allows the player to log in.

Definition at line 118 of file PlayerLoginEvent.java.

void org.bukkit.event.player.PlayerLoginEvent.disallow ( final Result  result,
final String  message 
)

Disallows the player from logging in, with the given reason.

Parameters
resultNew result for disallowing the player
messageKick message to display to the user

Definition at line 129 of file PlayerLoginEvent.java.

InetAddress org.bukkit.event.player.PlayerLoginEvent.getAddress ( )

Gets the InetAddress for the Player associated with this event.

This method is provided as a workaround for player.getAddress() returning null during PlayerLoginEvent.

Returns
The address for this player. For legacy compatibility, this may be null.

Definition at line 142 of file PlayerLoginEvent.java.

static HandlerList org.bukkit.event.player.PlayerLoginEvent.getHandlerList ( )
static

Definition at line 151 of file PlayerLoginEvent.java.

HandlerList org.bukkit.event.player.PlayerLoginEvent.getHandlers ( )
virtual

Implements org.bukkit.event.Event.

Definition at line 147 of file PlayerLoginEvent.java.

String org.bukkit.event.player.PlayerLoginEvent.getHostname ( )

Gets the hostname that the player used to connect to the server, or blank if unknown.

Returns
The hostname

Definition at line 111 of file PlayerLoginEvent.java.

String org.bukkit.event.player.PlayerLoginEvent.getKickMessage ( )

Gets the current kick message that will be used if getResult() != Result.ALLOWED.

Returns
Current kick message

Definition at line 93 of file PlayerLoginEvent.java.

Result org.bukkit.event.player.PlayerLoginEvent.getResult ( )

Gets the current result of the login, as an enum.

Returns
Current Result of the login

Definition at line 75 of file PlayerLoginEvent.java.

void org.bukkit.event.player.PlayerLoginEvent.setKickMessage ( final String  message)

Sets the kick message to display if getResult() != Result.ALLOWED.

Parameters
messageNew kick message

Definition at line 102 of file PlayerLoginEvent.java.

void org.bukkit.event.player.PlayerLoginEvent.setResult ( final Result  result)

Sets the new result of the login, as an enum.

Parameters
resultNew result to set

Definition at line 84 of file PlayerLoginEvent.java.


The documentation for this class was generated from the following file: