net.minecraft.src
Class ServerConfigurationManager

java.lang.Object
  extended by net.minecraft.src.ServerConfigurationManager
Direct Known Subclasses:
DedicatedPlayerList, IntegratedPlayerList

public abstract class ServerConfigurationManager
extends Object


Field Summary
static Logger myLogger
           
 List playerEntityList
          A list of player entities that exist on this server.
 
Constructor Summary
ServerConfigurationManager(MinecraftServer par1MinecraftServer)
           
 
Method Summary
 void addOp(String par1Str)
          This adds a username to the ops list, then saves the op list
 void addToWhiteList(String par1Str)
          Add the specified player to the white list.
 String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str)
          checks ban-lists, then white-lists, then space for the server.
 boolean areCommandsAllowed(String par1Str)
           
 EntityPlayerMP createPlayerForUser(String par1Str)
          also checks for multiple logins
 void func_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
           
 String[] getAllUsernames()
           
 String[] getAvailablePlayerDat()
          returns a list of usernames for which playerData is available
 BanList getBannedIPs()
           
 BanList getBannedPlayers()
           
 int getEntityViewDistance()
           
 Set getIPWhiteList()
           
 int getMaxPlayers()
           
 Set getNamesWhiteList()
           
 EntityPlayerMP getPlayerForUsername(String par1Str)
           
 String getPlayerList()
          returns a string containing a comma-seperated list of player names
 List getPlayerList(String par1Str)
           
 int getPlayerListSize()
           
 MinecraftServer getServerInstance()
           
 NBTTagCompound getTagsFromLastWrite()
          gets the tags created in the last writePlayerData call
 int getViewDistance()
          Gets the View Distance.
 void initializeConnectionToPlayer(NetworkManager par1NetworkManager, EntityPlayerMP par2EntityPlayerMP)
           
 boolean isAllowedToLogin(String par1Str)
          Determine if the player is allowed to connect based on current server settings.
 boolean isWhiteListEnabled()
           
 void loadWhiteList()
          Either does nothing, or calls readWhiteList.
 void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP)
          Called when a player successfully logs in.
 void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP)
          Called when a player disconnects from the game.
 void readPlayerDataFromFile(EntityPlayerMP par1EntityPlayerMP)
          called during player login.
 void removeAllPlayers()
          kicks everyone with the "Server closed"
 void removeFromWhitelist(String par1Str)
          Remove the specified player from the whitelist.
 void removeOp(String par1Str)
          This removes a username from the ops list, then saves the op list
 EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
          creates and returns a respawned player based on the provided PlayerEntity.
 void saveAllPlayerData()
           
 void sendPacketToAllPlayers(Packet par1Packet)
           
 void sendPacketToAllPlayersInDimension(Packet par1Packet, int par2)
           
 void sendPlayerInfoToAllPlayers()
          sends 1 player per tick, but only sends a player once every 600 ticks
 void sendTimeAndRainingToPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
           
 void sendToAllNear(double par1, double par3, double par5, double par7, int par9, Packet par10Packet)
          params: x,y,z,d,dimension.
 void sendToAllNearExcept(EntityPlayer par1EntityPlayer, double par2, double par4, double par6, double par8, int par10, Packet par11Packet)
          params: srcPlayer,x,y,z,d,dimension.
 void serverUpdateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP)
          using player's dimension, update their movement when in a vehicle (e.g.
 void setCommandsAllowedForAll(boolean par1)
           
 void setGameType(EnumGameType par1EnumGameType)
           
 void setPlayerManager(WorldServer[] par1ArrayOfWorldServer)
          Sets the NBT manager to the one for the worldserver given
 void setWhiteListEnabled(boolean par1)
           
 void syncPlayerInventory(EntityPlayerMP par1EntityPlayerMP)
          sends the players inventory to himself
 void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
           
 void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myLogger

public static final Logger myLogger

playerEntityList

public final List playerEntityList
A list of player entities that exist on this server.

Constructor Detail

ServerConfigurationManager

public ServerConfigurationManager(MinecraftServer par1MinecraftServer)
Method Detail

initializeConnectionToPlayer

public void initializeConnectionToPlayer(NetworkManager par1NetworkManager,
                                         EntityPlayerMP par2EntityPlayerMP)

setPlayerManager

public void setPlayerManager(WorldServer[] par1ArrayOfWorldServer)
Sets the NBT manager to the one for the worldserver given


func_72375_a

public void func_72375_a(EntityPlayerMP par1EntityPlayerMP,
                         WorldServer par2WorldServer)

getEntityViewDistance

