valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 236 forks source link

[BUG] Server allows client to connect for 5-30 seconds, then client loses connection #745

Open klhrt opened 1 year ago

klhrt commented 1 year ago

Describe the bug

Connecting to the server allows the client to interact with the world for a very short amount of time, then the character gets a connection error icon in the top left. 30 seconds later the client is kicked.

To Reproduce

Steps for the devs to reproduce the behavior:

  1. Install valheim plus server and client for Linux as steps are described
  2. Connect to server with client running on the same PC (may not be necessary, I don't have another computer to test this)

Troubleshooting

I've tried restarting both the client and server, but since I haven't seen this issue brought up anywhere I don't know where to start with actual

Additional context

The world interaction does actually happen; I killed a group of wolves before the icon appeared and upon the next login their loot was on the ground and they were gone, and building quickly before the disconnect has the same result. The new rules set in the server config file are correctly communicated to the client, tested with building integrity and increased camera distance. So I can confidently say that the server and client are able to legitimately communicate during the connection and for a short time after, but this communication then fails. The exact same setup works perfectly when the server and client are launched in vanilla mode, it's only broken when the mod is used.

Log of the full player-server interaction period

12/11/2022 16:20:17: Got status changed msg k_ESteamNetworkingConnectionState_Connecting
12/11/2022 16:20:17: New connection
12/11/2022 16:20:17: Accepting connection k_EResultOK
12/11/2022 16:20:17: Connecting to Steamworks.SteamNetworkingIdentity
12/11/2022 16:20:17: Got status changed msg k_ESteamNetworkingConnectionState_Connected
12/11/2022 16:20:17: Connected
12/11/2022 16:20:17: Got connection SteamID 76561198054707534
12/11/2022 16:20:17: Got handshake from client 76561198054707534
12/11/2022 16:20:22: VERSION check their:0.212.7@0.9.9.11  mine:0.212.7@0.9.9.11
12/11/2022 16:20:22: Server: New peer connected,sending global keys
12/11/2022 16:20:24: VPlus configuration synced to peer #-471094908
12/11/2022 16:20:40: Got character ZDOID from Boots : -471094908:4
12/11/2022 16:21:19: ZRpc timeout detected
12/11/2022 16:21:19: Closing socket 76561198054707534
12/11/2022 16:21:19:   send queue size:0
12/11/2022 16:21:20: Got status changed msg k_ESteamNetworkingConnectionState_None
12/11/2022 16:21:20: Destroying abandoned non persistent zdo -471094908:10 owner -471094908
12/11/2022 16:21:20: Destroying abandoned non persistent zdo -471094908:11 owner -471094908
12/11/2022 16:21:20: Destroying abandoned non persistent zdo -471094908:4 owner -471094908
12/11/2022 16:21:20: Disposing socket
12/11/2022 16:21:20: Disposing socket
SSimp258 commented 1 year ago

I've seen this in the SteamCMD version because it connects to Steamworks. It could also be caused by a VPN connection from what others have said on the discord server. Only thing I can suggest is to try to connect to a non-SteamCMD version and see if you are disconnected. Then try the SteamCMD server again. If you don't get disconnected on the other server and you get disconnected on the SteamCMD server, then there's an issue with SteamCMD.

klhrt commented 1 year ago

As far as I'm aware I am not using SteamCMD, unless running ./start_server_bepinex.sh from command line automatically uses it. I don't even think SteamCMD is installed on the machine though.

SSimp258 commented 1 year ago

It's not SteamCMD that probably the issue. The issue is SteamWorks. If the part of the log you posted:

12/11/2022 16:20:17: Connecting to Steamworks.SteamNetworkingIdentity

I think the above line is the "real" problem. I think there's a problem with the network. Reason why I said SteamCMD is because my SteamCMD dedicated server disconnects me after like a minute. While my Valheim Dedicated Server Steam Tool doesn't. One uses the SteamWorks and the other doesn't. It looks like the Linux version also uses SteamWorks. I also guessed it also used SteamCMD because of the Steamworks so that's my fault. (I'm also not too familiar with Linux)