Merge branch 'unit-tests' of https://github.com/ljacqu/AuthMeReloaded into unit-tests
This commit is contained in:
commit
2922d04aa0
@ -96,7 +96,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public boolean delayedAntiBot = true;
|
public boolean delayedAntiBot = true;
|
||||||
|
|
||||||
// Hooks TODO: move into modules
|
// Hooks TODO: move into modules
|
||||||
public Permission vaultGroupManagement;
|
public Permission vaultGroupManagement; // TODO: Remove this instance, and replace every usage with permissions manager!
|
||||||
public Essentials ess;
|
public Essentials ess;
|
||||||
public MultiverseCore multiverse;
|
public MultiverseCore multiverse;
|
||||||
public CombatTagPlus combatTagPlus;
|
public CombatTagPlus combatTagPlus;
|
||||||
|
|||||||
@ -177,8 +177,7 @@ public class DataManager {
|
|||||||
* @param cleared List<String>
|
* @param cleared List<String>
|
||||||
* @param permission Permission
|
* @param permission Permission
|
||||||
*/
|
*/
|
||||||
public synchronized void purgePermissions(List<String> cleared,
|
public synchronized void purgePermissions(List<String> cleared, Permission permission) {
|
||||||
Permission permission) {
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (String name : cleared) {
|
for (String name : cleared) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -545,14 +545,14 @@ public final class Settings extends YamlConfiguration {
|
|||||||
try {
|
try {
|
||||||
return DataSource.DataSourceType.valueOf(configFile.getString(key, "sqlite").toUpperCase());
|
return DataSource.DataSourceType.valueOf(configFile.getString(key, "sqlite").toUpperCase());
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
ConsoleLogger.showError("Unknown database backend; defaulting to sqlite database");
|
ConsoleLogger.showError("Unknown database backend; defaulting to SQLite database");
|
||||||
return DataSource.DataSourceType.SQLITE;
|
return DataSource.DataSourceType.SQLITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config option for setting and check restricted user by username;ip ,
|
* Config option for setting and check restricted user by username;ip ,
|
||||||
* return false if ip and name doesnt amtch with player that join the
|
* return false if ip and name doesn't match with player that join the
|
||||||
* server, so player has a restricted access
|
* server, so player has a restricted access
|
||||||
* @param name String
|
* @param name String
|
||||||
* @param ip String
|
* @param ip String
|
||||||
@ -560,21 +560,21 @@ public final class Settings extends YamlConfiguration {
|
|||||||
* @return boolean */
|
* @return boolean */
|
||||||
public static boolean getRestrictedIp(String name, String ip) {
|
public static boolean getRestrictedIp(String name, String ip) {
|
||||||
|
|
||||||
Iterator<String> iter = getRestrictedIp.iterator();
|
Iterator<String> iterator = getRestrictedIp.iterator();
|
||||||
boolean trueonce = false;
|
boolean trueOnce = false;
|
||||||
boolean namefound = false;
|
boolean nameFound = false;
|
||||||
while (iter.hasNext()) {
|
while(iterator.hasNext()) {
|
||||||
String[] args = iter.next().split(";");
|
String[] args = iterator.next().split(";");
|
||||||
String testname = args[0];
|
String testName = args[0];
|
||||||
String testip = args[1];
|
String testIp = args[1];
|
||||||
if (testname.equalsIgnoreCase(name)) {
|
if (testName.equalsIgnoreCase(name)) {
|
||||||
namefound = true;
|
nameFound = true;
|
||||||
if (testip.equalsIgnoreCase(ip)) {
|
if (testIp.equalsIgnoreCase(ip)) {
|
||||||
trueonce = true;
|
trueOnce = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !namefound || trueonce;
|
return !nameFound || trueOnce;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -651,7 +651,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
BufferedWriter w = new BufferedWriter(fw);
|
BufferedWriter w = new BufferedWriter(fw);
|
||||||
w.write("Welcome {PLAYER} on {SERVER} server");
|
w.write("Welcome {PLAYER} on {SERVER} server");
|
||||||
w.newLine();
|
w.newLine();
|
||||||
w.write("This server use AuthMe protection!");
|
w.write("This server uses " + AuthMe.PLUGIN_NAME + " protection!");
|
||||||
w.close();
|
w.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user