Skip to content

Commit

Permalink
limit multiplayer chat message sending to 500 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 10, 2021
1 parent b7cc8bc commit be74a6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Etterna/Singletons/NetworkSyncManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,10 @@ ETTProtocol::SendChat(const std::string& message, string tab, int type)
writer.Key("payload");
writer.StartObject();
writer.Key("msg");
writer.String(message.c_str());
if (message.length() > 500)
writer.String(message.substr(0, 500).c_str());
else
writer.String(message.c_str());
writer.Key("tab");
writer.String(tab.c_str());
writer.Key("msgtype");
Expand Down

0 comments on commit be74a6f

Please sign in to comment.