Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.player.PlayerLoginEvent Class Reference
Inheritance diagram for org.bukkit.event.player.PlayerLoginEvent:
org.bukkit.event.player.PlayerEvent org.bukkit.event.Event

Classes

enum  Result
 

Public Member Functions

 PlayerLoginEvent (final Player player)
 
 PlayerLoginEvent (final Player player, final String hostname)
 
 PlayerLoginEvent (final Player player, final String hostname, final InetAddress address)
 
 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)
 
Result getResult ()
 
void setResult (final Result result)
 
String getKickMessage ()
 
void setKickMessage (final String message)
 
String getHostname ()
 
void allow ()
 
void disallow (final Result result, final String message)
 
InetAddress getAddress ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.player.PlayerEvent
 PlayerEvent (final Player who)
 
final Player getPlayer ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

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.

22  {
23  this(player, "", null);
24  }
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.

30  {
31  this(player, hostname, null);
32  }
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 43 of file PlayerLoginEvent.java.

43  {
44  super(player);
45  this.hostname = hostname;
46  this.address = address;
47  }
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 54 of file PlayerLoginEvent.java.

54  {
55  this(player, "", null, result, message);
56  }
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 68 of file PlayerLoginEvent.java.

68  {
69  this(player, hostname, address);
70  this.result = result;
71  this.message = message;
72  }

Member Function Documentation

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

Allows the player to log in

Definition at line 124 of file PlayerLoginEvent.java.

References org.bukkit.event.player.PlayerLoginEvent.Result.ALLOWED.

124  {
125  result = Result.ALLOWED;
126  message = "";
127  }
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 135 of file PlayerLoginEvent.java.

135  {
136  this.result = result;
137  this.message = message;
138  }
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 148 of file PlayerLoginEvent.java.

148  {
149  return address;
150  }
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 117 of file PlayerLoginEvent.java.

117  {
118  return hostname;
119  }
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 98 of file PlayerLoginEvent.java.

98  {
99  return message;
100  }
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 79 of file PlayerLoginEvent.java.

79  {
80  return result;
81  }
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 107 of file PlayerLoginEvent.java.

107  {
108  this.message = message;
109  }
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 88 of file PlayerLoginEvent.java.

88  {
89  this.result = result;
90  }

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