mirror of
https://github.com/PretendoNetwork/super-mario-maker.git
synced 2026-08-01 16:04:45 -05:00
Moved incrementCourseAttemptCount
GetBufferQueues is called in other places leading to fake attempt counts
This commit is contained in:
parent
e9adee15b0
commit
8a34bd1855
|
|
@ -19,7 +19,6 @@ func getBufferQueue(err error, client *nex.Client, callID uint32, param *nexprot
|
|||
pBufferQueue = make([][]byte, 0)
|
||||
case 3: // death data
|
||||
pBufferQueue = getBufferQueueDeathData(param.DataID)
|
||||
incrementCourseAttemptCount(param.DataID) // We also know this is when a user attempts a course
|
||||
default:
|
||||
fmt.Printf("[Warning] DataStoreSMMProtocol::GetBufferQueue Unsupported slot: %v\n", param.Slot)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nexproto "github.com/PretendoNetwork/nex-protocols-go"
|
||||
)
|
||||
|
|
@ -8,6 +10,12 @@ import (
|
|||
func suggestedCourseSearchObject(err error, client *nex.Client, callID uint32, param *nexproto.DataStoreSearchParam, extraData []string) {
|
||||
// TODO complete this
|
||||
|
||||
courseID, _ := strconv.ParseUint(extraData[0], 0, 64)
|
||||
|
||||
if userNotOwnCourse(courseID, client.PID()) {
|
||||
incrementCourseAttemptCount(courseID) // We also know this is when a user attempts a course
|
||||
}
|
||||
|
||||
pRankingResults := make([]*nexproto.DataStoreCustomRankingResult, 0)
|
||||
|
||||
courseMetadatas := getCourseMetadatasByLimit(4) // In PCAPs param.minimalRatingFrequency is 4 but is 0 here?
|
||||
|
|
|
|||
|
|
@ -168,3 +168,9 @@ func userMiiDataToDataStoreMetaInfo(ownerID uint32, miiInfo primitive.M) *nexpro
|
|||
|
||||
return metaInfo
|
||||
}
|
||||
|
||||
func userNotOwnCourse(courseID uint64, pid uint32) bool {
|
||||
courseMetadata := getCourseMetadataByDataID(courseID)
|
||||
|
||||
return courseMetadata.OwnerPID != pid
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user