mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 07:07:55 +01:00
Fix some exception/errors
This commit is contained in:
parent
7e16be7f9e
commit
1fc6cdd40b
@ -171,7 +171,7 @@ public class FlatFileThread extends Thread implements DataSource {
|
||||
String line = "";
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] args = line.split(":");
|
||||
if (args[0].equals(auth.getNickname())) {
|
||||
if (args[0].equalsIgnoreCase(auth.getNickname())) {
|
||||
switch (args.length) {
|
||||
case 4: {
|
||||
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com");
|
||||
@ -228,7 +228,7 @@ public class FlatFileThread extends Thread implements DataSource {
|
||||
String line = "";
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] args = line.split(":");
|
||||
if (args[0].equals(auth.getNickname())) {
|
||||
if (args[0].equalsIgnoreCase(auth.getNickname())) {
|
||||
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld(), auth.getEmail());
|
||||
break;
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerEarlyChat(AsyncPlayerChatEvent event) {
|
||||
public void onPlayerEarlyChat(final AsyncPlayerChatEvent event) {
|
||||
if (event.isCancelled() || event.getPlayer() == null)
|
||||
return;
|
||||
|
||||
@ -275,11 +275,24 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
if (!Settings.isChatAllowed)
|
||||
for (Player p : event.getRecipients()) {
|
||||
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
|
||||
event.getRecipients().remove(p);
|
||||
}
|
||||
if (!event.isAsynchronous()) {
|
||||
if (!Settings.isChatAllowed)
|
||||
for (Player p : event.getRecipients()) {
|
||||
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
|
||||
event.getRecipients().remove(p);
|
||||
}
|
||||
} else {
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
if (!Settings.isChatAllowed)
|
||||
for (Player p : event.getRecipients()) {
|
||||
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
|
||||
event.getRecipients().remove(p);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user