Various list related stylistic improvements

This commit is contained in:
TraceEntertains 2025-02-20 20:47:20 -05:00
parent d6da729ca8
commit f6f600d897
13 changed files with 14 additions and 14 deletions

View File

@ -22,7 +22,7 @@ func GetObjectInfoByDataID(dataID types.UInt64) (datastore_types.DataStoreMetaIn
metaInfo.Permission = datastore_types.NewDataStorePermission()
metaInfo.DelPermission = datastore_types.NewDataStorePermission()
metaInfo.ExpireTime = types.NewDateTime(0x9C3F3E0000) // * 9999-12-31T00:00:00.000Z. This is what the real server sends
metaInfo.Ratings = make([]datastore_types.DataStoreRatingInfoWithSlot, 0)
metaInfo.Ratings = types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
var createdDate time.Time
var updatedDate time.Time

View File

@ -22,7 +22,7 @@ func GetObjectInfoByDataIDWithPassword(dataID, password types.UInt64) (datastore
metaInfo.Permission = datastore_types.NewDataStorePermission()
metaInfo.DelPermission = datastore_types.NewDataStorePermission()
metaInfo.ExpireTime = types.NewDateTime(0x9C3F3E0000) // * 9999-12-31T00:00:00.000Z. This is what the real server sends
metaInfo.Ratings = make([]datastore_types.DataStoreRatingInfoWithSlot, 0)
metaInfo.Ratings = types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
var createdDate time.Time
var updatedDate time.Time

View File

@ -17,7 +17,7 @@ func GetObjectInfoByPersistenceTargetWithPassword(persistenceTarget datastore_ty
metaInfo.Permission = datastore_types.NewDataStorePermission()
metaInfo.DelPermission = datastore_types.NewDataStorePermission()
metaInfo.ExpireTime = types.NewDateTime(0x9C3F3E0000) // * 9999-12-31T00:00:00.000Z. This is what the real server sends
metaInfo.Ratings = make([]datastore_types.DataStoreRatingInfoWithSlot, 0)
metaInfo.Ratings = types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
var accessPassword types.UInt64
var underReview bool

View File

@ -16,7 +16,7 @@ func GetObjectRatingsWithSlotByDataID(dataID types.UInt64) ([]datastore_types.Da
return nil, nexError
}
ratings := make([]datastore_types.DataStoreRatingInfoWithSlot, 0)
ratings := types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
rows, err := database.Postgres.Query(`SELECT slot, total_value, count, initial_value FROM datastore.object_ratings WHERE data_id=$1`, dataID)
if err != nil {

View File

@ -16,7 +16,7 @@ func GetObjectRatingsWithSlotByDataIDWithPassword(dataID, password types.UInt64)
return nil, nexError
}
ratings := make([]datastore_types.DataStoreRatingInfoWithSlot, 0)
ratings := types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
rows, err := database.Postgres.Query(`SELECT slot, total_value, count, initial_value FROM datastore.object_ratings WHERE data_id=$1`, dataID)
if err != nil {

View File

@ -15,7 +15,7 @@ func GetBufferQueuesByDataIDAndSlot(dataID types.UInt64, slot types.UInt32) (typ
return nil, nexError
}
bufferQueues := make(types.List[types.QBuffer], 0)
bufferQueues := types.NewList[types.QBuffer]()
rows, err := database.Postgres.Query(`SELECT buffer FROM datastore.buffer_queues WHERE data_id=$1 AND slot=$2 ORDER BY creation_date`, dataID, slot)

View File

@ -15,7 +15,7 @@ import (
)
func GetRandomCoursesWithLimit(limit int) (types.List[datastore_super_mario_maker_types.DataStoreCustomRankingResult], *nex.Error) {
courses := make(types.List[datastore_super_mario_maker_types.DataStoreCustomRankingResult], 0)
courses := types.NewList[datastore_super_mario_maker_types.DataStoreCustomRankingResult]()
rows, err := database.Postgres.Query(`
SELECT
@ -67,7 +67,7 @@ func GetRandomCoursesWithLimit(limit int) (types.List[datastore_super_mario_make
course.MetaInfo.Permission = datastore_types.NewDataStorePermission()
course.MetaInfo.DelPermission = datastore_types.NewDataStorePermission()
course.MetaInfo.ExpireTime = types.NewDateTime(0x9C3F3E0000) // * 9999-12-31T00:00:00.000Z. This is what the real server sends
course.MetaInfo.Ratings = make(types.List[datastore_types.DataStoreRatingInfoWithSlot], 0)
course.MetaInfo.Ratings = types.NewList[datastore_types.DataStoreRatingInfoWithSlot]()
var createdDate time.Time
var updatedDate time.Time

View File

@ -11,7 +11,7 @@ import (
)
func GetUserCourseObjectIDs(ownerPID types.PID) (types.List[types.UInt64], *nex.Error) {
courseObjectIDs := make(types.List[types.UInt64], 0)
courseObjectIDs := types.NewList[types.UInt64]()
// * Course objects seem to have data types > 2 and < 50.
// * Data type 1 seems to be reserved for "maker" objects.

View File

@ -18,7 +18,7 @@ func AddToBufferQueues(err error, packet nex.PacketInterface, callID uint32, par
client := packet.Sender()
pResults := make(types.List[types.QResult], 0)
pResults := types.NewList[types.QResult]()
// * The number of params and buffers CAN be allowed
// * to differ, though this doesn't appear to happen

View File

@ -16,7 +16,7 @@ func FollowingsLatestCourseSearchObject(err error, packet nex.PacketInterface, c
return nil, nex.NewError(nex.ResultCodes.DataStore.Unknown, err.Error())
}
pRankingResults := make(types.List[datastore_super_mario_maker_types.DataStoreCustomRankingResult], 0)
pRankingResults := types.NewList[datastore_super_mario_maker_types.DataStoreCustomRankingResult]()
// * This seems to ONLY be used to get rankings for course objects
// * uploaded by the users in param.OwnerIDs? If param.ResultOption

View File

@ -23,7 +23,7 @@ func GetApplicationConfig(err error, packet nex.PacketInterface, callID uint32,
return nil, nex.NewError(nex.ResultCodes.DataStore.Unknown, err.Error())
}
config := make([]uint32, 0)
var config []uint32
switch applicationID {
case 0: // * Player config?

View File

@ -16,7 +16,7 @@ func GetApplicationConfigString(err error, packet nex.PacketInterface, callID ui
}
// * Word blacklists?
config := make([]string, 0)
var config []string
switch applicationID {
case 128:

View File

@ -18,7 +18,7 @@ func GetDeletionReason(err error, packet nex.PacketInterface, callID uint32, dat
// * real "deletion reason" values are.
// * This is stubbed until we figure
// * that out
pDeletionReasons := make(types.List[types.UInt32], 0)
pDeletionReasons := types.NewList[types.UInt32]()
for range dataIDLst {
// * Every course I've checked has had this