fix(datastore): use int32 for config values on GetApplicationConfig
Some checks are pending
Build and Publish Docker Image / Build and Publish Docker Image (amd64) (push) Waiting to run
Build and Publish Docker Image / Build and Publish Docker Image (arm64) (push) Waiting to run

This has been wrong since forever, the DDL trees say the config values
are supposed to be signed integers.
This commit is contained in:
Daniel López Guimaraes 2026-07-31 22:36:39 +01:00
parent 99dc519a94
commit 6ceb3ff207
No known key found for this signature in database
GPG Key ID: 6AC74DE3DEF050E0
2 changed files with 51 additions and 51 deletions

View File

@ -2,141 +2,141 @@ package constants
const (
// STARS_1ST_MEDAL represents the number of stars needed to acquire the 1st medal
STARS_1ST_MEDAL uint32 = 1
STARS_1ST_MEDAL int32 = 1
// STARS_2ND_MEDAL represents the number of stars needed to acquire the 2nd medal
STARS_2ND_MEDAL uint32 = 50
STARS_2ND_MEDAL int32 = 50
// STARS_3RD_MEDAL represents the number of stars needed to acquire the 3rd medal
STARS_3RD_MEDAL uint32 = 150
STARS_3RD_MEDAL int32 = 150
// STARS_4TH_MEDAL represents the number of stars needed to acquire the 4th medal
STARS_4TH_MEDAL uint32 = 300
STARS_4TH_MEDAL int32 = 300
// STARS_5TH_MEDAL represents the number of stars needed to acquire the 5th medal
STARS_5TH_MEDAL uint32 = 500
STARS_5TH_MEDAL int32 = 500
// STARS_6TH_MEDAL represents the number of stars needed to acquire the 6th medal
STARS_6TH_MEDAL uint32 = 800
STARS_6TH_MEDAL int32 = 800
// STARS_7TH_MEDAL represents the number of stars needed to acquire the 7th medal
STARS_7TH_MEDAL uint32 = 1300
STARS_7TH_MEDAL int32 = 1300
// STARS_8TH_MEDAL represents the number of stars needed to acquire the 8th medal
STARS_8TH_MEDAL uint32 = 2000
STARS_8TH_MEDAL int32 = 2000
// STARS_9TH_MEDAL represents the number of stars needed to acquire the 9th medal
STARS_9TH_MEDAL uint32 = 3000
STARS_9TH_MEDAL int32 = 3000
// STARS_10TH_MEDAL represents the number of stars needed to acquire the 10th medal
STARS_10TH_MEDAL uint32 = 5000
STARS_10TH_MEDAL int32 = 5000
// MAX_COURSE_UPLOADS_0TH_1ST_MEDAL represents the number of courses a user can upload when you have 0 or 1 medal
// Nintendo sets this to 10 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_0TH_1ST_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_0TH_1ST_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_2ND_MEDAL represents the number of courses a user can upload after getting the 2nd medal
// Nintendo sets this to 20 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_2ND_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_2ND_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_3RD_MEDAL represents the number of courses a user can upload after getting the 3rd medal
// Nintendo sets this to 30 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_3RD_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_3RD_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_4TH_MEDAL represents the number of courses a user can upload after getting the 4th medal
// Nintendo sets this to 40 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_4TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_4TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_5TH_MEDAL represents the number of courses a user can upload after getting the 5th medal
// Nintendo sets this to 50 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_5TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_5TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_6TH_MEDAL represents the number of courses a user can upload after getting the 6th medal
// Nintendo sets this to 60 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_6TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_6TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_7TH_MEDAL represents the number of courses a user can upload after getting the 7th medal
// Nintendo sets this to 70 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_7TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_7TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_8TH_MEDAL represents the number of courses a user can upload after getting the 8th medal
// Nintendo sets this to 80 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_8TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_8TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_9TH_MEDAL represents the number of courses a user can upload after getting the 9th medal
// Nintendo sets this to 90 by default and users earn more upload slots up to 100.
// This is a stupid, unfun, mechanic so everyone gets 100 by default. Can be more, but 100 is fine tbh
MAX_COURSE_UPLOADS_9TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_9TH_MEDAL int32 = 100
// MAX_COURSE_UPLOADS_10TH_MEDAL represents the number of courses you can upload after getting the 10th medal
// Nintendo sets this to 100 by default.
MAX_COURSE_UPLOADS_10TH_MEDAL uint32 = 100
MAX_COURSE_UPLOADS_10TH_MEDAL int32 = 100
// COURSE_WORLD_EASY_FAILURE_RATE_MIN is the minimum failure rate for Easy levels on the Course World
COURSE_WORLD_EASY_FAILURE_RATE_MIN uint32 = 0
COURSE_WORLD_EASY_FAILURE_RATE_MIN int32 = 0
// COURSE_WORLD_EASY_FAILURE_RATE_MAX is the maximum failure rate for Easy levels on the Course World
COURSE_WORLD_EASY_FAILURE_RATE_MAX uint32 = 34
COURSE_WORLD_EASY_FAILURE_RATE_MAX int32 = 34
// COURSE_WORLD_NORMAL_FAILURE_RATE_MIN is the minimum failure rate for Normal levels on the Course World
COURSE_WORLD_NORMAL_FAILURE_RATE_MIN uint32 = 35
COURSE_WORLD_NORMAL_FAILURE_RATE_MIN int32 = 35
// COURSE_WORLD_NORMAL_FAILURE_RATE_MAX is the maximum failure rate for Normal levels on the Course World
COURSE_WORLD_NORMAL_FAILURE_RATE_MAX uint32 = 74
COURSE_WORLD_NORMAL_FAILURE_RATE_MAX int32 = 74
// COURSE_WORLD_EXPERT_FAILURE_RATE_MIN is the minimum failure rate for Expert levels on the Course World
COURSE_WORLD_EXPERT_FAILURE_RATE_MIN uint32 = 75
COURSE_WORLD_EXPERT_FAILURE_RATE_MIN int32 = 75
// COURSE_WORLD_EXPERT_FAILURE_RATE_MAX is the maximum failure rate for Expert levels on the Course World
COURSE_WORLD_EXPERT_FAILURE_RATE_MAX uint32 = 95
COURSE_WORLD_EXPERT_FAILURE_RATE_MAX int32 = 95
// COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MIN is the minimum failure rate for Super Expert levels on the Course World
COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MIN uint32 = 96
COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MIN int32 = 96
// COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MAX is the maximum failure rate for Super Expert levels on the Course World
COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MAX uint32 = 100
COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MAX int32 = 100
// COURSE_DOWNLOAD_WIIU represents the number of courses downloaded by the Wii U at the same time
COURSE_DOWNLOAD_WIIU uint32 = 100
COURSE_DOWNLOAD_WIIU int32 = 100
// COURSE_DOWNLOAD_3DS represents the number of courses downloaded by the 3DS at the same time
COURSE_DOWNLOAD_3DS uint32 = 40
COURSE_DOWNLOAD_3DS int32 = 40
// CHANGED_DATE_YEAR contains the year of an unknown date, possibly when the config was last changed (2020-01-01 12:00)
CHANGED_DATE_YEAR uint32 = 2020
CHANGED_DATE_YEAR int32 = 2020
// CHANGED_DATE_MONTH contains the month of an unknown date, possibly when the config was last changed (2020-01-01 12:00)
CHANGED_DATE_MONTH uint32 = 1
CHANGED_DATE_MONTH int32 = 1
// CHANGED_DATE_DAY contains the day of an unknown date, possibly when the config was last changed (2020-01-01 12:00)
CHANGED_DATE_DAY uint32 = 1
CHANGED_DATE_DAY int32 = 1
// CHANGED_DATE_HOUR contains the hour of an unknown date, possibly when the config was last changed (2020-01-01 12:00)
CHANGED_DATE_HOUR uint32 = 12
CHANGED_DATE_HOUR int32 = 12
// CHANGED_DATE_MINUTE contains the minute of an unknown date, possibly when the config was last changed (2020-01-01 12:00)
CHANGED_DATE_MINUTE uint32 = 0
CHANGED_DATE_MINUTE int32 = 0
// BOOKMARK_DATE_YEAR contains the year of when the SMM bookmark was released (2015-12-22 5:00)
BOOKMARK_DATE_YEAR uint32 = 2015
BOOKMARK_DATE_YEAR int32 = 2015
// BOOKMARK_DATE_MONTH contains the month of when the SMM bookmark was released (2015-12-22 5:00)
BOOKMARK_DATE_MONTH uint32 = 12
BOOKMARK_DATE_MONTH int32 = 12
// BOOKMARK_DATE_DAY contains the day of when the SMM bookmark was released (2015-12-22 5:00)
BOOKMARK_DATE_DAY uint32 = 22
BOOKMARK_DATE_DAY int32 = 22
// BOOKMARK_DATE_HOUR contains the hour of when the SMM bookmark was released (2015-12-22 5:00)
BOOKMARK_DATE_HOUR uint32 = 5
BOOKMARK_DATE_HOUR int32 = 5
// BOOKMARK_DATE_MINUTE contains the minute of when the SMM bookmark was released (2015-12-22 5:00)
BOOKMARK_DATE_MINUTE uint32 = 0
BOOKMARK_DATE_MINUTE int32 = 0
)

