Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Unique Event IDs, and Reward/exp propogation#195

Merged
JustinPinero merged 4 commits intoget-agent-status-stubfrom
message-uuids
Apr 22, 2021
Merged

Unique Event IDs, and Reward/exp propogation#195
JustinPinero merged 4 commits intoget-agent-status-stubfrom
message-uuids

Conversation

@JackUrb
Copy link
Copy Markdown
Contributor

@JackUrb JackUrb commented Apr 21, 2021

Overview

Introduces an event_id property to all GraphEvents such that we can uniquely identify them. This is useful for attributing experience and rewards, and also for reporting and blocking messages. It also includes a POST endpoint for /game/api/grant_reward with arguments for target_event_id and target_node_id.

Implementation

Mostly tracking down event_ids and making sure they can go through all the way from the useWSDataSource hook all the way through to the World methods for parsing and constructing events.

Major change occurs in the RewardEvent, which can now specify a target_event_id to attribute the bonus reward to. From the LIGHT main game, I expect this to be the most likely way to grant rewards.

Testing

Did some things, ensured that unique event ids were being set and propagated, and checked to see that exp granted by the model also makes it through. @JustinPinero I added an inline note to base_soul.py on where you can make a local edit to see experience granted, even without models. This should let you grant yourself some experience, and then you can try the reward flows too once they're wired.

Screen Shot 2021-04-21 at 7 02 28 PM

@JackUrb JackUrb requested a review from JustinPinero April 21, 2021 23:02
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 21, 2021
@JustinPinero
Copy link
Copy Markdown
Contributor

JustinPinero commented Apr 22, 2021

This looks great, that grant_reward endpoint is much appreciated and will come in really handy.

const reducer = (state, msg) => {
// TODO replace the specific incomprehensible message somehow instead
if (
// TODO (Justin) Can we target the event ID to swap the text out now?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We certainly can. I'll take care of it today.

Copy link
Copy Markdown
Contributor

@JustinPinero JustinPinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and is going to make what we've discussed on the frontend easy set up and easy to test. I will reach out if I have any questions.

@JustinPinero JustinPinero merged commit e92df1f into get-agent-status-stub Apr 22, 2021
@JackUrb JackUrb deleted the message-uuids branch April 22, 2021 15:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants