question

aronze avatar image
aronze asked

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.

Anybody help this?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

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.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

aronze avatar image aronze commented ·

This is not fixed yet. So, bundle type tokened character could not be granted by server. Did you guys have any plan? Or not?

0 Likes 0 ·
brendan avatar image brendan aronze commented ·

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.

0 Likes 0 ·
aronze avatar image aronze brendan commented ·

Oops, sorry it was my mistake! Thanks.

0 Likes 0 ·
Timo Neumann avatar image Timo Neumann commented ·

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?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.