Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NetworkPlayer.ToString() shows index continually rising?

Discussion in 'Multiplayer' started by Ghidera, Apr 27, 2014.

  1. Ghidera

    Ghidera

    Joined:
    Mar 6, 2013
    Posts:
    53
    I was playing around connecting and disconnecting from my server and I noticed that the NetworkPlayer index never re-uses a number, it just keeps climbing. Is this correct or am I missing something obvious?

    If it never re-uses numbers then any multi-user app will have to be restarted periodically because it'll run out of numbers to use. Of course it'll probably take a while to reach the 2,000 million+ connection limit...
     
  2. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I'm sorry but are you worried that 1/3 of the people on the planet will connect to your app and you will have to restart it?
     
  3. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    456
    Someone tried to talk me into using BigInt for my unique identifying values on the server lol. Basically what Fholm said. I calculated it was something like 10,000 connections a second for a week and it was still not even possible to hit int.maxValue.