d3v1l401 / Bark-and-Barker

A Dark & Darker backend server emulator written in C#
GNU General Public License v3.0
2 stars 0 forks source link

Proxy #25

Closed Demonofpower closed 1 year ago

Demonofpower commented 1 year ago

Not 100% clean code but it works quite good.

d3v1l401 commented 1 year ago

I modified your code to avoid the huge switch-case list that would require too much work. Similarly to how the WrapperDeserializer manages to find the packet Descriptor for deserialization, I get all the Enum values from PacketCommand and build the class name based on the pattern the developers made.

From there, I call the descriptor and force-cast it to the recently mapped PacketCommand -> Class and convert it to a string. This should save us god knows how much time ;)

Demonofpower commented 1 year ago

Can we merge? @d3v1l401