peer2peer / private server

The three machines I used for Friday’s test are all on the same LAN behind the same router.

The one I used for single machine test is one of those machines.

Unless, of course, things don’t work as expected.

That’s my plan, but I won’t have enough time for that until next week. When I get down to it I will also test your fix for the encoding bug.

Oh, by the way, what happens (or rather: what should happen) when multiple players in a p2p network do things more or less simultaneously? Wouldn’t that cause some issues, especially if there’s a connection delay, like “overwriting” some moves when game’s state updates?

I tested three machine P2P connection with Vassal 3.2.6 today.

At first, I tried to connect in chain (A → B, B → C), like the last time. Didn’t work. Just as previously, the middle machine could see both others, but the first and the last machine in chain couldn’t see each other.

I noticed something interesting: the last machine to connect was receiving multiple “peer name (IP:port) connected” messages for a few moments after connecting. I didn’t manage to replicate this consistently, but it did occur several times during my later attempts.

Another minor issue here is that “peer name (IP:port) connected” messages still show 127.0.1.1 rather than the proper IP (clicking the P2P Network button now shows the proper local IP).

Then, I tried connecting in various other combinations and some worked. Many combinations did not work, even though according to your earlier explanations (if I understand them correctly), they should. Sometimes I could see every machine in the room from first and second machine, but not from the third one. Either way, after struggling for a while I found what appears to be a sure way to get a working p2p network.

It didn’t work when trying to connect both B and C to A, even though that worked in a single machine test with three clients.

It didn’t work after adding every IP on each machine. Then I managed to get a working three way connection somehow, disconnected and tried to replicate it, unsuccessfuly at first.

Then I noticed it’s actually possible to highlight several IPs on the list and connect to two (so presumably more) at the same time.

This made it work. On each machine, all others appeared in the room. So it seems the trick is to connect to both other machines from a single “network starter”. It’s not an ideal solution (somebody needs to collect IPs from all other players to start the network, rather than just send everyone a single number to connect to). However, at least it seems to be a working solution.

In summary:

A → B, B → C => BAD
B → A, C → A => BAD
A → B, A → C => GOOD

Also, 3.2.6 still doesn’t seem to save contact lists and custom P2P networks properly. After restarting Vassal I only see the default network and a blank contact list, both under Ubuntu and Windows.

I cannot reproduce the problems you are having creating a 3 way p2p network under Windows, it works perfectly.

I think this is actually a symptom of a deeper problem with the way vassal is finding IP numbers under Linux that is causing your troubles. I don’t have the resources to investigate this problem but will review the code. The fact that we have Vassal reporting the correct IP under Linux is a good start.

This bug is not simple to fix, have not attempted to yet. Still discussing potential solutions with Joel.

Try 3.2.6-svn8732:

vassalengine.sourceforge.net/builds/

This version seems to save contact list and custom networks properly under Ubuntu.

As a matter of fact I switched one of the three machines to Windows XP during my test to see if it changes anything, but it didn’t help. However, I’m not able to conduct a three way Windows test on my own to compare the results.

Before one of our regular games this week we had to wait for the last player for a while, so I did some P2P testing with other people for a change. We didn’t use it for a full game though, so I still don’t know if there are any issues with prolonged connections.

We used 3.2.6 release specifically, not the above build. Two players were on Windows, I was on Ubuntu.

We experienced similar connection issues as described before in my solo tests. At first no luck connecting, even after a short wait, and sometimes (not always) Vassal gave us “could not reach” errors. After a few attempts we somehow managed to get a working connection.

We noticed that a working P2P connection is pretty much instant, so any noticeable delay is likely an indication of failure.

Now, one of the Windows players was able to invite both me and the other Windows player. Neither me nor the other Windows player could invite him, while we were inviting each other with no problem. So, the only way for us to have a working P2P network was for him to invite both of us simultaneously by highlighting both entries in his contact list and clicking “connect”. Trying to do it any other way always resulted in at least one of us not seeing somebody else in the room.

In short:

A → B => unable to invite
C → B => unable to invite
A → C or C → A => connection
B → A & C => working three way network

As far as I know B’s connection to the internet works the same as mine (dynamic IP, behind a router and so on). He tried disabling firewall and stuff, didn’t help.

Any ideas why we weren’t able to invite B, even though it worked just fine when he invited us?

Anyway, other (minor) issues:

At one point the “remove” button in my contact list disappeared. It reappeared later (after restarting the module, I think). I wasn’t able to replicate this bug.

At some point during our failed connection attempts player B could only see me in the room. He didn’t see himself. We didn’t manage to replicate the bug.

Even after getting a working connection the active games panel sometimes shows wrong number of players in the main room. The current game panel shows the right number. It seems to automatically correct after a while. Weird behavior though.

When reporting peer connection Vassal reports 127.something.somethings rather than the proper IPs. Both under Linux and Windows. Is it trying to somehow detect IP and failing? Perhaps the solution would be to report the IP directly from the contact list?

In contact list there’s a bracket before IP:port, but not after. Like “[IP:port” rather than “[IP:port]”. Yeah, I know it’s inconsequential aesthetic issue, I’m reporting it just for the sake of it, since other players also noticed it.

Also, too many “connect” buttons that do different things made it a bit difficult to guide others through the connection process (“first connect to P2P, then click connect, then add my IP and connect… wait, where did you get confused again?”). I suggest labeling each of those differently in the future.

What exactly do you mean by unable to invite’? Exactly what messages appeared?

Double check that he has his P2P server set up with the correct Port number that you are trying to reach. Does B have any firewall software running that might prevent connections to that port?

What I mean exactly is: unable to connect using the connect button in the contact list, i.e. the last of the three connect buttons in the procedure, the one that results in “invitation sent to” message.

As explained in my above post, we also tried with his firewall off. Didn’t help.

Perhaps some non obvious software, but unfortunately he lives several hundred kilometers away, so I have no means to check directly.

Should he specifically open the port in his router setup? The other Windows player didn’t have to.

What I mean exactly is: unable to connect using the connect button in the contact list, i.e. the last of the three connect buttons in the procedure, the one that results in “invitation sent to” message.

“Invitation sent” message. Then nothing was happening for a minute or two. After a week I’m no longer certain if there were any “could not reach” errors at all when we tried that, but I don’t recall any. Perhaps once after a very long wait, unfortunately my memory on that is not clear. “Could not reach” errors always tend to be very delayed anyway.

None of us changed port numbers from the default 5050. Besides, if his port was wrong, wouldn’t that prevent us form having a working P2P network at all? The problem was: he successfully invited us (instantly), while none of us successfully invited him.

As explained in my above post, we also tried with his firewall off. Didn’t help.

Perhaps some non obvious software, but unfortunately he lives several hundred kilometers away, so I have no means to check directly.

Should he specifically open the port or setup port forwarding in his router configuration utility? The other Windows player didn’t have to. I only ever needed that for my private server to work, not for normal client connections.