remove speed option + config description enhancements

This commit is contained in:
Gabriele C 2015-09-20 13:41:06 +02:00
parent 23e16bb717
commit d826777701
7 changed files with 65 additions and 55 deletions

View File

@ -486,7 +486,7 @@ public class AdminCommand implements CommandExecutor {
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
if (Settings.applyBlindEffect)
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
target.setWalkSpeed(0.0f);
target.setFlySpeed(0.0f);
}

View File

@ -109,7 +109,7 @@ public class UnregisterCommand implements CommandExecutor {
}
if (Settings.applyBlindEffect)
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.0f);
player.setFlySpeed(0.0f);
}

View File

@ -186,7 +186,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
if (Settings.applyBlindEffect)
player.removePotionEffect(PotionEffectType.BLINDNESS);
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.2f);
player.setFlySpeed(0.1f);
}

View File

@ -54,8 +54,10 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
if (!Settings.isMovementAllowed) {
player.setAllowFlight(true);
player.setFlying(true);
player.setFlySpeed(0.0f);
player.setWalkSpeed(0.0f);
if (Settings.isRemoveSpeedEnabled) {
player.setFlySpeed(0.0f);
player.setWalkSpeed(0.0f);
}
}
// Player is now logout... Time to fire event !
Bukkit.getServer().getPluginManager().callEvent(new LogoutEvent(player));

View File

@ -116,7 +116,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
}
if (Settings.applyBlindEffect)
player.removePotionEffect(PotionEffectType.BLINDNESS);
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.2f);
player.setFlySpeed(0.1f);
}

View File

