Added database support for mail

Send mail command now works from console (to use it from console change the uuid in the 'SendMailCommand' file
This commit is contained in:
Benjamin Elsdon
2022-04-23 23:07:18 +08:00
parent d0538f7aee
commit b1f34f4fbe
5 changed files with 187 additions and 44 deletions

View File

@@ -74,6 +74,8 @@ public class GenshinPlayer {
private boolean showAvatar;
private ArrayList<AvatarProfileData> shownAvatars;
private Set<Integer> rewardedLevels;
private ArrayList<Mail> mail;
private int sceneId;
private int regionId;
@@ -112,6 +114,8 @@ public class GenshinPlayer {
this.flyCloakList = new HashSet<>();
this.costumeList = new HashSet<>();
this.mail = new ArrayList<>();
this.setSceneId(3);
this.setRegionId(1);
this.sceneState = SceneLoadState.NONE;
@@ -569,6 +573,16 @@ public class GenshinPlayer {
this.sendPacket(new PacketPrivateChatNotify(sender.getUid(), this.getUid(), message.toString()));
}
public List<Mail> getMail() { return mail; }
public void sendMail(Mail message) {
this.mail.add(message);
message._id = this.mail.size() + 1;
this.save();
this.sendPacket(new PacketMailChangeNotify(this, message));
}
public void interactWith(int gadgetEntityId) {
GenshinEntity entity = getScene().getEntityById(gadgetEntityId);