Fix double welcome mail creation

This commit is contained in:
Melledy 2023-11-24 21:39:46 -08:00
parent 2af7059749
commit af836cdee1

View File

@ -121,6 +121,7 @@ public class Player {
@Setter private transient RogueInstance rogueInstance;
// Etc
private transient boolean isNew;
private transient boolean loggedIn;
private transient boolean inAnchorRange;
private transient int nextBattleId;
@ -145,6 +146,7 @@ public class Player {
this();
this.session = session;
this.accountUid = getAccount().getUid();
this.isNew = true;
this.initUid();
this.resetPosition();
@ -169,9 +171,6 @@ public class Player {
this.addAvatar(avatar);
this.getCurrentLineup().getAvatars().add(avatar.getAvatarId());
this.getCurrentLineup().save();
// Welcome mail
this.getMailbox().sendWelcomeMail();
}
public GameServer getServer() {
@ -654,6 +653,11 @@ public class Player {
this.enterScene(GameConstants.START_ENTRY_ID, 0, false);
}
// Send welcome mail after we load managers from the database
if (this.isNew) {
this.getMailbox().sendWelcomeMail();
}
// Set logged in flag
this.lastActiveTime = System.currentTimeMillis() / 1000;
this.loggedIn = true;