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

Rework network and server #3

Open
4 of 5 tasks
LethalEthan opened this issue Apr 26, 2021 · 2 comments
Open
4 of 5 tasks

Rework network and server #3

LethalEthan opened this issue Apr 26, 2021 · 2 comments
Assignees
Labels
Enhancement New feature or request In progress Issues that are being fixed Optimisation Issues/PR's that outline things that need to be optimised Slow Progress Issues/PR's that are slowly progressing

Comments

@LethalEthan
Copy link
Owner

LethalEthan commented Apr 26, 2021

I am running into issues with these packages as they will randomly fail, and I personally think it's quite janky in design and it's due to be re-done for a nicer system. For every packet, I will have a struct that is used to define what the packet contains as we already know that from wiki.vg, based off that I can just use an interface with 2 methods for Decode() and Encode() that will of course link to the corresponding packet encode and decode functions. This makes the code a lot cleaner and allows me to split up the handling instead of all being in one giant clump (lots of boilerplate in the server package rn). Here is the design I've made (https://imgur.com/a/cTR7mM9). Edit: In the image, I didn't mean interface, I meant struct methods since interfaces can be used for the purpose, but it is unnecessary and makes the code more convoluted.

  • Create packet Structs - Handshake and Status
  • Create packet Structs - Login
  • Create packet Structs - Play
  • Create struct methods for each packet
  • Switch to gnet for more efficient networking (if possible since the documentation ain't great, either that or I'm dumb)
@LethalEthan LethalEthan added Enhancement New feature or request Optimisation Issues/PR's that outline things that need to be optimised Slow Progress Issues/PR's that are slowly progressing labels Apr 26, 2021
@LethalEthan LethalEthan self-assigned this Apr 26, 2021
@LethalEthan LethalEthan added the In progress Issues that are being fixed label Apr 26, 2021
@LethalEthan
Copy link
Owner Author

Note: Add to the readme that HoneyGO is a cleanroom project. I did insinuate it but never explicitly said, I'm only using wiki.vg and the mc wiki to get my information from, and I'll add a sources.md to show where I get things from. Also, I must re-iterate that college is taking up a lot of my time I only have a few days free to actually work on this and even then I'm poofed so progress will be slow and most things are BTS. Anyway if you see this, have a good day :)

@LethalEthan
Copy link
Owner Author

LethalEthan commented Jun 28, 2021

TO-DO list after re-write or in alpha phase:

  • Don't use a separate go-routine for every client, just crappy and wasteful of resources, instead use a pool for client reactors
  • Make packet ID's easy to change

Update on the re-write: I'm now updating the struct names to be the packet name and not be based on the ID so I can easily switch out the packet ID's when it inevitably changes.

@LethalEthan LethalEthan added this to the Simple Creative server milestone Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request In progress Issues that are being fixed Optimisation Issues/PR's that outline things that need to be optimised Slow Progress Issues/PR's that are slowly progressing
Projects
None yet
Development

No branches or pull requests

1 participant