public void ChallengeAccepted(ChallengeAcceptedMessage message){ Debug.Log ("CHALLENGE ACCEPTED!!! "); GSEnumerable<> accepted = message.Challenge.Accepted; GSEnumerable<var> accepted = message.Challenge.Accepted; GSEnumerable<PlayerDetails> accepted = message.Challenge.Accepted; GetData (message.Challenge.Challenger.Id, message.Challenge.ChallengeId, "accepted"); }
The documentation says,
Use GSEnumerable<var> for C#, but unity will not let me use <var> as a data type.
GSEnumerable<var> accepted = challenge.Accepted; string challengeId = challenge.ChallengeId; string challengeMessage = challenge.ChallengeMessage; string challengeName = challenge.ChallengeName; GSEnumerable<var> challenged = challenge.Challenged; var challenger = challenge.Challenger; long? currency1Wager = challenge.Currency1Wager; long? currency2Wager = challenge.Currency2Wager; long? currency3Wager = challenge.Currency3Wager; long? currency4Wager = challenge.Currency4Wager; long? currency5Wager = challenge.Currency5Wager; long? currency6Wager = challenge.Currency6Wager; GSEnumerable<var> declined = challenge.Declined; DateTime? endDate = challenge.EndDate; DateTime? expiryDate = challenge.ExpiryDate; long? maxTurns = challenge.MaxTurns; string nextPlayer = challenge.NextPlayer; GSEnumerable<GSData> scriptData = challenge.ScriptData; string shortCode = challenge.ShortCode; DateTime? startDate = challenge.StartDate; string state = challenge.State; GSEnumerable<var> turnCount = challenge.TurnCount;
Then,
Send the accepted GSEnumerable through a foreach loop and access the precious playerDetails.
GSData externalIds = playerDetail.ExternalIds; string id = playerDetail.Id; string name = playerDetail.Name;
Anyone know how to access these precious playerDetails in Unity3d using C#?
Yes! Thank you, thats the key. It would have taken forever to find this on my own.
How can I get the players data? I tried this and it doesnt work
foreach (var entry in players ) { string myText = "ID: " + entry.id; }
Ian Robinson
The documentation says,
Use GSEnumerable<var> for C#, but unity will not let me use <var> as a data type.
Then,
Send the accepted GSEnumerable through a foreach loop and access the precious playerDetails.
Anyone know how to access these precious playerDetails in Unity3d using C#?
You can access your playerDetails by using the following syntax:
GSEnumerable<ChallengeAcceptedMessage._Challenge._PlayerDetail> players = message.Challenge.Accepted;
to retrieve the list of accepted players, then iterating thorough the playerr's you can retrieve specific playerDetail data items.
Let us know how this works out for you.
Regards,
Vinnie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
You can access your playerDetails by using the following syntax:
GSEnumerable<ChallengeAcceptedMessage._Challenge._PlayerDetail> players = message.Challenge.Accepted;
to retrieve the list of accepted players, then iterating thorough the playerr's you can retrieve specific playerDetail data items.
Let us know how this works out for you.
Regards,
Vinnie
1 person likes this
Ian Robinson
Yes! Thank you, thats the key. It would have taken forever to find this on my own.
Emmanuel Actub
How can I get the players data? I tried this and it doesnt work
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics