question

mohammad naji avatar image
mohammad naji asked

simulating a Virtual Currency wallet for a group,simulating a Virtual Currency wallet for a Group

Hey guys

what im trying to do is to create a system that act as a wallet for a team.
players play a pvp match for a predefined wager and after each match if the user win the prize i want to send a percentage of it to its team and distribute them on a certain day to members of that group , like a pool system that all members contribute to it.

any ideas on how i can accomplish this?

i thought about using group objects and refresh the data after each match , but im not sure if that's a reliable solution

also i thought about adding a dummy player for each group and leverage that player's virtual currency to act as the group wallet , but i dont know if its possible to create a new user dynamically at runtime

,

Hey guys
what im trying to do is to create a system that act as a wallet for a team.
players play a pvp match for a predefined wager and after each match if the user win the prize i want to send a percentage of it to its team and distribute them on a certain day to members of that group , like a pool system that all members contribute to it.

any ideas on how i can accomplish this?

i thought about using group objects and refresh the data after each match , but im not sure if that's a reliable solution

Player Dataapisdata
1 comment
10 |1200

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

mohammad naji avatar image mohammad naji commented ·

sorry for the duplicated title and detail , seems like a bug

0 Likes 0 ·
kylemc@microsoft.com avatar image
kylemc@microsoft.com answered
You may be also to use Economy v2 to accomplish this.

  1. Create a Group Entity
  2. Transfer "wagers" to the Group Entity inventory using `TransferInventoryItems`
    1. You can only manage Group Entity inventories using the Title token
    2. You will need to make the call from Cloud Script or a service
    3. You should set the `GivingEntity` to the player
    4. You should set the "ReceivingEntity" to the group
  3. Transfer "winnings" from Group Entity inventories back to the players using the same approach
  4. Note: There is per-entity throttling on the inventory APIs so use a unique group/inventory/collection for each pool
  5. Note: Deleting the group won't delete the inventory, you will need to call `DeleteInventoryCollection` if you want to clean up
10 |1200

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

Xiao Zha avatar image
Xiao Zha answered

Based on your description, it seems that you want a global variable in the team for players to modify, which requires the variable to support concurrent modification. Since Group Objects do not support concurrent modification, and the second method you mentioned also has problem with concurrent operations, you may need an external database to meet your requirement.

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.