ucsd-cse125-sp24 / group5

A character-based ability shooter 2v2 heavily inspired by Four Seasons
https://cse125.ucsd.edu/2024/cse125g5
6 stars 0 forks source link

Refactor networking #2

Closed benjxia closed 3 months ago

benjxia commented 3 months ago

Made some namespace stuff consistent, switched over to smart pointers, and changed some types to better match the use case.

Alanine42 commented 3 months ago

I ran the refactored code like this: 1) start server, 2) start a client, 3) start another client.
Issue: The second client causes the server to receive packets it doesn't understand (error in packet types): image

Alanine42 commented 3 months ago

@benjxia could u look into this ^

Also, I'd prefer to keep sessions as a std::map<unsigned int, SOCKET, because when a connection closes, we need the session id to remove the right client's socket. It'd be time inefficient to do so with vector.

^I'm gonna push the close connection code asap