mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 04:45:02 +01:00
Update mail state on login
This commit is contained in:
@@ -55,6 +55,14 @@ public class Mailbox extends PlayerManager implements GameDatabaseObject, Iterab
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public boolean hasNewMail() {
|
||||
return this.getList()
|
||||
.stream()
|
||||
.filter(mail -> !mail.isRead() && !mail.isRecv())
|
||||
.findAny()
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
public void sendMail(GameMail mail) {
|
||||
// Set mail id
|
||||
mail.setId(++this.lastMailId);
|
||||
|
||||
@@ -526,11 +526,13 @@ public class Player implements GameDatabaseObject {
|
||||
proto.getMutableFormation().addInfo(f.toProto());
|
||||
}
|
||||
|
||||
// Set state
|
||||
// Set player states
|
||||
var state = proto.getMutableState()
|
||||
.setStorySet(true);
|
||||
|
||||
state.getMutableMail();
|
||||
state.getMutableMail()
|
||||
.setNew(this.getMailbox().hasNewMail());
|
||||
|
||||
state.getMutableBattlePass();
|
||||
state.getMutableFriendEnergy();
|
||||
state.getMutableMallPackage();
|
||||
|
||||
Reference in New Issue
Block a user