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

Send more consistent data in update-groups payload #61

Merged
merged 2 commits into from
Jan 28, 2023

Conversation

tadhgboyle
Copy link
Member

No description provided.

tadhgboyle added a commit to NamelessMC/Nameless that referenced this pull request Jan 26, 2023
@Derkades
Copy link
Member

Derkades commented Jan 26, 2023

Not sure about this, as far as I can see the API uses underscores for all fields? Only API methods use dashes

EDIT: I see, the serverInfo endpoint is the only endpoint that uses dashes! That's probably where you saw it. Maybe we should update the serverInfo endpoint instead? Just make the API send fields with underscores and with dashes for backwards compatibility.

@@ -97,11 +97,11 @@ public void sendMinecraftGroups(final int serverId, final Map<UUID, Set<String>>
groups.forEach((uuid, playerGroups) -> {
final JsonObject playerGroupsObject = new JsonObject();
playerGroupsObject.add("groups", gson.toJsonTree(playerGroups));
groupsJson.add(uuid.toString(), playerGroupsObject);
groupsJson.add(uuid.toString().replace('-', ''), playerGroupsObject);
Copy link
Member

Choose a reason for hiding this comment

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

There's a special function NamelessAPI.javaUuidToWebsiteUuid(), but I totally forgot about it :P

Copy link
Member

Choose a reason for hiding this comment

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

This doesn't compile because it uses an empty character literal

Copy link
Member Author

Choose a reason for hiding this comment

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

So used to single quotes 😢

@tadhgboyle
Copy link
Member Author

I see, the serverInfo endpoint is the only endpoint that uses dashes! That's probably where you saw it. Maybe we should update the serverInfo endpoint instead? Just make the API send fields with underscores and with dashes for backwards compatibility.

Sounds good!

tadhgboyle added a commit to NamelessMC/Nameless that referenced this pull request Jan 28, 2023
@Derkades
Copy link
Member

I was going to fix that myself, but now I don't have to, thanks!

@Derkades Derkades merged commit 2b15476 into NamelessMC:master Jan 28, 2023
Derkades pushed a commit to NamelessMC/Nameless that referenced this pull request Jan 28, 2023
* Rewrite Discord group sync

* fix param

* Create new endpoint for plugin to use

* wip

* wip (will work after NamelessMC/Nameless-Java-API#61)

* wip

* Undo hardcoded version

* Style

* Style

* Style

* Fix nickname sync

* UNDO UNDO UNDO
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