View File

@ -16,7 +16,7 @@ func GetApplicationConfig(err error, packet nex.PacketInterface, callID uint32,
return nil, nex.NewError(nex.ResultCodes.DataStore.Unknown, err.Error())
}
var config []uint32
var config []int32
switch applicationID {
case 0: // * Gameplay config (Wii U)
@ -31,9 +31,9 @@ func GetApplicationConfig(err error, packet nex.PacketInterface, callID uint32,
fmt.Printf("[Warning] DataStoreSMMProtocol::GetApplicationConfig Unsupported applicationID: %v\n", applicationID)
}
configNative := make(types.List[types.UInt32], 0, len(config))
configNative := make(types.List[types.Int32], 0, len(config))
for i := range config {
configNative = append(configNative, types.NewUInt32(config[i]))
configNative = append(configNative, types.Int32(config[i]))
}
rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer.LibraryVersions, globals.SecureServer.ByteStreamSettings)
@ -48,9 +48,9 @@ func GetApplicationConfig(err error, packet nex.PacketInterface, callID uint32,
return rmcResponse, nil
}
func getApplicationConfig_GameplayConfig() []uint32 {
func getApplicationConfig_GameplayConfig() []int32 {
// * This seems to be gameplay configuration settings
return []uint32{
return []int32{
constants.STARS_1ST_MEDAL,
constants.STARS_2ND_MEDAL,
constants.STARS_3RD_MEDAL,
@ -99,9 +99,9 @@ func getApplicationConfig_GameplayConfig() []uint32 {
}
}
func getApplicationConfig_OfficialMakers() []uint32 {
func getApplicationConfig_OfficialMakers() []int32 {
// * Used as the PIDs for the "Official" makers in the "MAKERS" section
return []uint32{
return []int32{
2, // * Not a real user PID, this translates to the internal Quazal Rendez-Vous user used by NEX
1770179696, // * "official_player0" on NN, need to make PN versions
1770179664, // * "official_player1" on NN, need to make PN versions
@ -114,11 +114,11 @@ func getApplicationConfig_OfficialMakers() []uint32 {
}
}
func getApplicationConfig_Bookmark() []uint32 {
func getApplicationConfig_Bookmark() []int32 {
// * Looks like a date?
// * This was when the SMM bookmark was released, so maybe it controls accessibility to it?
// * Just replaying data sent from the real server
return []uint32{
return []int32{
constants.BOOKMARK_DATE_YEAR,
constants.BOOKMARK_DATE_MONTH,
constants.BOOKMARK_DATE_DAY,
@ -127,9 +127,9 @@ func getApplicationConfig_Bookmark() []uint32 {
} // * 2015-12-22 5:00
}
func getApplicationConfig_GameplayConfig3DS() []uint32 {
func getApplicationConfig_GameplayConfig3DS() []int32 {
// * This seems to be gameplay configuration settings for the 3DS
return []uint32{
return []int32{
constants.COURSE_WORLD_NORMAL_FAILURE_RATE_MIN,
constants.COURSE_WORLD_EXPERT_FAILURE_RATE_MIN,
constants.COURSE_WORLD_SUPER_EXPERT_FAILURE_RATE_MIN,