...ping... you're disconnected...

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

Post by CIB »

Is there a ping command in Wesnoth? If not, it should get added.
Soliton
Site Administrator
Posts: 1732
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

CIB wrote:Is there a ping command in Wesnoth? If not, it should get added.
I don't think it's really needed but might be nice for some testing or so. If someone wants to implement it I can give some hints..
"If gameplay requires it, they can be made to live on Venus." -- scott
vetgirig
Posts: 40
Joined: November 19th, 2003, 1:20 pm
Contact:

Post by vetgirig »

A ping command is needed. When the host of the game dies and the other clients dont see it - a ping could be used to get the game transferred to a new host instead of having to save the game and restart it.

If the client dont reply to the ping command it should be removed as if it disconnected properly.

:ping <nick>

would be good thing to have to be able to confirm or not confirm if a players client has died.
User avatar
anakayub
Moderator Emeritus
Posts: 526
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

Today was a nightmare, I was getting lots and lots of ping timeouts, which were uncommon in 1.4.10.

I was getting them while idle in the lobby, while creating games, while saveloading, while waiting for game to start (despite receiving messages from other players), and while returning to the lobby from games.

At first I thought it was hardware, so I rechecked the modem line. But I was still getting them while actually being online (e.g. browsing the forums, downloading podcasts, etc.). I tried at one time loaded the latest 1.2 version, and no problems occurred.

I was using at the time an ADSL modem attached to an Apple Airport Extreme (n). Wesnoth 1.3.12 on Mac OS 10.5.1. Average speed of around 60 kb/s.

Are there any tips to reduce these disconnections? I hope that I'm not being too emotional here, as I'm really annoyed.
Take a breath.
Krimzon
Posts: 23
Joined: July 24th, 2007, 4:02 pm

Post by Krimzon »

I believe I have discovered the 'fault' with the ping function, so to speak.

When a player has different game settings i.e "accelerated speed" then the players in the game who do not have that function activated fall behind in the game and so miss the 'ping' communication and disconnect.
meriton
Posts: 77
Joined: March 17th, 2007, 1:17 pm

Post by meriton »

I wonder how many pings the server sends in 30 (or 60) seconds? Are we talking about one packet being lost or twenty?

In any case, I don't see the need for a ping command if wesnoth pings automatically ...
User avatar
anakayub
Moderator Emeritus
Posts: 526
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

