增加字符串下发 #1
|
|
@ -103,6 +103,10 @@ public class MaplePacketLittleEndianWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void writeUTF8(final String s) {
|
public final void writeUTF8(final String s) {
|
||||||
|
if (s == null ||s.isEmpty()){
|
||||||
|
this.writeShort(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));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -479,9 +479,9 @@ public class PacketHelper {
|
||||||
}
|
}
|
||||||
mplew.writeLong(getTime(-2L));
|
mplew.writeLong(getTime(-2L));
|
||||||
mplew.writeInt(-1);
|
mplew.writeInt(-1);
|
||||||
mplew.writeUTF8("947330670");
|
mplew.writeUTF8(equip.getdd());
|
||||||
mplew.writeUTF8("123456");
|
mplew.writeUTF8(equip.getdb());
|
||||||
mplew.writeUTF8("514234");
|
mplew.writeUTF8(equip.getqg());
|
||||||
} else {
|
} else {
|
||||||
mplew.writeShort((int) item.getQuantity());
|
mplew.writeShort((int) item.getQuantity());
|
||||||
mplew.writeMapleAsciiString(item.getOwner());
|
mplew.writeMapleAsciiString(item.getOwner());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue