Get Player Ping and Names in room..

coldevcoldev
edited November 2017 in Native
1. How Get Player Ping in current room.. ?
2. How get current players in room and get names by id ?
3. Search any regions to same time.. (some games haves america, europa, asia in search region)
ex: mLoadBalancingClient.selectRegion(availableRegions[0] , availableRegions[1], availableRegions[3] );;

selectRegion("us, usw, sa");

by example then get games in all america with
getRoomList ()



Thanks...

Comments

  • Hi @coldev.

    1.
    Client::getRoundTripTime()



    2.
    Client::getCurrentlyJoinedRoom()
    Returns a reference of type MutableRoom to the currently joined room.

    On that MutableRoom instance you can call
    MutableRoom::getPlayers()
    to access a JVector that holds a pointer to an instance of class Player for every player that is currently inside that room.

    Alternatively
    MutableRoom::getPlayerForNumber()
    will give you a pointer to the Player instance of the player with the specified player number (if there is a player with that number existing in that room).

    You can access the name of a player by calling
    Player::getName().



    3.
    One Client instance can only be connected to one region at the same time.
    You could connect to a region, retrieve the list of games, disconnect, then reconnect to the next region and so on, but obviously this is a very time-consuming process.

    A considerably faster approach would be to create multiple instances of class Client, one per region, at let each of them connect to a different region. This way you could retrieve the list of available rooms for multiple or even all regions at the same time, but please be aware that each connected Client instance counts separately against the CCU, so if a single instance of an app on just one device connects to 12 regions at once, that one instance would use 12 CCU. So keeping all those Client instances connected for a longer time results in an enormously increased CCU usage and therefor high financial costs when using Photon Cloud, where the pricing is CCU-based (with Photon server and unlimited CCU licenses however this approach would make more sense).

    An alternative would be to run your own server and to run 1 Client instance for every region on that server machine and have it connect to all regions as a Photon Client, just sitting there in the lobbies, retrieving the latest stats, but not joining any rooms. Your actual end user Photon Clients could then connect to your server (not necessarily through Photon, if you don’t want to run a self-hosted Photon server instance, a simple HTTP server would do just fine for this purpose) and retrieve the stats for all regions from there.
  • Hmm excelent answer .. thanks..

    God Bless You
Sign In or Register to comment.