This commit is contained in:
雪风 2025-03-18 23:09:36 +08:00
parent 908226e401
commit 246c4bb2c8
1 changed files with 2 additions and 3 deletions

View File

@ -102,10 +102,9 @@ public class MaplePacketLittleEndianWriter {
this.writeAsciiString(s); this.writeAsciiString(s);
} }
public final void writeUTF8(final String s) { public final void writeUTF8(String s) {
if (s == null ||s.isEmpty()){ if (s == null ||s.isEmpty()){
this.writeShort(0); s = "0";
return;
} }
this.writeShort((int) (short)s.getBytes(StandardCharsets.UTF_8).length); this.writeShort((int) (short)s.getBytes(StandardCharsets.UTF_8).length);
this.write(s.getBytes(StandardCharsets.UTF_8)); this.write(s.getBytes(StandardCharsets.UTF_8));