Commit 7b991d7b authored by 筱傑's avatar 筱傑 Committed by GitHub
Browse files

Update Welcome Mail Items Type (#369)

parent fb991d84
package emu.grasscutter; package emu.grasscutter;
import emu.grasscutter.game.mail.Mail;
public final class Config { public final class Config {
public String DatabaseUrl = "mongodb://localhost:27017"; public String DatabaseUrl = "mongodb://localhost:27017";
...@@ -76,7 +78,10 @@ public final class Config { ...@@ -76,7 +78,10 @@ public final class Config {
public int[] WelcomeEmotes = {2007, 1002, 4010}; public int[] WelcomeEmotes = {2007, 1002, 4010};
public String WelcomeMotd = "Welcome to Grasscutter emu"; 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 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 Mail.MailItem[] WelcomeMailItems = {
new Mail.MailItem(13509, 1, 1),
new Mail.MailItem(201, 10000, 1),
};
public boolean EnableOfficialShop = true; public boolean EnableOfficialShop = true;
......
...@@ -16,6 +16,8 @@ import emu.grasscutter.net.packet.PacketHandler; ...@@ -16,6 +16,8 @@ import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.game.GameSession.SessionState; import emu.grasscutter.server.game.GameSession.SessionState;
import java.util.Arrays;
@Opcodes(PacketOpcodes.SetPlayerBornDataReq) @Opcodes(PacketOpcodes.SetPlayerBornDataReq)
public class HandlerSetPlayerBornDataReq extends PacketHandler { public class HandlerSetPlayerBornDataReq extends PacketHandler {
...@@ -82,9 +84,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -82,9 +84,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
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.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.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; mailBuilder.mail.mailContent.content = Grasscutter.getConfig().GameServer.WelcomeMailContent;
for (int itemId : Grasscutter.getConfig().GameServer.WelcomeMailItems) { mailBuilder.mail.itemList.addAll(Arrays.asList(Grasscutter.getConfig().GameServer.WelcomeMailItems));
mailBuilder.mail.itemList.add(new Mail.MailItem(itemId, 1, 1));
}
mailBuilder.mail.importance = 1; mailBuilder.mail.importance = 1;
player.sendMail(mailBuilder.mail); player.sendMail(mailBuilder.mail);
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment