Proprietary Player List

Hey there,

I have just recently made the switch over from Unity's built in networking solution to Photon, and I can already say that it has paid off immensely. The auto converter has been a great help in porting the code, however I have encountered one issue. Essentially I would like a list of all the players to show up and update accordingly when another player joins / leaves. Rather than use Photon's player list functionality, I would like to continue using my current / proprietary system as it essentially serves as the base of the game. This consists of a player class and a public list, which holds the info of each player in the current game. The list is updated each time a local / remote player joins / leaves the room. But I am having an issue keeping it updated properly across all of the clients.

Here is a screenshot of the lobby after I have joined it multiple times from multiple clients. The first two clients to join the game manage to keep their player list updated properly however every client launched after these seem to double the amount of players for each new client that joins. I hope that made sense, the screenshot is labelled in chronological order of when the clients were launched.

LHYH8EI.jpg


Here is a shortened version of the original code using Unity's built in networking solution:
http://pastebin.com/mKsYaVj8

Here is a shortened version of the new code using Photon's networking solution:
http://pastebin.com/HuKbuuYN

I believe that my problem may reside in either a incorrect rpc target mode, or a difference in the methods after porting the code. But I am a novice programmer and after fiddling with the code for a few days now, I hope I can get some help from someone else here. Any help would be greatly appreciated.

Cheers,
Breggs

Comments

  • Coll to read that the converter worked so well for you and that PUN is doing well for you.

    I highly recommend to base your own playerlist on the one of PUN.
    You don't gain much aside of trouble when you use RPCs to re-implement a lot of what's provided to you.

    You can use player properties to store any player-related values in addition to the name (which is handled for you).
    Whenever our player list updates, you just clear yours and loop through ours to re-create yours.
    Something like this.

    If you have issues with PUN's player list, I can try to help some more.
Sign In or Register to comment.