Updated 'MdgaServer' class.

Updated the 'MdgaServer' class by saving the host into the 'Game' class.
This commit is contained in:
Daniel Grigencha
2024-12-02 00:28:01 +01:00
parent 3e56de2a17
commit 7acc55fe25

View File

@@ -199,6 +199,9 @@ private void messageReceived(HostedConnection source, ClientMessage message) {
public void connectionAdded(Server server, HostedConnection hostedConnection) {
System.out.println("new connection " + hostedConnection); //NON-NLS
LOGGER.log(Level.DEBUG, "new connection {0}", hostedConnection); //NON-NLS
if (this.myServer.getConnections().size() == 1) {
this.logic.getGame().setHost(hostedConnection.getId());
}
}
@Override