question

brendan avatar image
brendan asked

Character creation - Server/Client differences

Question from a developer:

I'm having some trouble sorting out the details of using the character system. The character APIs started to make sense when I looked at the client version of GrantCharacterToUser. You basically grant a catalog item to a player and then they can start using that character in the game. However, the server version of the same method is different, and I don't understand how it's used. What's the difference?

10 |1200

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

brendan avatar image
brendan answered

Indeed, they are different, and so really should have been named differently, to keep things clear. I'll give that feedback to the team, so that we're more careful about naming.

Basically, you'll notice that the key difference is that with the Client version of the grant call, you're specifying the ItemId from the catalog. The way this works is similar to UnlockContainer, for a Container that has a Key defined - we check if the player has the correct item, and only grant the character if he has it (consuming that item in the process). The Server version is a server-authoritative call, so you're not worried about potential cheating in that context - hence, no ItemId needed. You just grant the character to the player.

10 |1200

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

Rich Joslin avatar image
Rich Joslin answered

Thanks Brendan.

So when a character is granted via the client API, is it then disconnected from the catalog?

(maybe this is just another question entirely - it seems like all items, once granted, are disconnected from the catalog)

10 |1200

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

brendan avatar image
brendan answered

It works the same way containers and keys do - when used, it decrements the remaining uses by one. If that drops it to zero, the item is removed from player inventory. So you do need to define a UsageCount for the items that become characters in your catalog, if you want it to work that way.

10 |1200

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

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.