So I just used a cloudscript call to server.GrantItemsToUser()
This returns an array of GrantedItemInstance.
If I return this to the client, can I deserialize this into an list of ItemInstance ? It's super awkward that it's specifically GrantedItemInstance -- I'm going to guess it's different and it'll crash if I try to deserialize, but wanted to post and make sure!
For example:
// CS
[...] var grantItemsToUserRes = server.GrantItemsToUser(req);
return grantItemsToUserRes; ______________________________________________ // C#
[...] (result) {
List<ItemInstance> infoResult = PlayFab.Json.JsonWrapper.
DeserializeObject<List<ItemInstance>>
(result.FunctionResult.ToString());
Will this work?
What's recommended in this scenario? I'm granting a starter pack if the items aren't found in their inventory. I'll do cloudscript to grant 2-3 starter items and return the items granted to update the local session.
As an alt., I suppose I could just return a bool if it worked or not since I know the items being granted, but it'd be nice to recycle the function for other uses, if it could return the granted items.
As a 2nd alt., I could probably just get the inventory after and return the entire inventory, although it's less efficient. I could just replace the entire inventory for the local session.