public int getEntityViewDistance()

readPlayerDataFromFile

public void readPlayerDataFromFile(EntityPlayerMP par1EntityPlayerMP)
called during player login. reads the player information from disk.


playerLoggedIn

public void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP)
Called when a player successfully logs in. Reads player data from disk and inserts the player into the world.


serverUpdateMountedMovingPlayer

public void serverUpdateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP)
using player's dimension, update their movement when in a vehicle (e.g. cart, boat)


playerLoggedOut

public void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP)
Called when a player disconnects from the game. Writes player data to disk and removes them from the world.


allowUserToConnect

public String allowUserToConnect(SocketAddress par1SocketAddress,
                                 String par2Str)
checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message


createPlayerForUser

public EntityPlayerMP createPlayerForUser(String par1Str)
also checks for multiple logins


respawnPlayer

public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP,
                                    int par2,
                                    boolean par3)
creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to respawn, an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player beat the game rather than dying


transferPlayerToDimension

public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP,
                                      int par2)

transferPlayerToDimension

public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP,
                                      int par2,
                                      Teleporter teleporter)

sendPlayerInfoToAllPlayers

public void sendPlayerInfoToAllPlayers()
sends 1 player per tick, but only sends a player once every 600 ticks


sendPacketToAllPlayers

public void sendPacketToAllPlayers(Packet par1Packet)

sendPacketToAllPlayersInDimension

public void sendPacketToAllPlayersInDimension(Packet par1Packet,
                                              int par2)

getPlayerList

public String getPlayerList()
returns a string containing a comma-seperated list of player names


getAllUsernames

public String[] getAllUsernames()

getBannedPlayers

public BanList getBannedPlayers()

getBannedIPs

public BanList getBannedIPs()

addOp

public void addOp(String par1Str)
This adds a username to the ops list, then saves the op list


removeOp

public void removeOp(String par1Str)
This removes a username from the ops list, then saves the op list


isAllowedToLogin

public boolean isAllowedToLogin(String par1Str)
Determine if the player is allowed to connect based on current server settings.


areCommandsAllowed

public boolean areCommandsAllowed(String par1Str)

getPlayerForUsername

public EntityPlayerMP getPlayerForUsername(String par1Str)

sendToAllNear

public void sendToAllNear(double par1,
                          double par3,
                          double par5,
                          double par7,
                          int par9,
                          Packet par10Packet)
params: x,y,z,d,dimension. The packet is sent to all players within d distance of x,y,z (d^2

sendToAllNearExcept

public void sendToAllNearExcept(EntityPlayer par1EntityPlayer,
                                double par2,
                                double par4,
                                double par6,
                                double par8,
                                int par10,
                                Packet par11Packet)
params: srcPlayer,x,y,z,d,dimension. The packet is not sent to the srcPlayer, but all other players where dx*dx+dy*dy+dz*dz

saveAllPlayerData

public void saveAllPlayerData()

addToWhiteList

public void addToWhiteList(String par1Str)
Add the specified player to the white list.


removeFromWhitelist

public void removeFromWhitelist(String par1Str)
Remove the specified player from the whitelist.


getIPWhiteList

public Set getIPWhiteList()

getNamesWhiteList

public Set getNamesWhiteList()

loadWhiteList

public void loadWhiteList()
Either does nothing, or calls readWhiteList.


sendTimeAndRainingToPlayer

public void sendTimeAndRainingToPlayer(EntityPlayerMP par1EntityPlayerMP,
                                       WorldServer par2WorldServer)

syncPlayerInventory

public void syncPlayerInventory(EntityPlayerMP par1EntityPlayerMP)
sends the players inventory to himself


getPlayerListSize

public int getPlayerListSize()

getMaxPlayers

public int getMaxPlayers()

getAvailablePlayerDat

public String[] getAvailablePlayerDat()
returns a list of usernames for which playerData is available


isWhiteListEnabled

public boolean isWhiteListEnabled()

setWhiteListEnabled

public void setWhiteListEnabled(boolean par1)

getPlayerList

public List getPlayerList(String par1Str)

getViewDistance

public int getViewDistance()
Gets the View Distance.


getServerInstance

public MinecraftServer getServerInstance()

getTagsFromLastWrite

public NBTTagCompound getTagsFromLastWrite()
gets the tags created in the last writePlayerData call


setGameType

public void setGameType(EnumGameType par1EnumGameType)

setCommandsAllowedForAll

public void setCommandsAllowedForAll(boolean par1)

removeAllPlayers

public void removeAllPlayers()
kicks everyone with the "Server closed"