From 414fad907972e2c5a13d47cfa839b42a6d216c9c Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Thu, 5 May 2022 17:17:27 -0700 Subject: [PATCH] Kick player if they use an invalid resources folder --- .../server/packet/recv/HandlerSetPlayerBornDataReq.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java index cae0cce65..02cdb1b8a 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java @@ -37,6 +37,13 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { return; } + // Make sure resources folder is set + if (!GameData.getAvatarDataMap().containsKey(avatarId)) { + Grasscutter.getLogger().error("No avatar data found! Please check your ExcelBinOutput folder."); + session.close(); + return; + } + String nickname = req.getNickName(); if (nickname == null) { nickname = "Traveler";