mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
Fix bug where players weren't added to the online players list when they logged in.
This commit is contained in:
@@ -322,12 +322,14 @@ public final class World {
|
||||
* @return A {@link RegistrationStatus}.
|
||||
*/
|
||||
public RegistrationStatus register(final Player player) {
|
||||
if (isPlayerOnline(player.getUsername())) {
|
||||
String username = player.getUsername();
|
||||
if (isPlayerOnline(username)) {
|
||||
return RegistrationStatus.ALREADY_ONLINE;
|
||||
}
|
||||
|
||||
boolean success = playerRepository.add(player);
|
||||
if (success) {
|
||||
players.put(NameUtil.encodeBase37(username), player);
|
||||
Sector sector = sectorRepository.fromPosition(player.getPosition());
|
||||
sector.addEntity(player);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user