Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove client-side chat prediction. (#5055)
Network lag isn't really a big issue with chat and chat prediction makes writing mods harder.
- Loading branch information
Showing
4 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2826,7 +2826,15 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna | |
|
||
std::vector<u16> clients = m_clients.getClientIDs(); | ||
|
||
/* | ||
Send the message back to the inital sender | ||
if they are using protocol version >= 29 | ||
*/ | ||
|
||
u16 peer_id_to_avoid_sending = (player ? player->peer_id : PEER_ID_INEXISTENT); | ||
if (player->protocol_version >= 29) | ||
peer_id_to_avoid_sending = PEER_ID_INEXISTENT; | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sfan5
Member
|
||
for (u16 i = 0; i < clients.size(); i++) { | ||
u16 cid = clients[i]; | ||
if (cid != peer_id_to_avoid_sending) | ||
|
@red-001, this looks like peer_id_to_avoid_sending is set to PEER_ID_INEXISTENT if player is 0, so
player->protocol_version
could cause a crash, couldn't it?How about this?
u16 peer_id_to_avoid_sending = player && player->protocol_version < 29 ? player->peer_id : PEER_ID_INEXISTENT;