Search Unity

Multiplayer works on Standalone only, but fails after around 1 minute

Discussion in 'Multiplayer' started by WolfoOld, Jun 20, 2017.

  1. WolfoOld

    WolfoOld

    Joined:
    Jan 12, 2014
    Posts:
    22
    Hello, before I explain any further there's 3 facts you should know:
    1. Whenever I try Editor x Standalone(host), I get this error:
      Code (CSharp):
      1. Found no behaviour for incoming [ClientRpc:InvokeRpcRpcPosition] on Pedestal (UnityEngine.GameObject),  the server and client should have the same NetworkBehaviour instances [netId=9].
      for every networked entity without that RPC command (for some reason it tried to call a ClientRpc of another's NetworkBehaviour, failing). Everything works, but networked objects are spawned at completely wrong positions.
    2. Testing Standalone x Standalone with a friend, he also had objects position completely wrong while Players and Scene were loaded correctly (I could see him move and viceversa). Not sure if he was also getting those errors.
    3. Testing Standalone x Standalone with another friend, everything worked perfectly fine. No disconnecting, no errors, everything was in place. Ideal outcome.

    Now, what I'd like to focus on fixing firstly is Standalone x Standalone on my own machine. Everything works fine except client is disconnected after around 1 minute. Objects are placed correctly. (Doesn't always happen)
    These are the errors I get:
    Code (CSharp):
    1. Socket: bind failed, error: Only one usage of each socket address (protocol/network address/port) is normally permitted.
    2. Cannot open socket on ip {*} and port {7777}; check please your network, most probably port has been already occupied
    Code (CSharp):
    1. StartServer listen failed.
    Code (CSharp):
    1. host id out of bound id {0} max id should be greater 0 and less than {0}
    Last one spammed until game is closed.
    • I call NetworkServer.Reset() before calling NetworkManager's StartHost().
    • RunInBackground is activated in Editor's settings.
    • OnClientConnect is overwritten to let OnClientSceneChanged do the player adding only
    • NetworkServer.SpawnObjects() is called everytime a player connects (not sure if necessary)
    Please, help me out, these issues won't let me sleep at night.

    Full errors:
    Code (CSharp):
    1. Socket: bind failed, error: Only one usage of each socket address (protocol/network address/port) is normally permitted.
    2.  
    3. Cannot open socket on ip {*} and port {7777}; check please your network, most probably port has been already occupied
    4. UnityEngine.Networking.NetworkTransport:AddHostWrapperWithoutIp(HostTopologyInternal, Int32, Int32, Int32)
    5. UnityEngine.Networking.NetworkTransport:AddHost(HostTopology, Int32, String) (at C:\buildslave\unity\build\artifacts\generated\common\modules\UNET\UNETworkingBindings.gen.cs:638)
    6. UnityEngine.Networking.NetworkServerSimple:Listen(String, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkServerSimple.cs:99)
    7. UnityEngine.Networking.NetworkServer:InternalListen(String, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkServer.cs:203)
    8. UnityEngine.Networking.NetworkServer:Listen(Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkServer.cs:186)
    9. UnityEngine.Networking.NetworkManager:StartServer(MatchInfo, ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:346)
    10. UnityEngine.Networking.NetworkManager:StartServer(ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:280)
    11. UnityEngine.Networking.NetworkManager:StartHost(ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:517)
    12. NetworkMainMenu:PlaySolo() (at C:\Users\Wolfoso\Documents\Unity\roguelikekepler\Assets\Scripts\UI\NetworkMainMenu.cs:134)
    13. UnityEngine.Events.InvokableCall:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:154)
    14. UnityEngine.Events.InvokableCallList:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:637)
    15. UnityEngine.Events.UnityEventBase:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:773)
    16. UnityEngine.Events.UnityEvent:Invoke() (at C:\buildslave\unity\build\Runtime\Export\UnityEvent_0.cs:52)
    17. UnityEngine.UI.Button:Press() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:35)
    18. UnityEngine.UI.Button:OnSubmit(BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:49)
    19. UnityEngine.EventSystems.ExecuteEvents:Execute(ISubmitHandler, BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:127)
    20. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:261)
    21. UnityEngine.EventSystems.StandaloneInputModule:SendSubmitEventToSelectedObject() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:330)
    22. UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:181)
    23. UnityEngine.EventSystems.EventSystem:Update() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\EventSystem.cs:283)
    24.  
    25. [C:/buildslave/unity/build/Runtime/Networking/UNETHost.cpp line 569]
    26. (Filename: C:/buildslave/unity/build/artifacts/generated/common/modules/UNET/UNETworkingBindings.gen.cs Line: 638)
    27.  
    28. StartServer listen failed.
    29. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    30. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    31. UnityEngine.Logger:Log(LogType, Object)
    32. UnityEngine.Debug:LogError(Object)
    33. UnityEngine.Networking.NetworkManager:StartServer(MatchInfo, ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:348)
    34. UnityEngine.Networking.NetworkManager:StartServer(ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:280)
    35. UnityEngine.Networking.NetworkManager:StartHost(ConnectionConfig, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkManager.cs:517)
    36. NetworkMainMenu:PlaySolo() (at C:\Users\Wolfoso\Documents\Unity\roguelikekepler\Assets\Scripts\UI\NetworkMainMenu.cs:134)
    37. UnityEngine.Events.InvokableCall:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:154)
    38. UnityEngine.Events.InvokableCallList:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:637)
    39. UnityEngine.Events.UnityEventBase:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:773)
    40. UnityEngine.Events.UnityEvent:Invoke() (at C:\buildslave\unity\build\Runtime\Export\UnityEvent_0.cs:52)
    41. UnityEngine.UI.Button:Press() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:35)
    42. UnityEngine.UI.Button:OnSubmit(BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:49)
    43. UnityEngine.EventSystems.ExecuteEvents:Execute(ISubmitHandler, BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:127)
    44. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:261)
    45. UnityEngine.EventSystems.StandaloneInputModule:SendSubmitEventToSelectedObject() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:330)
    46. UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:181)
    47. UnityEngine.EventSystems.EventSystem:Update() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\EventSystem.cs:283)
    48. (Filename: C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkManager.cs Line: 348)
    49.  
    50. host id out of bound id {0} max id should be greater 0 and less than {0}
    51. UnityEngine.Networking.NetworkTransport:ReceiveFromHost(Int32, Int32&, Int32&, Byte[], Int32, Int32&, Byte&)
    52. UnityEngine.Networking.NetworkClient:Update() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkClient.cs:697)
    53. UnityEngine.Networking.NetworkClient:UpdateClients() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkClient.cs:947)
    54. UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkIdentity.cs:1091)
    55.  
    56. [C:/buildslave/unity/build/Runtime/Networking/UNETNetLibraryManager.cpp line 536]
    57. (Filename: C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkClient.cs Line: 697)
     
    Last edited: Jun 20, 2017