Improvements and send all mail fix

Mail ID no longer exists and is handled by it's position in the mail array
This commit is contained in:
Benjamin Elsdon
2022-04-26 11:57:55 +08:00
parent c68c75e8ce
commit a5677a8e34
8 changed files with 18 additions and 35 deletions

View File

@@ -80,9 +80,8 @@ public class SendMailCommand implements CommandHandler {
Grasscutter.getGameServer().getPlayerByUid(mailBuilder.recipient, true).sendMail(mailBuilder.mail);
CommandHandler.sendMessage(sender, "Message sent to user " + mailBuilder.recipient + "!");
} else {
// TODO: More testing required. This probably won't work for online players if DatabaseHelper.getPlayerById(string) didn't work.
for (GenshinPlayer player : DatabaseHelper.getAllPlayers()) {
player.sendMail(mailBuilder.mail);
Grasscutter.getGameServer().getPlayerByUid(player.getUid(), true).sendMail(mailBuilder.mail);
}
CommandHandler.sendMessage(sender, "Message sent to all users!");
}