ChrisNZL / Tallowmere2

Changelog, issue tracker, and development knowledge for Tallowmere 2.
https://tallowmere2.com
13 stars 0 forks source link

T2.UdpNetWrapper: SocketException: System.Net.Sockets.Socket.Bind #1055

Closed ChrisNZL closed 1 year ago

ChrisNZL commented 2 years ago

Auto reports. 0.3.5f. Steam pirate copies.

Issue with connecting to a server with TCP, so game tries the UDP fallback wrapper, but fails, throwing an error.

EXCEPTION » SocketException: Обычно разрешается только одно использование адреса сокета (протокол/сетевой адрес/порт).

Usually only one use of a socket address (protocol/network address/port) is allowed.

TODO:

Feedback IDs:

8:50:26, Frame 61778, EXCEPTION »  SocketException: Обычно разрешается только одно использование адреса сокета (протокол/сетевой адрес/порт).

>>>>> CRITICAL ERROR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP)
T2.UdpNetWrapper+ClientData..ctor (System.Net.Sockets.Socket tcpSocket, System.Net.IPEndPoint udpBindPoint, System.Int32 targetPort, System.Net.IPEndPoint serverEndPoint)
T2.UdpNetWrapper..ctor (System.Int32 listenPort, System.Net.IPEndPoint serverEndPoint)
T2.Option_TcpPort.EnableWrapper (System.Int32 localUdpPort, System.String serverIpAddress_string, System.Int32 serverTcpPort)
T2.NetworkClient.BEGIN_CONNECTING_TO_SERVER ()
T2.NetworkClient.OnConnectionFailed ()
T2.NetworkClient.OnDisconnected ()
T2.NetworkClient.OnPeerDisconnected (LiteNetLib.NetPeer peer, LiteNetLib.DisconnectInfo disconnectInfo)
LiteNetLib.NetManager.ProcessEvent (LiteNetLib.NetEvent evt)
LiteNetLib.NetManager.PollEvents ()
T2.NetworkClient.Update ()

GameStates: ShowingTitleScreen, UsingMainMenu, InitialisingAsNetworkHost, ViewingAlertBox
AlertBox.currentAlert:
- alert.id: ConnectingToServer
- alert.title: Многопользовательская игра
- alert.description: Соединение с сервером Netplace-Moscow-01...
OnlineGameInfo: Device is offline.
Previous server: Netplace-Moscow-01
Previous GameID: XRX2H
CanvasMenu.CurrentCategory: OnlineCoop_Host
SystemPlayer InputDevice: Клавиатура
ChrisNZL commented 1 year ago

Additional Feedback ID from 0.3.5f, but from a legit Steam customer:

Player was playing fine for a while, then had a network timeout, then tried to connect again but errors occurred.

TODO:

12:52:03, Frame 404890, LOG »  NetworkMessage_DungeonRoomTransitionHelper: Received message.
Desire: 6 » RevealRoom

12:52:03, Frame 404891, LOG »  DungeonRoomTransitioner.Update: Revealing room: Room 161: Fire Grotto (Room 161)
12:52:13, Frame 406054, WARNING »  NETWORK CLIENT: RelayClient disconnected: Timeout
12:52:13, Frame 406054, LOG »  Device.OnBecameOffline: Device is now offline.
12:52:15, Frame 406304, LOG »  Returning to title screen...

12:52:23, Frame 407260, LOG »  RELAY CLIENT: Connecting to server.
Intention: ConnectingAsHost

12:52:24, Frame 407350, LOG »  NetworkClient.BEGIN_CONNECTING_TO_SERVER: Using UDP. Connecting to 45.32.149.100:5889 ...
12:52:30, Frame 408041, WARNING »  NETWORK CLIENT: RelayClient disconnected: ConnectionFailed
12:52:30, Frame 408041, LOG »  RelayClient._OnDisconnectedFromServer: Failed to connect via UDP.
12:52:30, Frame 408041, LOG »  NetworkClient.OnConnectionFailed: Connection failed while connecting.
12:52:30, Frame 408041, LOG »  NetworkClient.OnConnectionFailed: Failed to connect via UDP. Trying via TCP...
12:52:30, Frame 408041, LOG »  NetworkClient: device.socketMode is TCP. Binding local UDP port 5889 to server TCP port 5890. Server address: 45.32.149.100 ...
12:52:30, Frame 408041, LOG »  NetworkClient.BEGIN_CONNECTING_TO_SERVER: Using TCP via local loopback (localUdpPort: 5889). Connecting to 127.0.0.1:5889 ...
[[[ ^ REPEATING MESSAGE... ]]]

[[[ ^ REPEATING MESSAGE... ]]]

[[[ ^ REPEATING MESSAGE... ]]]

12:52:59, Frame 411610, LOG »  RELAY CLIENT: Connecting to server.
Intention: ConnectingAsClient

[[[ ^ REPEATING MESSAGE... ]]]

[[[ ^ REPEATING MESSAGE... ]]]

[[[ ^ REPEATING MESSAGE... ]]]

[[[ ^ REPEATING MESSAGE... ]]]

12:53:06, Frame 412390, EXCEPTION »  SocketException: Une seule utilisation de chaque adresse de socket (protocole/adresse réseau/port) est habituellement autorisée.

>>>>> CRITICAL ERROR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP)
T2.UdpNetWrapper+ClientData..ctor (System.Net.Sockets.Socket tcpSocket, System.Net.IPEndPoint udpBindPoint, System.Int32 targetPort, System.Net.IPEndPoint serverEndPoint)
T2.UdpNetWrapper..ctor (System.Int32 listenPort, System.Net.IPEndPoint serverEndPoint)
T2.Option_TcpPort.EnableWrapper (System.Int32 localUdpPort, System.String serverIpAddress_string, System.Int32 serverTcpPort)
T2.NetworkClient.BEGIN_CONNECTING_TO_SERVER ()
T2.NetworkClient.OnConnectionFailed ()
T2.NetworkClient.OnDisconnected ()
T2.NetworkClient.OnPeerDisconnected (LiteNetLib.NetPeer peer, LiteNetLib.DisconnectInfo disconnectInfo)
LiteNetLib.NetManager.ProcessEvent (LiteNetLib.NetEvent evt)
LiteNetLib.NetManager.PollEvents ()
T2.NetworkClient.Update ()

GameStates: ShowingTitleScreen, UsingMainMenu, ViewingAlertBox
AlertBox.currentAlert:
- alert.id: ConnectingToServer
- alert.title: Joining Game
- alert.description: Connecting to game My First Dungeon...
OnlineGameInfo: Device is offline.
Previous server: Vultr-Paris-01
Previous GameID: 3TQLJ
CanvasMenu.CurrentCategory: OnlineCoop_Join
SystemPlayer InputDevice: Keyboard
ChrisNZL commented 1 year ago

Handled better in 0.3.6a.

Game now shows an alert if the fallback TCP connection fails due to an error.