Forum Multiplayer How to view player joindata from server ? [Solved]

Discussion and help relating to the PlayerIO Multiplayer API.

How to view player joindata from server ? [Solved]

Postby nirza » July 30th, 2010, 8:06 am

I tried player.JoinData which gives System.Collections.Generic.Dictionary`2[System.String,System.String]
and player.JoinData.Values which gives System.Collections.Generic.Dictionary`2+ValueCollection[System.String,System.String]

How do I see the data ?
Last edited by nirza on July 30th, 2010, 10:44 am, edited 1 time in total.
nirza
 
Posts: 39
Joined: April 10th, 2010, 11:50 am

Re: How to view player joindata from server ?

Postby TomatoGG » July 30th, 2010, 8:58 am

JoinData is a .NET Dictionary that contains a collection of Keys and Values. If you know the exact key, you can use the indexer operator [] to access the value. If you wish to dump the entire contents of the Dictionary, you can go through the Keys collections to access the keys and use the keys to retrieve the value as shown in the following code. Both the key and value are strings. Hope this may be of help to you. :D

Code: Select all
foreach (string key in player.JoinData.Keys) {
   string value = JoinData[key];
   Console.WriteLine(key + "=" + value);
}
TomatoGG
 
Posts: 17
Joined: July 3rd, 2010, 11:15 am

Re: How to view player joindata from server ?

Postby nirza » July 30th, 2010, 10:44 am

yes, thanks !
nirza
 
Posts: 39
Joined: April 10th, 2010, 11:50 am


Return to Multiplayer



cron