Author Topic: Disconnecting from host while level loads  (Read 2822 times)

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Disconnecting from host while level loads
« on: July 22, 2013, 10:26:02 AM »
Hi,

I have a level that is built procedurally, if I choose to build a large world that takes about 5 seconds to build (especially in the Game Window inside Unity), I get disconnected. Is there was way to keep the connection alive?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disconnecting from host while level loads
« Reply #1 on: July 22, 2013, 01:08:28 PM »
It takes 10 seconds of inactivity for the connection to be considered "dead", so I am guessing it's more than 5 seconds? In either case you can change that. Line 320 in TNGameServer.

matt.va

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 5
    • View Profile
Re: Disconnecting from host while level loads
« Reply #2 on: July 22, 2013, 09:48:37 PM »
Hi,

I have a level that is built procedurally, if I choose to build a large world that takes about 5 seconds to build (especially in the Game Window inside Unity), I get disconnected. Is there was way to keep the connection alive?

Thanks.

hehe, i'm not the only one looking for the solution.
There are situation where it requires a longer timeout,e.g pause or loading scenes. And short timeout during gameplay.
Would be nice if there is an option to parameterize it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disconnecting from host while level loads
« Reply #3 on: July 23, 2013, 04:29:14 AM »
Agreed, I will add a function for it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disconnecting from host while level loads
« Reply #4 on: July 23, 2013, 04:48:45 AM »
I've added it to the Pro version, so you will see it in the next public release: TNManager.SetTimeout(int seconds). Set it to something large like 120 (for 2 minutes) before loading a level, then back to 10 after you finish loading it.

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Disconnecting from host while level loads
« Reply #5 on: July 23, 2013, 07:14:59 AM »
Brilliant! Thanks ArenMook!