Hello all,
I am attempting to create / update an item stack with custom DisplayProperties in the Economy V2 C# SDK but everything I seem to try results in the same error from PlayFab:
System.Reflection.TargetParameterCountException: 'Parameter count mismatch.'
I am using the following code to Add a new stack with custom DisplayProperties:
await PlayFabEconomyAPI.ExecuteInventoryOperationsAsync(new ExecuteInventoryOperationsRequest
{
AuthenticationContext = AuthenticationContext,
CollectionId = item.CollectionId,
Entity = new EntityKey
{
Type = "title_player_account",
Id = AuthenticationContext?.EntityId,
},
Operations = new List<InventoryOperation>
{
new InventoryOperation
{
Add = new AddInventoryItemsOperation
{
Amount = item.Count.Amount,
Item = new InventoryItemReference
{
Id = item.Id,
StackId = item.StackId,
},
NewStackValues = new InitialValues
{
DisplayProperties = item.DisplayProperties,
},
},
}
},
});
The Id and StackId are the same string (a guid as a string), the CollectionId is a valid string, Amount is a positive integer, the call even works if I simply do not attempt to pass a NewStackValues property...
I have tried everything I can think of for the DisplayProperties... I've tried a class like I assumed would be possible initially since the underlying type is just 'object,' I've tried a modified class with serialized strings instead of any of the 'real' data types (thinking I could deserialize on my own), I've tried a serialized version of both of those classes, a Dictionary<string, object?>?
, an anonymous object with both the true data types and serialized string representations...
Ultimately the data I want to save is the following:
{
"startTimeUtc": "2023-05-09T01:18:56.113Z",
"timeSpan": {
"timeToCompleteDays": 0,
"timeToCompleteHours": 0,
"timeToCompleteMinutes": 15,
"timeToCompleteSeconds": 0
},
"endTimeUtc": "2023-05-09T01:33:56.113Z"
}
Full stack trace on PasteBin
I am just out of ideas and I think I need help. Any insight or ideas on the matter would be appreciated.
Thank you.