mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Updated observer so it sends out updated boats.xml when client disconnects
#story[1047] #pair[wmu16, zyt10]
This commit is contained in:
@@ -141,6 +141,8 @@ public class MainServerThread extends Observable implements Runnable, PacketBuff
|
||||
public void clientDisconnected(Player player) {
|
||||
serverLog("Player disconnected", 0);
|
||||
GameState.removePlayer(player);
|
||||
setChanged();
|
||||
notifyObservers();
|
||||
// sendXml();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package seng302.gameServer;
|
||||
|
||||
|
||||
import com.sun.xml.internal.bind.v2.TODO;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -218,8 +219,8 @@ public class ServerToClientThread implements Runnable, Observer {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: 24/07/17 zyt10 - fix a logic here when a client disconnected
|
||||
serverLog("ERROR OCCURRED, CLOSING SERVER CONNECTION: " + socket.getRemoteSocketAddress().toString(), 1);
|
||||
e.printStackTrace();
|
||||
closeSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user