Unity Photon Handle Match Data

Options
Hello,
I'm building a multiplayer game that has instanced battles (find match matchmaking). I have the matchmaking finished and it throws the 6 (3v3) players into an empty room using
PhotonNetwork.LoadLevel('Game');
This shows 6 empty rooms.

What I need: I need help spawning the players while also keeping the game data for each particular match organized in some way (file, scriptable object, etc). This is useful for the matches themselves as well as stuff like match history later on.



I would appreciate any help. Thanks

Comments

  • Malace
    Options
    This is a pretty hefty task for pun2 if im not mistaken. Pun2 does not exist as a static server. So saving data locally would just result in each player creating a local file itself. Pun2 just provides a relay service to your game. As such it only stores information related to passing connection data between clients. Each match will still have its own player host. At which point pun2 has done its job and deals with other players. Your lobby is just a list of those active games and the code to connect your client to that host. So you cant save anything or run any code from the relay.

    So the only solution for this would be to create a web service. A seperate web page hosted with any language and database you perfer. Php and mysql is what ive used in the past. take data through get and post messages. Return data in xml or json. Then you can send and recieve data from those scripts with unity http methods. This is the only method to share static data to all future clients. At least for now.

    Simply put, without a dedicated server to handle all clients from a static machine. There isnt an easy way to share game data for all users.