Alert when internet connection lost while playing on line

Joel,
May we get a grip on a player’s reality.
‘Showing a message once you’ve detected that the connection has been lost is trivial. That’s not the problem. Detecting that the connection has been lost is what’s nontrivial.’
State the facts, the problem is that the detection that the connection has been lost is NOT being detected until a player is well into their turn. Showing a message that this disconnection has occurred is VITAL. Discovering that the connection has been lost is way too dependent on a shite load of factors.
Who the heck constantly monitors the Vassal server window? It is hidden by all the other windows a player interacts with. Some times a player can spend 15/20 minutes doing their ‘stuff’ only to discover that nothing actually happened with the game as seen by every other player. Frustrating to the nth degree.
‘You haven’t mentioned how you’re detecting that you’ve lost your connection (or how you’re detecting that one of your opponents has). What are you seeing?’
Alluded to in the above. Also note Harald’s remark - ‘Also, unnoticed disconnection can ruin some games…particularly those with hidden movement. I’ve seen it result in both players moving ( and talking on discord ) never realizing that their hidden movement can never result in discovering the enemy.’
Vassal server disconnection remains a problem. The ‘fix’ introduced some time ago (after many years of reports I add) is obviously not bullet proof.
All I want, and indeed perhaps the whole Vassal gaming community, is a way to trigger a popup message, with or without a sound, that states ‘Your Vassal Server internet connection has been lost’. I am not talking about something in the chat/dialogue window, it MUST be in your face, big, bold and unmistakable.
Is that something you can get your teeth into now? Screw vassal 4, this is a much more immediate issue.

I understand that. Taking an action—any action, whether printing something in the chat pane, showing a dialog, making a sound—is trivial. There’s nothing to it, these things are all basically single lines of code.

It is not at all trivial to detect when to take that action. I’m apparently failing to convey this.

If you want anything further to happen with this issue, please answer my questions:

How do you know you or your opponent has lost the connection? What are you seeing?

First, I would like to say I am not an expert on this subject, so I may have some details wrong in the following:

@palad0n: due to the way the internet works, this is far from a trivial problem. Internet connections are inherently stateless. Basically, when a move isn’t actively being submitted to the server or the server actively forwarding that move to the other players, there is no actual connection. The only way for VASSAL to know that the connection has been lost is to send a message to the server and to never get a reply. So, you basically have a choice here: you can submit one command and then not allow any more commands until that command has been acknowledged, or you can keep going on the assumption that the command will eventually get to the server and be processed. The only fix for that would be to keep a rolling log within VASSAL which keeps track of all commands sent and all commands acknowledged, and if it determines the connection has been lost, prompts the user, waits for reconnection, then starts resending from the last command that was acknowledged. But, what happens if only one command was “lost” and later commands went through?

