question

Jeremy Rose avatar image
Jeremy Rose asked

Unique Characters only

Is there any way to limit the creation of character of a type to a single instance?

Or a check before its created?

I do not see any way built in. So not I am attempting to use the entity_created stream event. To delete a duplicate.

A duplicate character token could be added from a bundle or other reward.

Is there an event that I could look at before the creation happens?

limitsCharacters
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

·
Gosen Gao avatar image
Gosen Gao answered

You can use API GetAllUsersCharacters before create characters to check if there is an existing character on a specific type.

2 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.

Jeremy Rose avatar image Jeremy Rose commented ·

The issue is that a character token item would be in the players inventory.

I can check on the client I supposed before making the GrantCharacterToUser and make a ConsumeItem request instead.

I worry about ways the client could exploit things like this since these are all client side calls.

Or if the character ends up duplicated somehow either by exploit i still have to have code to deal with it.

Would be really nice to have something on the items for character token have a unique token that would not create it if a character with the same id already exists.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Jeremy Rose commented ·

If you set the item consumable, then it will be automatically consumed after the character is created.

If you are concerned that client requests are not secure, then you can use API policy to restrict Client API GrantCharacterToUser requests and use Azure Functions to call Server API GrantCharacterToUser. In that Azure Function, you can check if there is an existing character on a specific type before granting the character, which ensures that multiple characters are not created.

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.