mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Upon hosting, and then creating a new instance and connecting to that IP, button transmissions work and print out on server!! :D
Took the send method out of the Message class as it didnt make sense to have it there. This meant taking it out of all subclasses too tags: #story[1055] pair[wmu16, zyt10]
This commit is contained in:
@@ -306,14 +306,11 @@ public class GameServerThread implements Runnable, Observer, ClientConnectionDel
|
||||
sendXml();
|
||||
}
|
||||
|
||||
void unicast(Message message, SocketChannel client) throws IOException {
|
||||
message.send(client);
|
||||
}
|
||||
|
||||
void broadcast(Message message) throws IOException{
|
||||
for(Player player : GameState.getPlayers()) {
|
||||
//System.out.println("Sending message seqNo[" + seqNum + "] to Player: " + player.toString());
|
||||
message.send(player.getSocketChannel());
|
||||
//heh
|
||||
player.getSocketChannel().socket().getOutputStream().write(message.getBuffer());
|
||||
}
|
||||
seqNum++;
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ public class HeartbeatThread extends Thread{
|
||||
if (!player.getSocketChannel().isConnected()){
|
||||
playerLostConnection(player);
|
||||
}
|
||||
|
||||
try {
|
||||
heartbeat.send(player.getSocketChannel());
|
||||
} catch (IOException e) {
|
||||
playerLostConnection(player);
|
||||
}
|
||||
//
|
||||
// try {
|
||||
// player.getSocketChannel().socket().getOutputStream().write(heartbeat.getBuffer());
|
||||
// } catch (IOException e) {
|
||||
// playerLostConnection(player);
|
||||
// }
|
||||
}
|
||||
|
||||
updateDelegate();
|
||||
|
||||
Reference in New Issue
Block a user