Skip to content

Commit 1a3e079

Browse files
committed
No longer rely on the default OS charset to read the client data
1 parent dd5b6ae commit 1a3e079

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/java/net/jetrix/listeners/TSpecListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public String getName()
4949
public Client getClient(Socket socket) throws Exception
5050
{
5151
TetrinetProtocol protocol = (TetrinetProtocol) ProtocolManager.getInstance().getProtocol(TetrinetProtocol.class);
52-
String init = protocol.readLine(new InputStreamReader(socket.getInputStream()));
52+
String init = protocol.readLine(new InputStreamReader(socket.getInputStream(), net.jetrix.config.ServerConfig.ENCODING));
5353

5454
String dec = TetrinetProtocol.decode(init);
5555

src/java/net/jetrix/listeners/TetrinetListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Client getClient(Socket socket) throws Exception
5252
{
5353
// read the first line sent by the client
5454
TetrinetProtocol protocol1 = (TetrinetProtocol) protocolManager.getProtocol(TetrinetProtocol.class);
55-
String init = protocol1.readLine(new InputStreamReader(socket.getInputStream()));
55+
String init = protocol1.readLine(new InputStreamReader(socket.getInputStream(), net.jetrix.config.ServerConfig.ENCODING));
5656

5757
// test if the client is using the query protocol
5858
Protocol protocol = protocolManager.getProtocol(QueryProtocol.class);

0 commit comments

Comments
 (0)