StrangeLoopGames / EcoIssues

131 stars 21 forks source link

Eco Master Server is reporting incorrect port data to end users. #10080

Closed arcreigh closed 5 years ago

arcreigh commented 5 years ago

Was working with Pam from the discord support channel and I came to the conclusion that EcoServer.exe is reporting the incorrect game port to the Server Browser. My network is as follows Client -> Internet -> router/firewall -> EcoServer ports 2999-3001 tcp/udp

I am able to directly connect to the server by specifying eco.playtfg.com:3000. But when I search PlayTFG in the browser and attempt to connect the connection fails. I then used a VPN to be on the same network as the server and proceeded to connect to the server through the browser successfully. At first glance this looked to me that the browser was giving the internal IP address to end users out on the internet. After working with Pam he pulled some data that showed the server was reporting the correct external IP and the incorrect port.

{"Description":"PlayTFG","UniqueIdentifier":5787815164890613332,"Address":"142.54.191.195","GamePort":8518}]

You'll note that the GamePort: is listed as 8518

Going to the server and running net stat I see port 3000 UDP is open from the EcoServer.exe. screen shot 2018-11-20 at 12 42 29 pm

For now it seems that I will need to have end users directly connect.

-Update - I ran wireshark on both my client computer and my server and inspected the data from the DIS packet sent to 35.163.80.53 (ECO Master Server?)

**Here is the data sent from my server to the master server**
{
    "UniqueIdentifier":5787815164890613332,
    "GamePort":3000,
    "WebPort":3001,
    "IsLAN":false,
    "Description":"PlayTFG",
    "DetailedDescription":"Welcome to the PlayTFG ECO Server!",
    "Category":1,
    "OnlinePlayers":0,
    "TotalPlayers":1,
    "AdminOnline":false,
    "TimeSinceStart":167544.23281432281,
    "TimeLeft":2424455.8514620755,
    "Animals":939,
    "Plants":96585,
    "Laws":1,
    "WorldSize":"0.52km²",
    "Version":"0.7.8.3 beta",
    "EconomyDesc":"0 trades, 0 contracts",
    "SkillSpecialization":"Medium",
    "SkillSpecializationSetting":2,
    "Language":"English",
    "HasPassword":false,
    "HasMeteor":true,
    "DistributionStationItems":"None."
}

Now the client my home pc is receiving this data from the "ECO Master Server"

{
    "Address":"142.54.191.195",
    "UniqueIdentifier":5787815164890613332,
    "GamePort":15322,
    "WebPort":3001,
    "IsLAN":false,
    "Description":"PlayTFG",
    "DetailedDescription":"Welcome to the PlayTFG ECO Server!",
    "Category":1,"OnlinePlayers":0,
    "TotalPlayers":1,
    "AdminOnline":false,
    "TimeSinceStart":166665.85506616221,
    "TimeLeft":2425334.2292102361,
    "Animals":937,
    "Plants":96550,
    "Laws":1,
    "WorldSize":"0.52km²"
    ,"Version":"0.7.8.3 beta"
    ,"EconomyDesc":"0 trades, 0 contracts",
    "SkillSpecialization":"Medium",
    "SkillSpecializationSetting":2,
    "Language":"English",
    "HasPassword":false,
    "HasMeteor":true,
    "DistributionStationItems":"None."
}

After examining the GamePort data that is received from the master server I can now confirm that the ECO Master Server is changing the port data that I am sending to it from my ECO server. This will cause all client connections from the server browser to fail.

Deantwo commented 5 years ago

So the server assumes that the internal port is also the external port? Nice find!

arcreigh commented 5 years ago

Thanks! and not quite, I think the Master server is giving back the source port that the client is using to connect to it I'll have to examine the packets a bit closer to come to a definitive answer on that.

mirasrael commented 5 years ago

Hi @arcreigh Can you check if it is working as expected now?

arcreigh commented 5 years ago

So this is still not working in my version of the game 7.8.3 I have to run to work and will be able to assist in troubleshooting soon.

arcreigh commented 5 years ago

OK I am finally situated at work I can remote in and test as needed.

mirasrael commented 5 years ago

@arcreigh please check now

arcreigh commented 5 years ago

Game Browser is showing a valid ping from one computer lemme check another.

arcreigh commented 5 years ago

2nd computer is reporting ping correctly as well I just need to update my server and things should be all set.

arcreigh commented 5 years ago

Also the Master Server is now sending the correct GamePort data to the client, according to the DIS packet obtained through wireshark.

arcreigh commented 5 years ago

Hold up correction to that, the Master Server is sending correct port data for the "Continue Game" Option but is still sending incorrect port data when trying to connect to the server hmmmmm....

BlazeGuy2 commented 5 years ago

Fix is in, master server needs to be updated.

arcreigh commented 5 years ago

Gotcha!

arcreigh commented 5 years ago

Thanks for all of your efforts Happy Thanksgiving if you are in the US!

mirasrael commented 5 years ago

@arcreigh you should connect from New Game list or from Recent servers list to get Continue button working. Because by default it saves last IP and port received from master server and tries to connect to them. When you go through New Game or Recent servers it will refresh info from master server. Probably we should always ask master server for Continue button for new connection endpoint.

arcreigh commented 5 years ago

I am attaching 3 packet captures please use wireshark to read the data in the captures,

When using the "Continue" Feature from the main menu this is the traffic generated (Failed connection) https://drive.google.com/open?id=1FWQ_kBBGbEqd53lT3dxqpg-D8m3iXJ5D

When using recent servers list this is the traffic generated. (Failed Connection) https://drive.google.com/open?id=1owx0YYJqJ_PoNNAFJp8s-Z5ClXY_jf6b

Finally when directly connecting to the server this is the traffic generated and results in a successful connection to the server. https://drive.google.com/open?id=1Y6tPwFmLxrZ2szoJ3raxh9qdLz_V2c6k

Things that I noted while running these tests,

Traffic was obtained from the time I clicked continue to the time either an error was received or a successful connection to my server was made.

I have included the disconnection log below for your convenience.

My two cents You guys should really add time stamps and more useful logs on the client and the server so that server owners can assist players in figuring out why they are failing to connect. In this case why did the connection time out? A traceroute would be super useful here to see if it is actually a connectivity issue or if the issue is that the server is not replying back to connection requests.

Finally why is the client/server using UDP for connection requests rather than TCP which validates that the server/client received the data that was sent. Most games utilize TCP for initial connection attempts to validate that a client can actually contact the server and than proceed to use UDP for the actual game.

<size=150%>Connection Failed</size>

Failed to connect - connection timed out.

Log File:
Initialize engine version: 2018.2.15f1 (65e0713a5949)
GfxDevice: creating device client; threaded=1
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce GTX 970 (ID=0x13c2)
    Vendor:   
    VRAM:     4043 MB
    Driver:   25.21.14.1694
Begin MonoManager ReloadAssembly
- Completed reload, in  0.135 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 0.470160 ms
Client version: 0.7.8.5 beta
Wednesday, November 21, 2018 3:01 PM

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Invalid ip address

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Missing following icons: TollItem

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Missing following objects: APGenObject, ButtonObject, ElkSkypiercerObject, LogicGateObject, SwitchObject, TollObject

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Can not play a disabled audio source

(Filename:  Line: 447)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Disconnected from server.

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)
mirasrael commented 5 years ago

@arcreigh Thanks for you suggestions! I updated master server. Now it should work (tested my client with your server)

arcreigh commented 5 years ago

Things are looking good on my end! I will confirm again once I get home.

arcreigh commented 5 years ago

Confirmed users are connecting with no issues now closing issue #10080