mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 00:38:18 +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}.
|
* @return A {@link RegistrationStatus}.
|
||||||
*/
|
*/
|
||||||
public RegistrationStatus register(final Player player) {
|
public RegistrationStatus register(final Player player) {
|
||||||
if (isPlayerOnline(player.getUsername())) {
|
String username = player.getUsername();
|
||||||
|
if (isPlayerOnline(username)) {
|
||||||
return RegistrationStatus.ALREADY_ONLINE;
|
return RegistrationStatus.ALREADY_ONLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean success = playerRepository.add(player);
|
boolean success = playerRepository.add(player);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
players.put(NameUtil.encodeBase37(username), player);
|
||||||
Sector sector = sectorRepository.fromPosition(player.getPosition());
|
Sector sector = sectorRepository.fromPosition(player.getPosition());
|
||||||
sector.addEntity(player);
|
sector.addEntity(player);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user