mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-05 21:11:02 +02:00

While only a few routes implement this - such as SyncRegistration - we do not mind heavily if another client developed by a third party utilizes routes with only hashed/unhashed tokens.
55 lines
1.2 KiB
Go
55 lines
1.2 KiB
Go
package main
|
|
|
|
// LimitKinds represents various limits applied to the current ticket.
|
|
type LimitKinds int
|
|
|
|
const (
|
|
// PR is presumably "purchased".
|
|
PR LimitKinds = 0
|
|
TR = 1
|
|
DR = 2
|
|
SR = 3
|
|
LR = 4
|
|
AT = 10000
|
|
)
|
|
|
|
// LimitStruct returns a Limits struct filled for the given kind.
|
|
func LimitStruct(kind LimitKinds) Limits {
|
|
names := map[LimitKinds]string{
|
|
PR: "PR",
|
|
TR: "TR",
|
|
DR: "DR",
|
|
SR: "SR",
|
|
LR: "LR",
|
|
AT: "AT",
|
|
}
|
|
|
|
return Limits{
|
|
Limits: kind,
|
|
LimitKind: names[kind],
|
|
}
|
|
}
|
|
|
|
// DeviceStatus represents the various statuses a device may have.
|
|
//
|
|
// These values do not appear to be directly checked by the client within the
|
|
// Wii Shop Channel, and are a generic string. We could utilize any value we wish.
|
|
// However, titles utilizing DLCs appear to check the raw values.
|
|
// For this reason, we mirror values from Nintendo.
|
|
type DeviceStatus string
|
|
|
|
const (
|
|
DeviceStatusRegistered = "R"
|
|
DeviceStatusUnregistered = "U"
|
|
)
|
|
|
|
// TokenType represents a way to distinguish between ST- (unhashed)
|
|
// and WT- (hashed) device tokens.
|
|
type TokenType int
|
|
|
|
const (
|
|
TokenTypeUnhashed = iota
|
|
TokenTypeHashed
|
|
TokenTypeInvalid
|
|
)
|