mirror of
https://github.com/TotalFreedomMC/BukkitTelnet.git
synced 2024-05-24 21:51:24 +00:00
Don't log SocketExceptions. Fixes #9
This commit is contained in:
parent
2ef5146868
commit
8a6482c523
|
@ -16,6 +16,7 @@ import org.apache.logging.log4j.core.appender.AbstractAppender;
|
||||||
|
|
||||||
public class TelnetLogAppender extends AbstractAppender
|
public class TelnetLogAppender extends AbstractAppender
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 234234L;
|
||||||
|
|
||||||
private final Set<ClientSession> sessions;
|
private final Set<ClientSession> sessions;
|
||||||
private final SimpleDateFormat dateFormat;
|
private final SimpleDateFormat dateFormat;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -77,7 +78,14 @@ public final class ClientSession extends Thread
|
||||||
syncTerminateSession();
|
syncTerminateSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeLine("Logged in as " + username + ".");
|
||||||
|
TelnetLogger.info(clientAddress + " logged in as \"" + username + "\".");
|
||||||
|
|
||||||
|
// Start feeding data to the client.
|
||||||
|
telnet.getPlugin().appender.addSession(this);
|
||||||
|
|
||||||
mainLoop();
|
mainLoop();
|
||||||
|
|
||||||
syncTerminateSession();
|
syncTerminateSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,12 +364,6 @@ public final class ClientSession extends Thread
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeLine("Logged in as " + username + ".");
|
|
||||||
TelnetLogger.info(clientAddress + " logged in as \"" + username + "\".");
|
|
||||||
|
|
||||||
// Start feeding data to the client.
|
|
||||||
telnet.getPlugin().appender.addSession(this);
|
|
||||||
|
|
||||||
// Process commands
|
// Process commands
|
||||||
while (syncIsConnected())
|
while (syncIsConnected())
|
||||||
{
|
{
|
||||||
|
@ -371,6 +373,10 @@ public final class ClientSession extends Thread
|
||||||
{
|
{
|
||||||
command = reader.readLine();
|
command = reader.readLine();
|
||||||
}
|
}
|
||||||
|
catch (SocketException ex)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
TelnetLogger.severe(ex);
|
TelnetLogger.severe(ex);
|
||||||
|
|
Loading…
Reference in a new issue