Open jacksonwelsh opened 4 years ago
I think a container class named Packet
or Message
would be neater than a raw HashMap
. Something with a constructor along these lines:
Packet packet = new Packet("update", someActor.getType(), someActor.toString());
Or even better, with a builder and an enum:
Packet packet = new PacketBuilder()
.withAction(PacketAction.UPDATE)
.withType(someActor.getType())
.withActor(someActor.toString())
.build();
This might be a bit overengineered, but I think it's worth it for the readability.
I worked on a gigantic networking refactor (406ad4c0) over the weekend that is now in both networking
and engineer
. As far as I know, everything now works perfectly.
Changes to note (excluding minor/transitive changes):
ClientAction
has been completedServerAction
classes have been completedActionManager
classMessageHandler
is gone, parts of it are living on in Packet
and NetworkUtils
I'm probably missing more than a few things in the changelist above, but that's everything I could summarize in post-review. Let me know if there are any issues.
oh thank god
On Mon, Dec 16, 2019 at 12:47 PM Cole Bryant notifications@github.com wrote:
I worked on a gigantic networking refactor (406ad4c https://github.com/rrhs-techapps-2019/Asteroids1920/commit/406ad4c00a851e05230b11391ef9cd9fa6e35054) over the weekend that is now in both networking https://github.com/rrhs-techapps-2019/Asteroids1920/tree/networking and engineer https://github.com/rrhs-techapps-2019/Asteroids1920/tree/engineer. As far as I know, everything now works perfectly.
Changes to note (excluding minor/transitive changes):
- Implementation of ClientAction has been completed
- Remaining ServerAction classes have been completed
- Packet actions now have their own enum
- Action instantiation has now been delegated to the ActionManager class
- Actions can now hold independent states (probably not useful, but w/e, I think it's better design)
- MessageHandler is gone, parts of it are living on in Packet and NetworkUtils
I'm probably missing more than a few things in the changelist above, but that's everything I could summarize in post-review. Let me know if there are any issues.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/rrhs-techapps-2019/Asteroids1920/issues/1?email_source=notifications&email_token=AE2HH4EMT5N25X7HZSBWJ3TQY7ENFA5CNFSM4JV5D7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG7WFPI#issuecomment-566190781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2HH4HBFWGFYQDZSGHN253QY7ENFANCNFSM4JV5D7CA .
ok so networking is going to be kinda complicated since there's a lot of moving parts involved
add comments to this issue if you need any sort of communication other than "add" and "update," these will all be defined in https://github.com/rrhs-techapps-2019/Asteroids1920/blob/networking/src/org/rrhs/asteroids/network/README.md with how to use them