-
-
Couldn't load subscription status.
- Fork 496
Refactor CPlayerManager #1789
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
Refactor CPlayerManager #1789
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this check, because I presume it was unintentionally left out?
b160ec8 to
be931c6
Compare
1925f98 to
6fc418f
Compare
Me when i press Build: https://imgur.com/gallery/b4GHdOO
Co-authored-by: Marek Kulik <me@botder.com>
...soleCommands::WhoIs
Requires some testing.
Would be nice if we could gather 10-20 players.
One issue that might occur is that any of the containers (m_Players, m_SocketPlayerMap, m_JoinedByBitStreamVer) gets modified while iterating thru them.
It's very unlikely tho.
...into refactor/playermgr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(削除) Please help me out here. (削除ここまで)
Nvm oof, that didn't work the way I imagined it.
Merge conflicts must be resolved.
This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically.
This draft pull request was closed because it has been marked stale for 30 days with no activity.
Uh oh!
There was an error while loading. Please reload this page.
It was a very outdated code.
Also, I can't belive we've used it like this, its horrible.. Heap allocating and copying vectors, and maps for every packet?
This PR fixes it all! At once. (Coudnt really break it into more PRs).
Features:
BroadcastIf- Send the packet only to a player for whichpredicateistrueBroadcastJoinedIf- A member function that uses the internally stored and optimizedm_JoinedByBitStreamVerforBroadcastIfBroadcastJoinedDimension(I've refactored all of them to useBroadcastJoinedIf)GetAllPlayers()instead ofIterBeginandIterEnd, and useIterateJoinedwhere the old code usedIterBeginandIterEndand checked if the player is joined)CSendListfromCGameto its own file, because in the process of refactoring it ended up being quite bigGetNetServerReliabilityandGetNetServerPrioritytoCPacket. These functions are wrappers and translator ofGetFlags(They translate from our enum to raknet enums)When reviewing
@qaisjp Sorry for some fuckups in the commits, but coudn't properly
select stagedin vsc.I've tried my best to make the commits atomic.