Handlers read from InPacket instead of SeekableLittleEndianAccessor

This commit is contained in:
P0nk
2021-08-22 22:10:19 +02:00
parent 2232022cf1
commit da2d8abc56
182 changed files with 1223 additions and 1230 deletions

View File

@@ -3,10 +3,10 @@ package net.server.channel.handlers;
import client.MapleClient;
import config.YamlConfig;
import net.AbstractMaplePacketHandler;
import net.packet.InPacket;
import net.packet.Packet;
import tools.LogHelper;
import tools.PacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
/**
*
@@ -15,14 +15,14 @@ import tools.data.input.SeekableLittleEndianAccessor;
public class AdminChatHandler extends AbstractMaplePacketHandler {
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
public final void handlePacket(InPacket p, MapleClient c) {
if (!c.getPlayer().isGM()) {//if ( (signed int)CWvsContext::GetAdminLevel((void *)v294) > 2 )
return;
}
byte mode = slea.readByte();
byte mode = p.readByte();
//not saving slides...
String message = slea.readMapleAsciiString();
Packet packet = PacketCreator.serverNotice(slea.readByte(), message);//maybe I should make a check for the slea.readByte()... but I just hope gm's don't fuck things up :)
String message = p.readString();
Packet packet = PacketCreator.serverNotice(p.readByte(), message);//maybe I should make a check for the slea.readByte()... but I just hope gm's don't fuck things up :)
switch (mode) {
case 0:// /alertall, /noticeall, /slideall
c.getWorldServer().broadcastPacket(packet);