question

Mubashar Bilal avatar image
Mubashar Bilal asked

MatchMaking Ticket Creation

Currently in my game a client can create ticket without any restriction but i want to implement a restriction that a user must have some virtual currency to create the ticket. also client cant be trusted to tell the currency he have. How can i implement this without trusting the client?

Thanks.

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

·
Citrus Yan avatar image
Citrus Yan answered

You can implement the process of ticket creation on the server side, and, the clients can only send the request to it asking for ticket creation.

On the server side:

  1. Checks the player’s virtual currency amount using the GetUserInventory API, if the amount is sufficient, continue, else return “VC amount not sufficient error” back to the clients.
  2. Subtract the player’s VC using the SubtractUserVirtualCurrency API (assuming you want to charge some VC for ticket creation).
  3. Create a ticket for the player as a server using the CreateServerMatchmakingTicket API, return the ticket id back to the clients.

On the client side:

  1. If received the ticket id, poll the ticket using the GetMatchmakingTicket API.
  2. Once matched, use the GetMatch API to get the match info and proceed accordingly.
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.

Mubashar Bilal avatar image Mubashar Bilal commented ·

In that case how can i disable ticket creation from client side, Is there any option in tha game manager and second can i create ticket from cloudscript?

Thanks

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Mubashar Bilal commented ·

Currently there is no option provided to disable it from the client side, and, you can create ticket from CloudScript by using the following statement to access the API:

multiplayer.CreateServerMatchmakingTicket( {<params>} );
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.