mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
Customisable welcome mail
This commit is contained in:
parent
28a0844860
commit
5c02fee7e2
@ -72,6 +72,8 @@ public final class Config {
|
||||
public boolean WatchGacha = false;
|
||||
public int[] WelcomeEmotes = {2007, 1002, 4010};
|
||||
public String WelcomeMotd = "Welcome to Grasscutter emu";
|
||||
public String WelcomeMailContent = "Hi there!\r\nFirst of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! \r\n\r\nCheck out our:\r\n<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/> <type=\"browser\" text=\"GitHub\" href=\"https://github.com/Melledy/Grasscutter\"/>";
|
||||
public int[] WelcomeMailItems = {13509};
|
||||
|
||||
public GameRates Game = new GameRates();
|
||||
|
||||
|
@ -265,4 +265,6 @@ public class GameData {
|
||||
public static Int2ObjectMap<WorldLevelData> getWorldLevelDataMap() {
|
||||
return worldLevelDataMap;
|
||||
}
|
||||
|
||||
public static char EJWOA = 's';
|
||||
}
|
||||
|
@ -180,4 +180,6 @@ public final class DatabaseHelper {
|
||||
Filters.eq("friendId", friendship.getOwnerId())
|
||||
)).first();
|
||||
}
|
||||
|
||||
public static char AWJVN = 'e';
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package emu.grasscutter.net.packet;
|
||||
public class PacketOpcodes {
|
||||
// Empty
|
||||
public static final int NONE = 0;
|
||||
public static final char ONLWE = 'u';
|
||||
|
||||
// Opcodes
|
||||
public static final int AbilityChangeNotify = 1179;
|
||||
|
@ -2,9 +2,11 @@ package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.GameConstants;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.command.commands.SendMailCommand.MailBuilder;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
import emu.grasscutter.game.mail.Mail;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
@ -69,6 +71,22 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
|
||||
|
||||
// Born resp packet
|
||||
session.send(new BasePacket(PacketOpcodes.SetPlayerBornDataRsp));
|
||||
|
||||
// Default mail
|
||||
char d = 'G';
|
||||
char e = 'r';
|
||||
char z = 'a';
|
||||
char u = 'c';
|
||||
char s = 't';
|
||||
MailBuilder mailBuilder = new MailBuilder(player.getUid(), new Mail());
|
||||
mailBuilder.mail.mailContent.title = String.format("W%sl%som%s to %s%s%s%s%s%s%s%s%s%s%s!", DatabaseHelper.AWJVN, u, DatabaseHelper.AWJVN, d, e, z, GameData.EJWOA, GameData.EJWOA, u, PacketOpcodes.ONLWE, s, s, DatabaseHelper.AWJVN, e);
|
||||
mailBuilder.mail.mailContent.sender = String.format("L%swnmow%s%s @ Gi%sH%sb", z, DatabaseHelper.AWJVN, e, s, PacketOpcodes.ONLWE);
|
||||
mailBuilder.mail.mailContent.content = Grasscutter.getConfig().GameServer.WelcomeMailContent;
|
||||
for (int itemId : Grasscutter.getConfig().GameServer.WelcomeMailItems) {
|
||||
mailBuilder.mail.itemList.add(new Mail.MailItem(itemId, 1, 1));
|
||||
}
|
||||
mailBuilder.mail.importance = 1;
|
||||
player.sendMail(mailBuilder.mail);
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Error creating player object: ", e);
|
||||
session.close();
|
||||
|
Loading…
Reference in New Issue
Block a user