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

1.14.0+dev not handling MP network updates often enough #3046

Closed
ProditorMagnus opened this issue May 6, 2018 · 9 comments
Closed

1.14.0+dev not handling MP network updates often enough #3046

ProditorMagnus opened this issue May 6, 2018 · 9 comments
Labels
Bug Issues involving unexpected behavior. MP Issues with multiplayer support or bundled multiplayer content. Network Issues in the networking API.

Comments

@ProditorMagnus
Copy link
Contributor

With 79c9862 local client falls behind in gamestate. Currently with +dev client I am around 3 min behind, based on 1.14.0 client and irc chat log.

@ProditorMagnus
Copy link
Contributor Author

At times when less changes are happening it can catch up to current time again.

@Vultraz
Copy link
Member

Vultraz commented May 6, 2018

THREE MINUTES???

@ProditorMagnus
Copy link
Contributor Author

More than 2 at least, somewhere between 2 and 3.

@gfgtdf
Copy link
Contributor

gfgtdf commented May 6, 2018

how does this becomes noticaable exactly? Does the game ide for a long time while other players did already send their moves? How do you know that they already sended their moves?

@ProditorMagnus
Copy link
Contributor Author

I only saw this in lobby, I dont really play games.

@gfgtdf
Copy link
Contributor

gfgtdf commented May 6, 2018

oh ok, i assumed the word 'gamestate' impled that you were talking about an ongoing mp game.

@jyrkive
Copy link
Member

jyrkive commented May 7, 2018

Looks like the problem is that wesnothd_connection::receive_data() only returns one message from the received queue, and mp_lobby::network_handler() doesn't call it in a loop.

result.swap(recv_queue_.front());
recv_queue_.pop_front();
return true;

Thus, if server sends messages faster than the client calls mp_lobby::network_handler(), the client falls behind.

@gfgtdf
Copy link
Contributor

gfgtdf commented May 7, 2018

Then the obvious solution would be to make mp_lobby::network_handler() call it in the loop.

@Wedge009 Wedge009 added Bug Issues involving unexpected behavior. MP Issues with multiplayer support or bundled multiplayer content. Network Issues in the networking API. labels May 7, 2018
Vultraz added a commit that referenced this issue May 9, 2018
This reverts commit 5fd833a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
Vultraz added a commit that referenced this issue May 9, 2018
This reverts commit 5fd833a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
@ProditorMagnus
Copy link
Contributor Author

The direct cause of current issue was reverted, but that means issue #3004 is now again relevant.

jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 6, 2018
This reverts commit 5fd833a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see wesnoth#3046). It seems 100 ms was enough to mask this issue.
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 7, 2018
This reverts commit 5fd833a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see wesnoth#3046). It seems 100 ms was enough to mask this issue.

(cherry-picked from commit 6a7bd05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. MP Issues with multiplayer support or bundled multiplayer content. Network Issues in the networking API.
Projects
None yet
Development

No branches or pull requests

5 participants