Skip to content
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

Merged
merged 3 commits into from Jun 9, 2017

Conversation

red-001
Copy link
Contributor

@red-001 red-001 commented Jun 9, 2017

No description provided.

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;
Copy link
Member

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);
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@nerzhul nerzhul added the Bugfix 🐛 PRs that fix a bug label Jun 9, 2017
src/server.cpp Outdated

if (peer_id != PEER_ID_INEXISTENT) {
Send(&pkt);
}
else {
m_clients.sendToAll(&pkt);
for (u16 id: m_clients.getClientIDs())
Copy link
Member

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;
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@nerzhul nerzhul modified the milestone: 0.5.0 Jun 9, 2017
@SmallJoker SmallJoker merged commit 740b4be into minetest:master Jun 9, 2017
@red-001 red-001 deleted the colour_code_fix branch June 9, 2017 20:03
@red-001 red-001 restored the colour_code_fix branch October 17, 2017 14:02
red-001 added a commit to red-001/minetest that referenced this pull request Oct 17, 2017
…#5950)

Also remove `disable_escape_sequences` since it's not needed anymore.
sfan5 pushed a commit that referenced this pull request Nov 19, 2017
Also remove `disable_escape_sequences` since it's not needed anymore.
@sfan5 sfan5 mentioned this pull request Dec 5, 2017
SmallJoker pushed a commit that referenced this pull request Jun 3, 2018
Also remove `disable_escape_sequences` since it's not needed anymore.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 11, 2019
…#5950)

Also remove `disable_escape_sequences` since it's not needed anymore.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
…#5950)

Also remove `disable_escape_sequences` since it's not needed anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants