Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace binarystruct with explicit marshal/unmarshal methods for packets #22

Open
2 tasks
Kangaroux opened this issue Jul 2, 2024 · 0 comments
Open
2 tasks

Comments

@Kangaroux
Copy link
Owner

Main reason for this is that the github.com/mixcode/binarystruct library does a ton of allocations and is quite slow compared to encoding/binary. It cuts down on boilerplate and is convenient for speeding up development but ultimately doing it manually is better. It would also be easier to test if the packet encoding/decoding is separate from the handlers.

Packets should have a Marshal and Unmarshal method:

type Packet interface {
    Marshal() ([]byte, error)
    Unmarshal(data []byte) error
}
  • Refactor authd packets
  • Refactor realmd packets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant