All packet creating methods now create Packet instead of byte[]

This commit got way too big...
- Remove deprecated methods for sending packets
- Favor OutPacket & Packet over MaplePacketLittleEndianWriter, LittleEndianWriter, and byte array
- Split up some packet creating methods into separate classes
This commit is contained in:
P0nk
2021-08-21 01:36:51 +02:00
parent b5cd6887ae
commit 8f6860d7d7
231 changed files with 6403 additions and 6927 deletions

View File

@@ -43,7 +43,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
hwid = Hwid.fromHostString(hostString);
} catch (IllegalArgumentException e) {
log.warn("Invalid host string: {}", hostString, e);
c.announce(PacketCreator.getAfterLoginError(17));
c.sendPacket(PacketCreator.getAfterLoginError(17));
return;
}
@@ -57,7 +57,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
AntiMulticlientResult res = SessionCoordinator.getInstance().attemptGameSession(c, c.getAccID(), hwid);
if (res != AntiMulticlientResult.SUCCESS) {
c.announce(PacketCreator.getAfterLoginError(parseAntiMulticlientError(res)));
c.sendPacket(PacketCreator.getAfterLoginError(parseAntiMulticlientError(res)));
return;
}
@@ -70,7 +70,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
c.setWorld(server.getCharacterWorld(charId));
World wserv = c.getWorldServer();
if(wserv == null || wserv.isWorldCapacityFull()) {
c.announce(PacketCreator.getAfterLoginError(10));
c.sendPacket(PacketCreator.getAfterLoginError(10));
return;
}
@@ -82,7 +82,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
String[] socket = server.getInetSocket(c, c.getWorld(), channel);
if (socket == null) {
c.announce(PacketCreator.getAfterLoginError(10));
c.sendPacket(PacketCreator.getAfterLoginError(10));
return;
}
@@ -90,7 +90,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
c.setCharacterOnSessionTransitionState(charId);
try {
c.announce(PacketCreator.getServerIP(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1]), charId));
c.sendPacket(PacketCreator.getServerIP(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1]), charId));
} catch (UnknownHostException e) {
e.printStackTrace();
}