Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the ActivityTypes to match the documentation #12

Merged
merged 2 commits into from
Dec 16, 2020
Merged

Updated the ActivityTypes to match the documentation #12

merged 2 commits into from
Dec 16, 2020

Conversation

Gamer153
Copy link
Contributor

Added the COMPETING type, removed the WATCHING type and changed the order to match the documentation.

Added the COMPETING type, removed the WATCHING type and changed the order to match the documentation.
@JnCrMx
Copy link
Owner

JnCrMx commented Dec 15, 2020

Hmmm... It seems like the SDK is not up-to-date with the documentation.

The latest discord_game_sdk.h still defines the ActivityTypes as

enum EDiscordActivityType {
    DiscordActivityType_Playing,
    DiscordActivityType_Streaming,
    DiscordActivityType_Listening,
    DiscordActivityType_Watching,
};

This seems to be an issue on Discord's side and you might wish to report it in https://github.com/discord/gamesdk-and-dispatch or https://github.com/discord/discord-api-docs. I sadly don't have time for that now.

Also, the new enum values now skip 3 (possibly in order to not break old versions):

Playing | 0
Streaming | 1
Listening | 2
Custom | 4
Competing | 5

(https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum)

In order to reflect this in Java we need to add one "spacer" element to the enum (at the place where WATCHING was) or we get wrong values (e.g. COMPETING instead of CUSTOM).
We might name this spacer either UNKNOWN/REMOVED/DEPRECATED/etc. or just keep WATCHING and add an @Deprecated annotation (maybe together with one sentence of documentation) to it.

To be honest I'm not really sure about this COMPETING because I've never seen it "in the wild" before. But adding it probably won't hurt.

If you add this spacer value to the enum, I'll gladly merge this. Thank you for contributing :D

@Gamer153
Copy link
Contributor Author

I added the spacer value (I just called it UNUSED), and I'm going to report it to the discord repos.
I hope the changes are ok now.

@JnCrMx
Copy link
Owner

JnCrMx commented Dec 16, 2020

Yes, it looks fine now and my test runs without problems.

I will include some other new features in the next few days (there now seems to be an instance property in DiscordActivity) and then make a new release (unless you need those changes immediately, then I will do the release right now, no problem).

Thank you again for contributing :D

@JnCrMx JnCrMx merged commit 8cafb76 into JnCrMx:master Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants