question

Dmitry Statsenko avatar image
Dmitry Statsenko asked

Aggregate and confirmation of PlayStream events

I'm developing a multiplayer game using Photon for matchmaking and PlayFab for user management.

I want to prevent cheaters from gaining XP, virtual currencies, and items by forgery requests from the client side.

In my game, there are several ways

- XP granted for some game events

- virtual currency granted from real money and some game actions

- items granted by virtual currencies and some game actions

There is no question about purchases by VC and RM but about granting for game events.

If I understand correctly, I should use PlayStream and Rules, to grant players for XP, VC, and items.

1. How can I validate an event? Can the cheater forge and send the events?

2. Can I validate inside of cloud script which triggered by an event that there were some other required events previously? Or even get the time from the previous required event to "throttle" too often events?

3. Can I use events from other players to "confirm" the original event? For example, the event is "confirmed", if most of the players "inside the room" sent the same event.

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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> How can I validate an event? Can the cheater forge and send the events?

There are two types of Play Stream events, they are custom events and built-in events. Players can send the custom events using the APIs WriteEvents, WriteCharacterEvent, WritePlayerEvent, WriteTitleEvent. It’s by design. But they are unable to forgery the events automatically generated by the system, for example, the player_logged_in only will be generated when players log in, it can’t be forged. For your case, you can prioritize the built-in events to trigger your actions to prevent players from cheating through send custom events.

>> Can I validate inside of cloud script which triggered by an event that there were some other required events previously? Or even get the time from the previous required event to "throttle" too often events?

Yes, you can use the code var playStream = context.playStreamEvent; to get the data from events in the CloudScript functions. By reading the context parameter, you can obtain the time stamps of events and save them to the player's internal player data for subsequent validation. Please follow this sample - https://docs.microsoft.com/en-us/gaming/playfab/features/data/playerdata/how-to-set-internal-player-data to set the internal player data on CloudScript.

>> Can I use events from other players to "confirm" the original event? For example, the event is "confirmed", if most of the players "inside the room" sent the same event.

We don’t support querying the title history events using CloudScript functions. As the second answer said, we suggest you store the data you need in players’ internal player data, then use the API GetUserInternalData to get these data for validation.

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.