question

jodonnell avatar image
jodonnell asked

Parse several events automatically

I have a series of events being fired that I need to parse for information.

An event is fired called "OpponentFound" to signify the start of a match.

And MatchFinished when it has ended.

If the variable opponentLeft is true in the MatchFinished event,

I need to parse all events in between MatchFinished and OpponentFound, looking for an event called "OpponentLeft".

If this event is not found, push the timestamp to an InternalData array.

Is this possible with PlayFab (using cloudscript)? I know I can do it locally, but trying to reduce potential cheating by doing it server side. I know I can also do it manually but automation is key.

Player DataCloudScript
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

·
Andy avatar image
Andy answered

The short answer is no, we don't support reading past events through cloudscript. I'd like to dig a bit deeper into what you're trying to do, though, as it may be possible to accomplish your end goal in a different manner (storing state in internal data as the events come in, maybe).

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

jodonnell avatar image jodonnell commented ·

Thank you for the response.

Would it make sense to then create a rule to respond to each event?

Store a state that changes in OpponentFound and OpponentLeft

And a final rule that checks the state in MatchFinished?

0 Likes 0 ·
Andy avatar image Andy ♦♦ jodonnell commented ·

That's along the lines of what I was thinking. You could author cloudscript that responds to each event and sets/reads state as appropriate.

0 Likes 0 ·
jodonnell avatar image jodonnell Andy ♦♦ commented ·

Perfect. Thank you for the help

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.