Search Unity

UNET unique client IDs

Discussion in 'UNet' started by aaron95j, Oct 25, 2015.

  1. aaron95j

    aaron95j

    Joined:
    Dec 9, 2013
    Posts:
    30
    Okay is it actually possible for a player to know which player it is without serialisation/messages or other complicated stuff. The connectionID for each client is different on each client (which defies the point of unique IDs??)

    spawning with Networkserver.spawnWithClientAuthority is broken:

    Code (CSharp):
    1. public override void OnServerConnect(NetworkConnection conn)
    2. {
    3.     NetworkServer.SpawnWithClientAuthority(newPlayer.gameObject,conn);
    4. }
    And suddenly no player has authority of course! hasAuthority is false server and client.

    Is it so hard to be able to see a UNIQUE AND SYNCED IDENTITY for each connection/client/whatever. Not relying on some registered player object either as they don't always exist at any moment.

    Can't even send an RPC to a specific player? has to be to all of them so how does any one player know which player they are??

    If I could please be given a simple answer that would be great iv'e just had enough.. :)

    Edit: So I need a isLocalPlayer check that will work on objects that arent the player. Like HasAuthority but it's not working..

    if I try to [syncvar] the acttual client that object belongs to instead of the connectionID I get UnetWeaver Errors and a buggy debug console
     
    Last edited: Oct 25, 2015
  2. aaron95j

    aaron95j

    Joined:
    Dec 9, 2013
    Posts:
    30
    this has to be a bug..
    Spawn something on server and on the server hasAuthority is still false
     
  3. aaron95j

    aaron95j

    Joined:
    Dec 9, 2013
    Posts:
    30