common

package
v0.0.0-...-64c21b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FirstList       = ListTag{'F', 'D'}
	SpotList        = ListTag{'S', 'L'}
	BargainList     = ListTag{'R', 'L'}
	NewList         = ListTag{'N', 'L'}
	ContestDetail   = ListTag{'C', 'D'}
	ContestInfo     = ListTag{'C', 'I'}
	PopcraftsList   = ListTag{'C', 'L'}
	PopularList     = ListTag{'P', 'L'}
	ExtendedArtisan = ListTag{'R', 'C'}
	RK              = ListTag{'R', 'K'}
	PairMii         = ListTag{'P', 'M'}
	PairArtisan     = ListTag{'P', 'C'}
	EntryList       = ListTag{'E', 'L'}
	ContestMii      = ListTag{'C', 'M'}
	BestList        = ListTag{'B', 'L'}
	ContestTag      = ListTag{'C', 'N'}
	ContestArtisan  = ListTag{'C', 'C'}
	Thumbnail       = ListTag{'T', 'H'}
	MiiPairNumber   = ListTag{'P', 'N'}
	SpecialList     = ListTag{'I', 'L'}
	NumberInfo      = ListTag{'N', 'I'}
	Souvenir        = ListTag{'P', 'H'}
	ArtisanInfo     = ListTag{'I', 'N'}
	MiiInfo         = ListTag{'I', 'M'}
	OwnSearch       = ListTag{'O', 'S'}
	NameSearch      = ListTag{'N', 'S'}
	Search          = ListTag{'S', 'R'}
	SelectList      = ListTag{'L', 'L'}
)
View Source
var CountryCodes = []uint8{1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}

Functions

func CheckError

func CheckError(err error)

func ToBytes

func ToBytes(data any) []byte

ToBytes is the simplest form of writing a struct. Some structs may need to implement their own due to nested/unfixed slices, or other writable data types.

func Write

func Write(data Writable, path string) error

Write packs inputted data into a format that the Mii Contest Channel wants. This includes an "MC" header, HMAC-SHA1 signature, as well as compressed and encrypted data.

func WriteBinary

func WriteBinary(writer io.Writer, data any)

func ZFill

func ZFill(value int, size int) string

Types

type Config

type Config struct {
	Username        string `xml:"username"`
	Password        string `xml:"password"`
	DatabaseAddress string `xml:"databaseAddress"`
	DatabaseName    string `xml:"databaseName"`
	Address         string `xml:"address"`
	AssetsPath      string `xml:"assetsPath"`
}

func GetConfig

func GetConfig() Config

type LanguageFlag

type LanguageFlag uint8

LanguageFlag is a bitmask that allows for toggling supported languages for a country.

const (
	Japanese LanguageFlag = 1 << 0
	English  LanguageFlag = 1 << 1
	German   LanguageFlag = 1 << 2
	French   LanguageFlag = 1 << 3
	Spanish  LanguageFlag = 1 << 4
	Italian  LanguageFlag = 1 << 5
	Dutch    LanguageFlag = 1 << 6
)

type ListTag

type ListTag [2]byte

type MiiWithArtisan

type MiiWithArtisan struct {
	EntryNumber     uint32
	MiiData         []byte
	Initials        string
	Likes           uint8
	Skill           uint16
	CountryCode     uint8
	ArtisanId       uint32
	IsMasterArtisan uint8
	ArtisanMiiData  []byte
}

MiiWithArtisan contains Mii data with its artisan.

type Writable

type Writable interface {
	ToBytes(data any) []byte
}

Writable converts the inherited into a byte representation of itself. Structs can either use the preset function, or implement their own.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL