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
NetPlayServer.cpp OnConnect() Minor Code Updates #10944
Conversation
9cd5bcc
to
af0f152
Compare
|
Please clean up the commit history, there's no reason to have changes that you revert within the same PR. |
1fe9535
to
d6fc450
Compare
|
Not sure I agree with your definition of "code duplicating comment" I agree that many of them aren't great comments, but I do feel like the code is slightly more readable with the comments. |
Looking back at this, yes, some of them are a little more readable with comments. Some of them are definitely code duplication though. (looking specifically at the |
|
The netplay version, and the "game running or pending" are the two least useful comments there.
You are overthinking things; If it improves readability, just split it out. This is not hot code, it runs once per player. Though I find splitting things out into small, single-use functions can actually hinders readability, as you now have to jump to the function to check what it does, an inline comment can be much more readable. While "self-documenting code" is good, I don't think you should ever rewrite something in a more self-documenting way just to avoid writing a comment (or worse, delete an existing comment). If I was cleaning that function up, I'd be focusing on removing the verbose And then instead of deleting most of those comments, rewrite then to explain "why" |
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'm just going though and commenting explictly on all the comments I think we shouldn't outright delete
d6fc450
to
e185985
Compare
|
@phire I didn't follow your directions exactly, but I think I've found a happy medium between function wrapping and commenting in this version. |
|
Yeah, they were suggestions, not directions. |
6443d8b
to
d886f8e
Compare
d8f5cfd
to
1c2a0a4
Compare
1c2a0a4
to
455f769
Compare
953419a
to
08cbe0c
Compare
…ver to netplay_version
…d NetPlayServer.cpp OnConnect() by putting commonly used code into named functions
…pp and NetPlayServer.cpp; Corrected syntax related to PEER_TIMEOUT in NetplayClient.cpp
…yServer.cpp and refactored OnConnect to use them
attempt to fix a failed call to operator<< in SendResponse()
08cbe0c
to
da803ad
Compare
Removed code duplicating comments, renamed a few variables, and updated some syntax.
No functional changes AFAIK