server.GrantCharacterToUser CharacterType constraint

Hi, I'm confused because server.GrantCharacterToUser API parameter constraint. This api treat CharacterType to ItemId but constraint 1-20 character and a-Z character. So, if you make itemId like this com.[sudio].[title].[product], API error occurred.

Of course, client API is no problem. I was succeed that purchased tokenize character item and call client.GrantCharacterToUser api. In this case, CharacterType can be over 20 character and include '.' character.

1 Reply

Hm. Yes, I'll file a bug to have that looked into. The regex for the CharacterType (which you are correct - on the Server API method specifically, this maps to the Item ID) is "^[a-zA-Z0-9-_ ]*$", so periods are no allowed at the moment.

What is the specific ItemId you're trying to use? Again, periods are not allowed as part of the string, so the example above ("com.[studio].[title].[product]") is incorrect. If you're using receipt validation, the ItemId would only be the Product ID from the payment provider.

The second part of the mentioned constraint, that the type needs to be 1-20 characters is causing us some trouble currently. If you generate a character by handing in an item (ClientAPI) the item id is used to generate the CharacterType. This allows for CharacterTypes of 20+ characters. On the other hand, the same type would be blocked when calling the ServerAPI from CloudCode. Any plans to change this behaviour? Or is this intended?

Your answer

Hint: You can notify a user about this post by typing @username

Attachments:
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.