How to get client's IP?

Makhoktin
edited June 2010 in Photon Server
Hello,

Tell me please, how does server learn client's IP address?
I'm in the middle of the MMO RC3 sample, so in operation handlers there is access to an instance of MmoPeerState, which inherits from Photon.SocketServer.ModuleCore.PeerState and somehow holds the object of type IPeer, but none of them provide a method to learn client's IP.

There is such a method in IPhotonPeer, but how do I get to that interface from PeerState?

Comments

  • Hi,
    The MMO Demo for RC4 is now available for download: http://exitgames.com/Download/Photon
    The peer there has a property PhotonPeer, and that again has a property NativePeer, which is the IPhotonPeer you are looking for.
    peer.PhotonPeer.NativePeer.GetRemoteIP()
    
    Note that the documentation for the new Mmo Demo is not yet finished, completing it today.
    Since the concept stayed the same it should be easy to understand for those who are familiar with the RC3 Mmo Sample.