added getIdAndAdminForList() method in Lobby to facilitate sending a list of lobbies to a client
This commit is contained in:
parent
f910775f96
commit
922561d522
@ -79,6 +79,21 @@ public class Lobby {
|
|||||||
return this.lobbyID;
|
return this.lobbyID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds a message for the LISTL command.
|
||||||
|
* @return a string formatted for the clients convenients.
|
||||||
|
*/
|
||||||
|
public String getIdAndAdminForList(){
|
||||||
|
StringBuilder response = new StringBuilder();
|
||||||
|
response.append("Lobby ID: ");
|
||||||
|
response.append(this.lobbyID);
|
||||||
|
response.append(" Admin Username: ");
|
||||||
|
response.append(getAdmin().getClientUserName());
|
||||||
|
response.append(System.lineSeparator());
|
||||||
|
LOGGER.info(response.toString());
|
||||||
|
return response.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a player to the lobby.
|
* Adds a player to the lobby.
|
||||||
* TODO: ad an appropriate response. Currently hardcoded.
|
* TODO: ad an appropriate response. Currently hardcoded.
|
||||||
|
|||||||
Reference in New Issue
Block a user