Skip to content

Commit

Permalink
Made TetrinetProtocol.readLine static to fix a ClassCastException whe…
Browse files Browse the repository at this point in the history
…n using the QueryProtocol in TetrinetClient
  • Loading branch information
ebourg committed Feb 18, 2005
1 parent a73fe92 commit 383a5df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/java/net/jetrix/clients/TetrinetClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private void write(Message message)
public Message receiveMessage() throws IOException
{
// read raw message from socket
String line = ((TetrinetProtocol) protocol).readLine(in);
String line = TetrinetProtocol.readLine(in);
lastMessageTime = System.currentTimeMillis();
if (log.isLoggable(Level.FINER))
{
Expand Down
4 changes: 3 additions & 1 deletion src/java/net/jetrix/protocols/TetrinetProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,12 @@ private static String toHex(char c)
* Read a line as defined in the TetriNET protocol (that's ending with a
* 0xFF character). 0xOA and 0xOD are also accepted as EOL characters.
*
* @since 0.2.1
*
* @param in the stream to be read
* @throws IOException thrown if the stream is closed
*/
public String readLine(Reader in) throws IOException
public static String readLine(Reader in) throws IOException
{
StringBuffer input = new StringBuffer();

Expand Down

0 comments on commit 383a5df

Please sign in to comment.