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

Ip Adress not being shared to other players

Discussion in 'Multiplayer' started by Gaba, Jun 14, 2010.

  1. Gaba

    Gaba

    Joined:
    May 29, 2009
    Posts:
    41
    hi guys! how´s it been?

    I´m trying to develop a few networking solutions to unity, and i recently got into a bit of a corner here. What i'm trying to do is share all players ipAdresses, so everyone knows who´s who, but just take a look at what happens


    Code (csharp):
    1.  
    2. //server calls this RPC
    3.  
    4. networkView.RPC("getIP", player.networkPlayer, otherPlayer.networkPlayer, otherPlayer.networkPlayer.ipAdress)
    5.  
    6. //client gets this
    7. @RPC
    8. function getIP(pNetPlayer:NetworkPlayer, pIP:String)
    9. {
    10.     //prints ip
    11.     print(pIP);
    12.     //prints 0
    13.     print(pNetPlayer.ipAdress);
    14. }
    15.  
    now, as you can see i'm doing the exact same thing, but a client doesn´t have the other client´s ip, is this a known issue or i am doing something wrong here?

    also, if this is intentional, i'm thinking that RPC messages sent directly to another client, the message will go trough the server, using it´s bandwidth.

    anyone cares to shed a light on this?