network interface
This commit is contained in:
@@ -5,8 +5,6 @@ import network.Messages.AC35Data;
|
||||
import network.Messages.HostGame;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.List;
|
||||
|
||||
import static network.Utils.ByteConverter.intToBytes;
|
||||
|
||||
@@ -25,7 +23,7 @@ public class HostGameMessageEncoder implements MessageEncoder{
|
||||
//Downcast
|
||||
HostGame hostGame = (HostGame) message;
|
||||
|
||||
ByteBuffer hostGameMessage = ByteBuffer.allocate(14);
|
||||
ByteBuffer hostGameMessage = ByteBuffer.allocate(13);
|
||||
|
||||
ByteBuffer ipBytes = ByteBuffer.allocate(4);
|
||||
String ip = hostGame.getIp();
|
||||
|
||||
@@ -6,7 +6,6 @@ import network.Messages.HostGame;
|
||||
import network.Messages.HostGamesRequest;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
import static network.Utils.ByteConverter.intToBytes;
|
||||
|
||||
@@ -26,7 +25,7 @@ public class HostedGamesRequestEncoder implements MessageEncoder{
|
||||
|
||||
int numGames = hostGamesRequest.getKnownGames().size();
|
||||
|
||||
ByteBuffer hostedGamesRequestMessage = ByteBuffer.allocate(4+14*numGames);
|
||||
ByteBuffer hostedGamesRequestMessage = ByteBuffer.allocate(4+13*numGames);
|
||||
|
||||
hostedGamesRequestMessage.put(intToBytes(numGames));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user