@ -67,7 +67,7 @@ public final class Settings extends YamlConfiguration {
enableProtection, enableAntiBot, recallEmail, useWelcomeMessage,
broadcastWelcomeMessage, forceRegKick, forceRegLogin,
checkVeryGames, delayJoinMessage, noTeleport, applyBlindEffect,
customAttributes, generateImage;
customAttributes, generateImage, isRemoveSpeedEnabled;
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
getMySQLPort, getMySQLUsername, getMySQLPassword, getMySQLDatabase,
@ -136,6 +136,7 @@ public final class Settings extends YamlConfiguration {
isAllowRestrictedIp = configFile.getBoolean("settings.restrictions.AllowRestrictedUser", false);
getRestrictedIp = configFile.getStringList("settings.restrictions.AllowedRestrictedUser");
isMovementAllowed = configFile.getBoolean("settings.restrictions.allowMovement", false);
isRemoveSpeedEnabled = configFile.getBoolean("settings.restrictions.removeSpeed", true);
getMovementRadius = configFile.getInt("settings.restrictions.allowedMovementRadius", 100);
getJoinPermissions = configFile.getStringList("GroupOptions.Permissions.PermissionsOnJoin");
isKickOnWrongPasswordEnabled = configFile.getBoolean("settings.restrictions.kickOnWrongPassword", false);
@ -225,7 +226,7 @@ public final class Settings extends YamlConfiguration {
getForcedWorlds = configFile.getStringList("settings.restrictions.ForceSpawnOnTheseWorlds");
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
doubleEmailCheck = configFile.getBoolean("settings.registration.doubleEmailCheck", false);
sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", false);
sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", true);
useLogging = configFile.getBoolean("Security.console.logConsole", false);
disableSocialSpy = configFile.getBoolean("Hooks.disableSocialSpy", true);
bCryptLog2Rounds = configFile.getInt("ExternalBoardOptions.bCryptLog2Round", 10);
@ -294,6 +295,10 @@ public final class Settings extends YamlConfiguration {
set("Protection.enableProtection", false);
changes = true;
}
if (!contains("settings.restrictions.removeSpeed")) {
set("settings.restrictions.removeSpeed", true);
changes = true;
}
if (!contains("DataSource.mySQLMaxConections")) {
set("DataSource.mySQLMaxConections", 25);
changes = true;

View File

@ -1,6 +1,7 @@
DataSource:
# What type of database do you want to use?
# Can be set to: sqlite, sqlitehikari, mysql
# sqlitehikari should be more fast than normal sqlite but it's an experimental feature!
# (sqlitehikari should be more fast than normal sqlite but it's an experimental feature!)
backend: sqlite
# Enable database caching
caching: true
@ -44,24 +45,28 @@ DataSource:
mySQLRealName: realname
settings:
sessions:
# Do you want to enable session? When enabled
# the ip of a player will be bound to the nickname
# of the player on login. As long as neither of those
# two change players don't have to login on a reconnect
# Do you want to enable the session feature?
# If enabled, when a player authenticates successfully,
# his IP and his nickname is saved.
# The next time the player joins the server, if his IP
# is the same of the last time, and the timeout time
# hasn't expired, he will not need to authenticate.
enabled: false
# After how many minutes a session should timeout?
# 0 for unlimitted sessions, use 0 at your own risk!
# consider that session will end only after timeout, and
# if player's ip is changed but the timeout treshould isent
# ended, player will kick out of sever for invalidSession!
# After how many minutes a session should expire?
# 0 for unlimited time (Very dangerous, use it at your own risk!)
# Consider that session will end only after the timeout time, and
# if the player's ip has changed but the timeout hasn't expired,
# player will be kicked out of sever due to invalidSession!
timeout: 10
# Do we need to timeout the session if the player is offline
# And try to login with an another IP Address?
sessionExpireOnIpChange: false
# Should the session expire if the player try to login with an
# another IP Address?
sessionExpireOnIpChange: true
restrictions:
# Can unregistered/unlogged players chat and see chat, care , that block all commands except followers
# Can not authenticated players chat and see the chat log?
# Care that this feature blocks also all the commands not
# listed in the list below.
allowChat: false
# Commands allowed when a player is unlogged
# Commands allowed when a player is not authenticated
allowCommands:
- /login
- /register
@ -69,54 +74,52 @@ settings:
- /reg
- /email
- /captcha
# Maximum Registration per IP default: 1
# Max number of allowed registrations per IP (default: 1)
maxRegPerIp: 1
# Max allowed nick length
# Max allowed username length
maxNicknameLength: 16
# Player that is online arent
# kick out for "logged in from another
# Location", this options will prevent players that would exploit
# your account when you are playing
# When this setting is enabled, online players can't be kicked out
# due to "Logged in from another Location"
# This setting will prevent potetial security exploits.
ForceSingleSession: true
# Teleport every time player join at World Spawn location,
# even if they loggedin successfully,
# all quit and previus location will
# overwrite with World Spawn. Different From
# "teleportUnAuthedToSpawn"
# that teleport player back to his quit or kick position,
# when he loggedin
# If enabled, every player will be teleported to the world spawnpoint
# after successful authentication.
# The quit location of the player will be overwritten.
# This is different from "teleportUnAuthedToSpawn" that teleport player
# back to his quit location after the authentication.
ForceSpawnLocOnJoinEnabled: false
# This will prevent all lost of quit position, when player
# isent loggedin
# This option will save the quit location of the players.
SaveQuitLocation: false
# For activate Restricted user by ip u need
# to set True this option and configure the field
# AllowedRestrctedUser as show below
# To activate the restricted user feature you need
# to enable this option and configure the
# AllowedRestrctedUser field.
AllowRestrictedUser: false
# Restricted user will kick players that
# is listed below and they dont
# meet the match of username;ip
# Example playername;127.0.0.1 , if playername
# hasent 127.0.0.1 as ip address
# he will not be allowed to join the server
# The restricted user feature will kick players listed below
# if they dont match of the defined ip address.
# Example:
# AllowedRestrictedUser:
# - playername;127.0.0.1
AllowedRestrictedUser:
- playername;127.0.0.1
# Should unregistered players be kicked immediatly?
kickNonRegistered: false
# Should fail password players be kicked immediatly?
# Should players be kicked on wrong password?
kickOnWrongPassword: false
# should not loged in players be teleported to spawn?
# On login they will be teleported back to their normal
# position
# Should not logged in players be teleported to the spawn?
# After the authentication they will be teleported back to
# their normal position.
teleportUnAuthedToSpawn: false
# min allowed nick length
# Minimum allowed nick length
minNicknameLength: 4
# Can unregistered players walk around?
allowMovement: false
# After what time players who fail to login or register
# should be kicked. Set to 0 to disable.
# Should not authenticated players have speed = 0?
# This will reset the fly/walk speed to default value after the login.
removeSpeed: true
# After how many time players who fail to login or register
# should be kicked? Set to 0 to disable.
timeout: 30
# Regex sintax for allowed Char in player name.
# Regex sintax of allowed characters in the player name.
allowedNicknameCharacters: '[a-zA-Z0-9_]*'
# How far can unregistered players walk? Set to 0
# for unlimited radius