1. Use of SetUpGame() of WinzoManager.cs

public void SetUpGame(IDictionary gamedata) 
{ 
   Dictionary<string, object> configData = new Dictionary<string, object>();
   foreach (DictionaryEntry d in gamedata) 
   { 
       configData.Add((string)d.Key, d.Value); 
   } 
   //Here get the config as per your game 
   //COMMON KEYS you need to use SAME key for these values 

   #region COMMON Keys 
   //Photon room name/Id multiplayer games room name 
   //roomName/roomId/challengeId
   string roomName = configData[IntegrationEvents.ChallengeId].ToString();
   int time = int.Parse(configData[IntegrationEvents.Time].ToString()); 
   // Get local player info/data
   // We have two ways of fetching the playerInfo 
   // First way is to use a single key PlayerInfo to get the PlayerId,
   // Player Name and Player Profile Pic URL  

   var playerInfo = (Dictionary<int, Tuple<string,
                    string,string>>)configData[IntegrationEvents.PlayerInfo];
  
   Debug.Log($"Player Id: {playerInfo[0].Item1}, Name:
   {playerInfo[0].Item2}, Profile Pic URL: {playerInfo[0].Item3}");
 
   // Uncomment the lines below to use the second way of fetching the
   // Player Info using three separate keys  
/* string playerId = configData[IntegrationEvents.playerId].ToString();
   string playerName = configData[IntegrationEvents.playerName].ToString(); 
   string playerProfilePic =
   configData[IntegrationEvents.playerProfilePic].ToString(); */ 

   // get all opponents info/data 
   var allOpponentInfo = (Dictionary<int, Tuple<string,
                 string,string>>)configData[IntegrationEvents.AllOpponentsInfo];  
   // Item1 in tuple is opponentId 
   // Item2 in tuple is opponentName 
   // Item3 in tuple is opponentProfilePicUrl 
   
   //To get the particular opponent information 
   var opponent1Name = allOpponentInfo[0].Item1; 

   Debug.Log($"Count : {allOpponentInfo.Count}, Opponent 1:
   {allOpponentInfo[0]}, Opponent 2 : {allOpponentInfo[1]}"); 
   var turnOrder = configData["turnOrder"].ToString();
 
   #region GAME SPECIFIC KEYS  
   turnOrder = configData["turnOrder"].ToString(); 
   totalReconnect = int.Parse(configData["totalReconnect"].ToString()); 
   #endregion 
   #endregion 
   // If you need array in game config, do it like this:  
   JArray array = JArray.Parse(punGameConfig.turnOrder); 
   //You can typecast these values according to their data types 
   int firstValue = (int)array[0]; 
   int secondValue = (int)array[1];
   Debug.Log("First value: " + firstValue); 
   Debug.Log("Second value: " + secondValue); 
   // Now Stop Listening SetUpGame Event 
   WinzoEventManager.StopListening(IntegrationEvents.SetUpGame, SetUpGame); 
 } 

Last updated