Updated 'LobbyState' class.
Updated the 'LobbyState' class by removing the 'received(LeaveGameMessage msg, int from)' from it.
This commit is contained in:
@@ -143,23 +143,6 @@ public void received(LobbyNotReadyMessage msg, int from) {
|
|||||||
this.logic.getServerSender().broadcast(new UpdateReadyMessage(from, false));
|
this.logic.getServerSender().broadcast(new UpdateReadyMessage(from, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method will be called whenever the server received an LeaveGameMessage message.
|
|
||||||
* It will also get the client id of the player who send this message.
|
|
||||||
*
|
|
||||||
* @param msg as the message which was sent by the player as a LeaveGameMessage object.
|
|
||||||
* @param from as the client id of the player as an Integer.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void received(LeaveGameMessage msg, int from) {
|
|
||||||
if (from == this.logic.getGame().getHost()) {
|
|
||||||
this.logic.getServerSender().broadcast(new ShutdownMessage());
|
|
||||||
}
|
|
||||||
this.logic.getGame().removePlayer(from);
|
|
||||||
this.logic.getServerSender().broadcast(new LobbyPlayerLeaveMessage(from));
|
|
||||||
this.logic.getServerSender().disconnectClient(from);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will be called whenever the server received a StartGame message.
|
* This method will be called whenever the server received a StartGame message.
|
||||||
* It will also get the client id of the player who send this message.
|
* It will also get the client id of the player who send this message.
|
||||||
|
|||||||
Reference in New Issue
Block a user