The only complete solutions are to either block further commands until VASSAL can be certain each command has been processed by the server (and every other client!), which I don’t think anyone would be willing to actually play, or to keep a complete log of the entire game on every client plus the server so you can properly resynchronize the game after a lost connection, which is far from trivial (the clients theoretically already have the capability, thanks to logging, but the VASSAL 3 game server in no way has this capability (it is, in fact, something that Joel is considering for VASSAL 4, if I recall correctly).

And I would like to point out that, as long as only 1 player’s moves were lost due to the loss of connection, it is very easy to recover simply by having every other player synchronize to that one player once connection is re-established. If more than 1 player’s moves were lost, then you have to pick one player to resynchronize to, and every other player’s moves will indeed be permanently lost, unfortunately.

2 Likes

We know someone has lost connection when that player says I’m doing something, say an attack, and we respond with what and where. Sometimes it may also be that someone, normally me BTW, that notices the player has dropped of the connected players list in the server window.
I have just now conducted an experiment. I loaded the game we are playing, not online ATM. I then established a connection and opened a room for playing. I then established the VPN connection. No action on the disconnect front yet. I then moved 1 counter. Immediate chat window messages (2). 1st, lost connection to server. 2nd Disconnected.
Pics of each stage follow.
OK, if the chat window has messages sent to it by the system then why cannot these be also used to trigger something much more “in your face” BIG pop-up window so the player affected knows right away they have been disconnected. Basically an ‘alert’ that ‘monitors’ the chat window and if ‘Disconnected’ appears it is activated as well. Please, please tell me how I can do that. Surely there has to be some way to use this chat window text to do something else. Following pics are 1st before connecting, 2nd post connecting (obviously I forgot I still had my image handling software still active), 3rd with VPN enabled, 4th after moving 1 counter and 5th a blow up of the chat window text issued on disconnection:





pic of chat window entries

There are 6 players in the game. Any 3 of which are doing stuff. There is NO easy recovery. Also, the game, world in flames, the ‘inactive’ 3 players may also be interacting during a the active sides game impulse (performing CAP, intercepting naval moves, reacting aircraft into sea zones, etc.

That looks like a good hook to me. That “Disconnected” message can just pop up a modal warning window instead of only logging a chat message.

Good call, but do you know how? What is a 'modal warning?
I’m going to experiment with that chat window message, but I would really like to know something about the how can I do that.
I’m a persistent bugger, likely due fact that I’m an engineer (and please do not ask my wife what that leads to :slight_smile: )
I will find, or be led to, a solution to this.

Well, I think @uckelman was just wondering about implementing detection. So, now that’s solved with no additional code. You just piggyback on that same trigger to change of color on the network dialog box to a yellow warning or something…that way it would catch your eye, but you wouldn’t get a popup covering over what you were doing/looking at.

In the Vassal module context, it’s a window that pops up and has to be responded to before anything else can happen (for that player).

Vassal module editors can generate one using the Beanshell function Alert()

Alert() takes a text string and returns a null string. You can generate them in a Report Action, Dynamic Property calculation or anywhere else you can use beanshell.

This doesn’t match your more recent description of the events.

No notification suggests a completely different troubleshooting path from a notification that you’re finding hard to spot—which is why I wanted a clear description of what you were seeing. Thank you for providing that.

I stated no warning because who looks at the chat window on a regular basis. That there is indeed a warning there is great, but a player really needs that in your face popup. So is that chat window system message accessible via a GKC, trigger or whatever? All the guides, etc are all about sending messages etc to the chat window. I have yet to locate a means of detecting/intercepting a message sent to the chat window, particularly if that message is from the ‘system’ not players. Although even the latter could be useful as well at times.
For ex, if a player sends rollup to the chat window, a module developer could use that to inhibit all die roll options bar the (in my case) the 1D10 roll.

Also, apologies. I really failed to ascertain and interpret your request.

palad0n,

Is that a picture of Kinderdijk on your desktop?

There isn’t one.

I’m looking at adding a dialog for you. Just hang tight, it might be a few days.

You means the background pic. I do not know and please excuse my ignorance there. Windoze 11 and/or bing provide a regular new background pic a few time a day. All of them are quite pleasing.

Joel,
Thank you.
Up until I ran that ‘experiment’ I really did not know that Vassal posted a message to the chat window.

@palad0n Would you please try this build and do something to trigger losing your connection (e.g., as you had been with your VPN)?

You ought to see the message HEY HEY HEY LOST CONNECTION in the chat. I’d like to know if you actually do.

Yes, indeed 'HEY HEY HEY LOST CONNECTION" does appear in the chat window.
Next step is?

Remember, who looks at the chat window? Many World in Flames players have at least 2 monitors (some have 3). When they are moving stuff their view is the main map on 1 monitor. The chat window and server window, on another monitor, is not being monitored. That is why I ask for a ‘in your face’ pop-up on the (main) screen that states - ‘hey rsole you are no longer connected to the vassal server’. Tongue in cheek there with the rsole. The pop up must require specific closure before allowing the player to get back to playing (at least). One cannot account for absolute stupidity in closing and ignoring that warning pop up. But that is something totally outside anyone’s control. (apart from being a potential Darwin award candidate),

This was a test of whether the property change listener I added was being called at the appropriate time. Next will be a build with a dialog.