Hm, Soliton, is the increase in timeout on the client or server side? (I'm not knowledgeable in these kinds of stuff) I'm now away from my broadband connection at home, using an EDGE connection via phone modem. I can't even connect to the server, at all, despite like 20 tries, but I'm still able to use the rest of the 'Net normally. Before this there wouldn't be a problem, as I would connect in 30-40 seconds. Here, I'm getting the timeouts after only 20 seconds. Thus, I also doubt Krimzon's idea that different game settings might be the cause, as then there shouldn't be ping timeouts while idling in the lobby, or returning to it from other games.

P.S. It's going to be a painful 5 days of not playing/obs MP games on the server... :P

Edit: I'm now at least able to observe games on the server, not willing to risk playing yet. I think this is from the increased timeout period. Thanks, Soliton.
Take a breath.
Soliton
Site Administrator
Posts: 1732
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

anakayub wrote:Hm, Soliton, is the increase in timeout on the client or server side? (I'm not knowledgeable in these kinds of stuff) I'm now away from my broadband connection at home, using an EDGE connection via phone modem. I can't even connect to the server, at all, despite like 20 tries, but I'm still able to use the rest of the 'Net normally. Before this there wouldn't be a problem, as I would connect in 30-40 seconds. Here, I'm getting the timeouts after only 20 seconds.
Well, if you ping timeout then you must have connected to the server since it only checks once you receive a ping. Your device might be slow in displaying the lobby though. However when wesnoth takes a long time processing stuff without trying to read network data the ping timeout is reset so that shouldn't be an issue either.
A possible problem can be receiving big amounts of data and still checking for data in that time (ie also checking the timeout). I'm not sure if wesnoth does that anywhere.

The increased default timeout is client side. The server sends pings every 10 seconds so far. In the next version you will now also be able to tweak the timeout value via the preference file so those who believe their disconnects are not caused by their connection or have really slow connections can tweak the value or turn it off completely.
"If gameplay requires it, they can be made to live on Venus." -- scott
User avatar
Haibane
Posts: 154
Joined: June 15th, 2006, 6:38 am
Location: Old Home, Guri

Post by Haibane »

Soliton wrote:The increased default timeout is client side. The server sends pings every 10 seconds so far. In the next version you will now also be able to tweak the timeout value via the preference file so those who believe their disconnects are not caused by their connection or have really slow connections can tweak the value or turn it off completely.
Not sure if I understand this. Server sends ping every 10 seconds and client has to catch it ? Is that all ?
I would expect server to send echo request and client to send reply. Otherwise I don't know how server and others could know about player's disconnect ... ? Or it's aimed just to check status of player itself, not to check status of others ? If so, it's just a little more than useless for most players, imho ... in such case, ping command would be still useful.

Ok, I hope I'm just wrong or confused because I don't know enought, care to explain it a bit please ? :roll:
If it's all a dream, now wake me up. If it's all real, just kill me.
Weeksy
Posts: 1017
Joined: January 29th, 2007, 1:05 am
Location: Oregon

Post by Weeksy »

client has to catch, figure out that it needs to throw back, throw back, and have server catch.
If enough people bang their heads against a brick wall, The brick wall will fall down
GilbertBB
Posts: 3
Joined: December 11th, 2007, 11:41 am

Post by GilbertBB »

I think i am having a problem with the ping command. I have not been able to log on all day. Normally I do not have trouble logging on but it takes awhile (20ish seconds). Recently, I have been been trying to log on and the connection quickly times out after 10 seconds. My internet seems to be working fine and I have a really fast connection. I don't seem to have any firewall issues. I'm puzzled because as far as I know nothing has changed.

any ideas?
User avatar
anakayub
Moderator Emeritus
Posts: 526
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

Just to confirm my understanding:

When we try to reload a game, the client has to send all of the saved game information to the server, right? Thus, there can be occasions when a ping reply may not be sent to the server when saveloading a game, especially when the saveload is midgame (at least >300 kb), as all of the outgoing packets go to uploading the data and none sent for ping reply. Does this also lead to ping timeouts when trying to join a saveload over 300 kb, as the client may not receive the ping trying to receive game data, and thus not send ping reply? Thanks.
Take a breath.
User avatar
Haibane
Posts: 154
Joined: June 15th, 2006, 6:38 am
Location: Old Home, Guri

Post by Haibane »

Weeksy wrote:client has to catch, figure out that it needs to throw back, throw back, and have server catch.
Just a wild guess ?

I found by an accident what Soliton wrote elsewhere:
Soliton wrote:Well, there are two sides to detecting a network disconnection, the server and the client side. Since recently the server sends a ping every 5 minutes to make sure ghost users are detected. I've now changed that to every 10 seconds and actually process the pings on the client side to see if/how much we're lagging. If the client did not receive a ping in the last 30 seconds it'll consider itself disconnected. We'll see how that works out when 1.3.12 is out..
Sounds like you might be right, but in such case, timeout can be configurable at client side just up to server timeout, otherwise everyone needs his own timeout at server side which doesn't make any sense. If server timeout takes 5 minutes, it's possible, but it seems like too much for me. Also to have different timeouts for client and server side sounds a little strange, thought it's not necessary wrong way.
Well, that's why I'm wondering.
If it's all a dream, now wake me up. If it's all real, just kill me.
User avatar
anakayub
Moderator Emeritus
Posts: 526
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

Soliton wrote: A possible problem can be receiving big amounts of data and still checking for data in that time (ie also checking the timeout). I'm not sure if wesnoth does that anywhere.
anakayub wrote:When we try to reload a game, the client has to send all of the saved game information to the server, right? Thus, there can be occasions when a ping reply may not be sent to the server when saveloading a game, especially when the saveload is midgame (at least >300 kb), as all of the outgoing packets go to uploading the data and none sent for ping reply. Does this also lead to ping timeouts when trying to join a saveload over 300 kb, as the client may not receive the ping trying to receive game data, and thus not send ping reply? Thanks.
I think the scenario you stated does happen. It's suggested by the ping timeouts others and I experience when joining/observing or saveloading a match mid-game. This is especially true for mid-game matches as the client has to receive (if joining) or send (if saveloading) all of the information from prior to the reload (and thus file sizes exceed 100kb), making dialup connections inadequate to send/receive game data and send/receive ping data at the same time. What I did for the time being is make a test build with increased timeout periods (do note that I'm not a software developer, just a hobbyist thing):

In network.cpp:

Code: Select all

DBG_NW << "Checking network lag. Last ping: " << last_ping
		<< " Current time: " << now << "\n";
	// Reset last_ping if we didn't check for the last 10s.
	if (last_ping != 0 && last_ping_check + 10 <= now) last_ping = now;
	if (last_ping != 0 && last_ping + 30 <= now) {
		ERR_NW << "No server ping since " << (now - last_ping)
			<< " seconds. Connection timed out.\n";
		throw network::error(_("No server ping since at least 30 seconds. "
			"Connection timed out."));
	}
	last_ping_check = now;
I changed the 10 to 30, and the 30 to 60. So far no more ping timeout problems. I'm now able to join games with data of approximately below 200 kb (the biggest file was 170), and no ping timeout problems while observing in-game.

PS: The compressed saves (which I saw in the recent SVN changelog IIRC) will do a lot to solve this problem at the joining/creating aspect.

Edit: At the moment, the biggest savefile I can access is about 280 kb.
Take a breath.
taliosfalcon
Posts: 2
Joined: December 20th, 2007, 1:41 am

Post by taliosfalcon »

GilbertBB wrote:I think i am having a problem with the ping command. I have not been able to log on all day. Normally I do not have trouble logging on but it takes awhile (20ish seconds). Recently, I have been been trying to log on and the connection quickly times out after 10 seconds. My internet seems to be working fine and I have a really fast connection. I don't seem to have any firewall issues. I'm puzzled because as far as I know nothing has changed.

any ideas?
this has cropped up for me yesterday and today as well, i've been running a constant set of pings to various places to make sure my connection is fine, and sure enough my pings go on completely uniterrupted whilst i'm kicked out of the lobby for a ping disconnect about 30 seconds after i login. Had absolutely no problems until yesterday which is very odd
Post Reply