32 |
|
* The hardcoded protocol version that we are using. |
33 |
|
* Used when handshaking with the server |
34 |
|
*/ |
35 |
< |
public final double PROTOCOL_VERSION = "1.0"; |
35 |
> |
public final double PROTOCOL_VERSION = 1.0; |
36 |
|
|
37 |
|
/** |
38 |
|
* Thread action DONOTHING. |
140 |
|
SwingClient.setControlStatus("Connection Established - " + _server); |
141 |
|
String response; |
142 |
|
response = _inBound.readLine(); |
143 |
< |
if (!Double.parseDouble(response.substring(10, response.length)) > PROTOCOL_VERSION)) { |
143 |
> |
if (!(Double.parseDouble(response.substring(10, response.length())) > PROTOCOL_VERSION)) { |
144 |
|
SwingClient.addMessage("WARNING: server is using a newer protocol (" + response + "), please update your client, continuing with old protocol (PROTOCOL " + PROTOCOL_VERSION + ")" ); |
145 |
< |
} else if (!Double.parseDouble(response.substring(10, response.length)) < PROTOCOL_VERSION)) |
145 |
> |
} else if (!(Double.parseDouble(response.substring(10, response.length())) < PROTOCOL_VERSION)) { |
146 |
|
throw new IOException("invalid protocol version"); |
147 |
|
} |
148 |
|
SwingClient.addMessage("Handshake Success"); |