RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

PacketHandlers.Register -> Intentional Logic?

Vorspire

Knight
I'm not sure if this is intentional or not, but;
Code:
public static void Register(int packetID, int length, bool ingame, OnPacketReceive onReceive)
{
      m_Handlers[packetID] = new PacketHandler(packetID, length, ingame, onReceive);
 
      if (m_6017Handlers[packetID] == null)
            m_6017Handlers[packetID] = new PacketHandler(packetID, length, ingame, onReceive);
}

When you replace an existing packet handler by calling PacketHandlers.Register, the 6017 version never gets replaced due to this null check, I'v no idea why this null check is there, maybe it's intentional for whatever reason?

Anyway, the only way around this at the moment is to make a subsequent call to PacketHandlers.Register6017 with the same arguments you wish to override the handler with.

This problem became apparent when testing with client 7.0.24 classic.
 

mumuboy

Sorceror
I think its like that on purpose. That way you do not accidentally override the 6017 packet with an older one.
 
Top