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
Fix sending color codes to clients that don't support them. #5950
Conversation
src/server.cpp
Outdated
@@ -1644,14 +1644,21 @@ void Server::SendChatMessage(u16 peer_id, const std::wstring &message) | |||
{ | |||
DSTACK(FUNCTION_NAME); | |||
|
|||
std::wstring proccesed_message; |
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.
processed
src/server.cpp
Outdated
|
||
if (peer_id != PEER_ID_INEXISTENT) { | ||
Send(&pkt); | ||
} | ||
else { | ||
m_clients.sendToAll(&pkt); | ||
for (u16 id: m_clients.getClientIDs()) | ||
SendChatMessage(message); |
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.
this looks like it definitely doesn't do the right thing
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.
yeah you are right, I have no idea how that even compiled.
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.
fixed
src/server.cpp
Outdated
|
||
if (peer_id != PEER_ID_INEXISTENT) { | ||
Send(&pkt); | ||
} | ||
else { | ||
m_clients.sendToAll(&pkt); | ||
for (u16 id: m_clients.getClientIDs()) |
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 change function to be properly recursive if needed, here we create a packet and verify the peer_id in broadcast mode, please move packet ceration into unicast mode and the proto version check
Also remove `disable_escape_sequences` since it's not needed anymore.
src/server.cpp
Outdated
if (m_clients.getProtocolVersion(peer_id) < 27) | ||
processed_message = unescape_enriched(message); | ||
else | ||
processed_message = message; |
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 forget to tell you to remove this temporary variable and write directly to packet in the condition members
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.
ty
…#5950) Also remove `disable_escape_sequences` since it's not needed anymore.
Also remove `disable_escape_sequences` since it's not needed anymore.
Also remove `disable_escape_sequences` since it's not needed anymore.
…#5950) Also remove `disable_escape_sequences` since it's not needed anymore.
…#5950) Also remove `disable_escape_sequences` since it's not needed anymore.
No description provided.