Fixed bug where players were being added to the GameState twice

#story[1047]
This commit is contained in:
Michael Rausch
2017-07-13 19:27:47 +12:00
parent 55db2c9961
commit 1e6fd1af09
2 changed files with 1 additions and 3 deletions
@@ -28,8 +28,6 @@ public class ServerListenThread extends Thread{
SocketChannel thisClient = socketChannel.accept(); SocketChannel thisClient = socketChannel.accept();
if (thisClient.socket() != null){ if (thisClient.socket() != null){
Player thisPlayer = new Player(thisClient); Player thisPlayer = new Player(thisClient);
GameState.addPlayer(thisPlayer);
delegate.clientConnected(thisPlayer); delegate.clientConnected(thisPlayer);
} }
} catch (IOException e) { } catch (IOException e) {
@@ -37,7 +37,7 @@ public class Header {
private void putInBuffer(byte[] bytes, long val){ private void putInBuffer(byte[] bytes, long val){
byte[] tmp = bytes.clone(); byte[] tmp = bytes.clone();
Message.reverse(tmp); Message.reverse(tmp);
buff.put(tmp); buff.put(tmp);
buffPos += tmp.length; buffPos += tmp.length;
buff.position(buffPos); buff.position(buffPos);