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

ranking: Expand Ranking Legacy documentation #24

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

DaniElectra
Copy link
Member

@DaniElectra DaniElectra commented Apr 6, 2024

Marking as draft as we try to get more information before NN shutdown

In the meanwhile, we can review how information about the protocols and methods is presented and if any specific detail may be missing

We also want to look for better names for UnknownMethod0xE and UnknownMethod0xF. These methods are used to get the rank list (either global and friends with method 14, or global around own entry with method 15)

@DaniElectra
Copy link
Member Author

Unfortunately I wasn't able to grab any more information, so we will have to work with this. I think the current docs are very decent though, and will allow us to get an implementation

The following isn't explicitly said in the docs, but the Unknown Uint8 and Uint32 that appear in the methods for uploading rankings are the same Unknown Uint8 and Uint32 that appear on the RankingData

@DaniElectra DaniElectra marked this pull request as ready for review April 11, 2024 14:53
@DaniElectra DaniElectra requested a review from jonbarrow April 11, 2024 14:53
@jonbarrow
Copy link
Member

The following isn't explicitly said in the docs, but the Unknown Uint8 and Uint32 that appear in the methods for uploading rankings are the same Unknown Uint8 and Uint32 that appear on the RankingData

This should definitely be noted somewhere besides here. That seems like pretty critical information to have

@DaniElectra
Copy link
Member Author

This should definitely be noted somewhere besides here. That seems like pretty critical information to have

Yeah I thought the same, but I'm not sure where/how to place it


Scores are stored as a `List<Uint32>` for assigning multiple scores to a [RankingData]. All scores must contain 2 elements, even if the game doesn't use the second value.

In NEX 1, the category is represented as a `List<Uint16>`, but the server will only accept having a single value on the list.
Copy link
Member

Choose a reason for hiding this comment

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

Is this confirmed, like through code RE, to be a list? That seems VERY strange to me. Especially since trying to use it like so would crash Nintendo's servers. Typically even if a title didn't use a feature it would still work as expected on the server, so the fact that it functions so oddly in this case throws some flags imo. I almost wonder if it's just a uint32 and a uint16, as 2 different fields?

Copy link
Member Author

@DaniElectra DaniElectra Apr 12, 2024

Choose a reason for hiding this comment

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

I've tested this by changing the values and seeing what happens. Originally the raw value I would see from the game would be something like 010000009800. Incrementing the uint16 part didn't affect anything, but incrementing the first number would return some MemoryError error iirc, and after appending another uint16 it would show InvalidArgument instead.

This hasn't been actually verified by RE, but tbf I can't find any other possibility

docs/nex/protocols/ranking/legacy.md Outdated Show resolved Hide resolved
docs/nex/protocols/ranking/legacy.md Outdated Show resolved Hide resolved
docs/nex/protocols/ranking/legacy.md Show resolved Hide resolved
docs/nex/protocols/ranking/legacy.md Outdated Show resolved Hide resolved

### (17) UploadScoreWithLimit

It is unknown how the limit affects the score.
Copy link
Member

Choose a reason for hiding this comment

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

Do we have examples of the limit? I wonder if this means a limit on the score value, or a limit on the number of scores allowed in the category? Though it seems odd for this to be a client-controlled value in those cases

Copy link
Member Author

Choose a reason for hiding this comment

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

In all games I have checked (Angry Birds Trilogy, Mario & Sonic London 2012 and Mario Tennis Open), the "limit" is set to 65535 (0xFFFF)


### (20) UploadSpecificPeriodScore

It is unknown how the period affects the score.
Copy link
Member

Choose a reason for hiding this comment

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

What are some examples of periods we've seen? Sounds pretty likely it's the same as DataStore periods, where the data expires

Copy link
Member Author

Choose a reason for hiding this comment

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

In my dumps the "period" seems to be set to 32 (0x20)


### (23) UnknownMethod0x17

The number of entries returned matches with the number given as input. The entries may be related with `RankingData`, due to the similarities in layout. This method sometimes returns `Ranking::NotFound`.
Copy link
Member

Choose a reason for hiding this comment

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

Under what conditions does it error?

Copy link
Member Author

Choose a reason for hiding this comment

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

I got the method to error with Ranking::NotFound when I didn't set any parameters as input. I didn't test with big values (only up to 0xF00 iirc) in case the server would collapse when trying to give a lot of data to a single user.

My personal guess is that it would give the error when the input size was larger than the total size of the data in the server

@jonbarrow jonbarrow merged commit ebaa415 into PretendoNetwork:master Apr 22, 2024
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