Search in sources :

Example 1 with GameService

use of org.apollo.game.service.GameService in project apollo by apollo-rsps.

the class LoginSession method handlePlayerLoaderResponse.

/**
 * Handles a response from the login service.
 *
 * @param request The request this response corresponds to.
 * @param response The response.
 */
public void handlePlayerLoaderResponse(LoginRequest request, PlayerLoaderResponse response) {
    this.request = request;
    GameService service = context.getGameService();
    Optional<Player> optional = response.getPlayer();
    if (optional.isPresent()) {
        service.registerPlayer(optional.get(), this);
    } else {
        sendLoginFailure(response.getStatus());
    }
}
Also used : Player(org.apollo.game.model.entity.Player) GameService(org.apollo.game.service.GameService)

Aggregations

Player (org.apollo.game.model.entity.Player)1 GameService (org.apollo.game.service.GameService)1