Package net.minecraft.src
Class ServerConfigurationManager
java.lang.Object
net.minecraft.src.ServerConfigurationManager
- Direct Known Subclasses:
DedicatedPlayerList,IntegratedPlayerList
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe maximum number of players that can be connected at a time.final ListA list of player entities that exist on this server.protected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis adds a username to the ops list, then saves the op listvoidaddToWhiteList(String par1Str) Add the specified player to the white list.allowUserToConnect(SocketAddress par1SocketAddress, String par2Str) checks ban-lists, then white-lists, then space for the server.createPlayerForUser(String par1Str) also checks for multiple loginsfindPlayers(ChunkCoordinates par1ChunkCoordinates, int par2, int par3, int par4, int par5, int par6, int par7, Map par8Map, String par9Str, String par10Str, World par11World) Find all players in a specified range and narrowing down by other parametersvoidfunc_110459_a(ChatMessageComponent par1ChatMessageComponent, boolean par2) voidfunc_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer) protected voidfunc_96456_a(ServerScoreboard par1ServerScoreboard, EntityPlayerMP par2EntityPlayerMP) String[]Returns an array of the usernames of all the connected players.String[]Returns an array of usernames for which player.dat exists for.intReturns the number of players currently on the server.intOn integrated servers, returns the host's player data to be written to level.dat.intReturns the maximum number of players allowed on the server.getOps()getPlayerEntity(String par1Str) getPlayerList(String par1Str) returns a string containing a comma-seperated list of player namesintGets the View Distance.Returns the whitelisted players.voidinitializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP) booleanisAllowedToLogin(String par1Str) Determine if the player is allowed to connect based on current server settings.booleanisPlayerOpped(String par1Str) Returns true if the specified player is opped, even if they're currently offline.booleanvoidEither does nothing, or calls readWhiteList.voidplayerLoggedIn(EntityPlayerMP par1EntityPlayerMP) Called when a player successfully logs in.voidplayerLoggedOut(EntityPlayerMP par1EntityPlayerMP) Called when a player disconnects from the game.readPlayerDataFromFile(EntityPlayerMP par1EntityPlayerMP) called during player login. reads the player information from disk.voidKicks everyone with "Server closed" as reason.voidremoveFromWhitelist(String par1Str) Remove the specified player from the whitelist.voidThis removes a username from the ops list, then saves the op listrespawnPlayer(EntityPlayerMP oldPlayer, int iDefaultDimension, boolean playerLeavingTheEnd) voidSaves all of the players' current states.voidsendChatMsg(ChatMessageComponent par1ChatMessageComponent) Sends the given string to every player as chat message.voidsendPacketToAllPlayers(Packet par1Packet) sends a packet to all playersvoidsendPacketToAllPlayersInDimension(Packet par1Packet, int par2) Sends a packet to all players in the specified Dimensionvoidsends 1 player per tick, but only sends a player once every 600 ticksvoidsendToAllNear(double par1, double par3, double par5, double par7, int par9, Packet par10Packet) params: x,y,z,d,dimension.voidsendToAllNearExcept(EntityPlayer par1EntityPlayer, double par2, double par4, double par6, double par8, int par10, Packet par11Packet) params: srcPlayer,x,y,z,d,dimension.voidserverUpdateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP) FCNOTE: This is totally misnamed.voidsetCommandsAllowedForAll(boolean par1) Sets whether all players are allowed to use commands (cheats) on the server.voidsetGameType(EnumGameType par1EnumGameType) voidsetPlayerManager(WorldServer[] par1ArrayOfWorldServer) Sets the NBT manager to the one for the WorldServer given.voidsetWhiteListEnabled(boolean par1) voidsyncPlayerInventory(EntityPlayerMP par1EntityPlayerMP) sends the players inventory to himselfvoidtransferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) Transfers an entity from a world to another world.voidtransferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) creates and returns a respawned player based on the provided PlayerEntity.voidupdateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer) Updates the time and weather for the given player to those of the given worldprotected voidwritePlayerData(EntityPlayerMP par1EntityPlayerMP) also stores the NBTTags if this is an intergratedPlayerList
-
Field Details
-
playerEntityList
A list of player entities that exist on this server. -
maxPlayers
protected int maxPlayersThe maximum number of players that can be connected at a time. -
viewDistance
protected int viewDistance
-
-
Constructor Details
-
ServerConfigurationManager
-
-
Method Details
-
initializeConnectionToPlayer
public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP) -
func_96456_a
protected void func_96456_a(ServerScoreboard par1ServerScoreboard, EntityPlayerMP par2EntityPlayerMP) -
setPlayerManager
Sets the NBT manager to the one for the WorldServer given. -
func_72375_a
-
getEntityViewDistance
public int getEntityViewDistance() -
readPlayerDataFromFile
called during player login. reads the player information from disk. -
writePlayerData
also stores the NBTTags if this is an intergratedPlayerList -
playerLoggedIn
Called when a player successfully logs in. Reads player data from disk and inserts the player into the world. -
serverUpdateMountedMovingPlayer
FCNOTE: This is totally misnamed. It is called for all moving players, not just mounted ones -
playerLoggedOut
Called when a player disconnects from the game. Writes player data to disk and removes them from the world. -
allowUserToConnect
checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message -
createPlayerForUser
also checks for multiple logins -
transferPlayerToDimension
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 -
transferEntityToWorld
public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) Transfers an entity from a world to another world. -
sendPlayerInfoToAllPlayers
public void sendPlayerInfoToAllPlayers()sends 1 player per tick, but only sends a player once every 600 ticks -
sendPacketToAllPlayers
sends a packet to all players -
sendPacketToAllPlayersInDimension
Sends a packet to all players in the specified Dimension -
getPlayerListAsString
returns a string containing a comma-seperated list of player names -
getAllUsernames
Returns an array of the usernames of all the connected players. -
getBannedPlayers
-
getBannedIPs
-
addOp
This adds a username to the ops list, then saves the op list -
removeOp
This removes a username from the ops list, then saves the op list -
isAllowedToLogin
Determine if the player is allowed to connect based on current server settings. -
isPlayerOpped
Returns true if the specified player is opped, even if they're currently offline. -
getPlayerEntity
-
findPlayers
public List findPlayers(ChunkCoordinates par1ChunkCoordinates, int par2, int par3, int par4, int par5, int par6, int par7, Map par8Map, String par9Str, String par10Str, World par11World) Find all players in a specified range and narrowing down by other parameters -
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<x^2+y^2+z^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 wheredx*dx+dy*dy+dz*dz<d*d -
saveAllPlayerData
public void saveAllPlayerData()Saves all of the players' current states. -
addToWhiteList
Add the specified player to the white list. -
removeFromWhitelist
Remove the specified player from the whitelist. -
getWhiteListedPlayers
Returns the whitelisted players. -
getOps
-
loadWhiteList
public void loadWhiteList()Either does nothing, or calls readWhiteList. -
updateTimeAndWeatherForPlayer
public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer) Updates the time and weather for the given player to those of the given world -
syncPlayerInventory
sends the players inventory to himself -
getCurrentPlayerCount
public int getCurrentPlayerCount()Returns the number of players currently on the server. -
getMaxPlayers
public int getMaxPlayers()Returns the maximum number of players allowed on the server. -
getAvailablePlayerDat
Returns an array of usernames for which player.dat exists for. -
isWhiteListEnabled
public boolean isWhiteListEnabled() -
setWhiteListEnabled
public void setWhiteListEnabled(boolean par1) -
getPlayerList
-
getViewDistance
public int getViewDistance()Gets the View Distance. -
getServerInstance
-
getHostPlayerData
On integrated servers, returns the host's player data to be written to level.dat. -
setGameType
-
setCommandsAllowedForAll
public void setCommandsAllowedForAll(boolean par1) Sets whether all players are allowed to use commands (cheats) on the server. -
removeAllPlayers
public void removeAllPlayers()Kicks everyone with "Server closed" as reason. -
func_110459_a
-
sendChatMsg
Sends the given string to every player as chat message. -
respawnPlayer
public EntityPlayerMP respawnPlayer(EntityPlayerMP oldPlayer, int iDefaultDimension, boolean playerLeavingTheEnd)
-