mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 15:17:56 +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 = "";
|
String line = "";
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
String[] args = line.split(":");
|
String[] args = line.split(":");
|
||||||
if (args[0].equals(auth.getNickname())) {
|
if (args[0].equalsIgnoreCase(auth.getNickname())) {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 4: {
|
case 4: {
|
||||||
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com");
|
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 = "";
|
String line = "";
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
String[] args = line.split(":");
|
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());
|
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld(), auth.getEmail());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPlayerEarlyChat(AsyncPlayerChatEvent event) {
|
public void onPlayerEarlyChat(final AsyncPlayerChatEvent event) {
|
||||||
if (event.isCancelled() || event.getPlayer() == null)
|
if (event.isCancelled() || event.getPlayer() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -275,11 +275,24 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||||
|
if (!event.isAsynchronous()) {
|
||||||
if (!Settings.isChatAllowed)
|
if (!Settings.isChatAllowed)
|
||||||
for (Player p : event.getRecipients()) {
|
for (Player p : event.getRecipients()) {
|
||||||
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
|
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
|
||||||
event.getRecipients().remove(p);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user