Documentation ¶
Index ¶
- func Invoke(any interface{}, name string, args ...interface{}) []reflect.Value
- func MarshalAny(db interface{}, buf io.Writer, version Int) error
- func PrettyPrint(v interface{})
- func UnmarshalAny(db interface{}, buf io.Reader, version Int) error
- type BeatMap
- type BinaryOsuCodec
- type BinaryOsuMarshaler
- type BinaryOsuUnmarshaler
- type Boolean
- type Byte
- type CollectionDb
- type CollectionDbElement
- type DateTime
- type Double
- type Int
- type IntDoublePair
- type Long
- type OsuDb
- type PlayerPresence
- type PresenceDb
- type ScoresDb
- type ScoresDbBeatMap
- type ScoresDbBeatMapScore
- type Short
- type Single
- type String
- type TimingPoint
- type ULEB128
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Invoke ¶
Invoke - call a method on the given interface using reflection Args:
any: Any object for which you want to call a method on. Be sure to pass in the pointer if the method belongs to the pointer interface name: The method name to invoke. args: Vardiadic number of args to pass to the method.
func MarshalAny ¶
Use reflection to marshal all the fields in the given interface This will loop through every field and call the 'MarshalOsuBinary' method on the type passing in the 'buf' which is the source of all the bytes. A special case is where a field is a slice. In this case:
- We look up the field name like "Num<SliceFieldName>" and retrieve the number of elements to exepect from the stream
- Create a new slice
- Iterate through each slice element and run the MarshalOsuBinary method
Args:
db: The object to unmarshal
/ buf: The buffer in which to write the marshalled bytes
func UnmarshalAny ¶
Use reflection to unmarshal all the fields in the given interface This will loop through every field and call the 'UnmarshalOsuBinary' method on the type passing in the 'buf' which is the source of all the bytes. A special case is where a field is a slice. In this case:
- We look up the field name like "Num<SliceFieldName>" and retrieve the number of elements to exepect from the stream
- Create a new slice
- Iterate through each slice element and run the UnmarshalOsuBinary method
Args:
db: The object to unmarshal
/ buf: The buffer in which we retrieve bytes to unmarshal
Types ¶
type BeatMap ¶
type BeatMap struct { SizeOfBeatmapBytes Int ArtistName String ArtistNameUnicode String SongTitle String SongTitleUnicode String CreatorName String Difficulty String AudioFileName String Md5 String OsuFileName String RankedStatus Byte NumHitCircles Short NumOfSliders Short NumOfSpinners Short LastModTimeTicks Long ApproachRateByte Byte `osu-end:"20140609"` CircleSizeByte Byte `osu-end:"20140609"` HPDrainRateByte Byte `osu-end:"20140609"` OverallDifficultyByte Byte `osu-end:"20140609"` ApproachRate Single CircleSize Single HPDrainRate Single OverallDifficulty Single SliderVelocity Double NumOsuStandardStarRating Int `osu-start:"20140609"` OsuStandardStarRating []IntDoublePair `osu-start:"20140609"` NumTaikoStarRating Int `osu-start:"20140609"` TaikoStarRating []IntDoublePair `osu-start:"20140609"` NumCTBStarRating Int `osu-start:"20140609"` CTBStarRating []IntDoublePair `osu-start:"20140609"` NumManiaStarRating Int `osu-start:"20140609"` ManiaStarRating []IntDoublePair `osu-start:"20140609"` DrainTimeSecs Int TotalTimeMsec Int AudioPreviewMsec Int NumTimingPoints Int TimingPoints []TimingPoint BeatmapID Int BeatmapSetID Int ThreadID Int GradeOsuStandard Byte GradeTaiko Byte GradeCTB Byte GradeMania Byte LocalBeatmapOffset Short StackLeniency Single OsuGameplayMode Byte SongSource String SongTags String OnlineOffset Short TitleFont String IsPlayed Boolean LastTimePlayed Long IsOsz2Format Boolean RelativeFolderName String LastTimeCheckedWithRepo Long IgnoreBeatmapSound Boolean IgnoreBeatmapSkin Boolean DisableStoryboard Boolean DisableVideo Boolean UnknownShortField Short `osu-end:"20140609"` VisualOverride Boolean LastModificationTime Int ManiaScrollSpeed Byte }
func (*BeatMap) MarshalOsuBinary ¶
type BinaryOsuCodec ¶
type BinaryOsuCodec interface { BinaryOsuMarshaler BinaryOsuUnmarshaler }
type BinaryOsuMarshaler ¶
Marshaler interface for Osu Binary blobs
type BinaryOsuUnmarshaler ¶
Unmarshaler interface for Osu Binary blobs
type Byte ¶
type Byte uint8
Type aliases so that the number of bytes match what osu is expecting. Exceptions: 1. ULEB128 is aliased to uint64 (hopefully this is big enough) 2. String is aliased to a struct with all the required information.
func (*Byte) MarshalOsuBinary ¶
type CollectionDb ¶
type CollectionDb struct { Version Int NumCollections Int Collections []CollectionDbElement }
func (*CollectionDb) MarshalOsuBinary ¶
func (this *CollectionDb) MarshalOsuBinary(buf io.Writer, version Int) error
func (*CollectionDb) UnmarshalOsuBinary ¶
func (this *CollectionDb) UnmarshalOsuBinary(buf io.Reader, version Int) error
type CollectionDbElement ¶
func (*CollectionDbElement) MarshalOsuBinary ¶
func (this *CollectionDbElement) MarshalOsuBinary(buf io.Writer, version Int) error
func (*CollectionDbElement) UnmarshalOsuBinary ¶
func (this *CollectionDbElement) UnmarshalOsuBinary(buf io.Reader, version Int) error
type IntDoublePair ¶
type IntDoublePair struct { ExtraBeforeInt Byte IntValue Int ExtraBeforeDouble Byte DoubleValue Double }
func (*IntDoublePair) MarshalOsuBinary ¶
func (this *IntDoublePair) MarshalOsuBinary(buf io.Writer, version Int) error
func (*IntDoublePair) UnmarshalOsuBinary ¶
func (this *IntDoublePair) UnmarshalOsuBinary(buf io.Reader, version Int) error
type OsuDb ¶
type OsuDb struct { Version Int FolderCount Int AccountUnlocked Boolean Datetime DateTime PlayerName String NumBeatmaps Int Beatmaps []BeatMap Extra Int }
func (*OsuDb) MarshalOsuBinary ¶
type PlayerPresence ¶
type PlayerPresence struct { PlayerId Int PlayerName String UtcOffset Byte Country Byte UnknownByteField Byte Longitude Single Latitude Single GlobalRank Int DateModified DateTime }
func (*PlayerPresence) MarshalOsuBinary ¶
func (this *PlayerPresence) MarshalOsuBinary(buf io.Writer, version Int) error
func (*PlayerPresence) UnmarshalOsuBinary ¶
func (this *PlayerPresence) UnmarshalOsuBinary(buf io.Reader, version Int) error
type PresenceDb ¶
type PresenceDb struct { Version Int NumPlayers Int Players []PlayerPresence }
func (*PresenceDb) MarshalOsuBinary ¶
func (this *PresenceDb) MarshalOsuBinary(buf io.Writer, version Int) error
func (*PresenceDb) UnmarshalOsuBinary ¶
func (this *PresenceDb) UnmarshalOsuBinary(buf io.Reader, version Int) error
type ScoresDb ¶
type ScoresDb struct { Version Int NumBeatmaps Int Beatmaps []ScoresDbBeatMap }
func (*ScoresDb) MarshalOsuBinary ¶
type ScoresDbBeatMap ¶
type ScoresDbBeatMap struct { Md5Hash String NumScores Int Scores []ScoresDbBeatMapScore }
func (*ScoresDbBeatMap) MarshalOsuBinary ¶
func (this *ScoresDbBeatMap) MarshalOsuBinary(buf io.Writer, version Int) error
func (*ScoresDbBeatMap) UnmarshalOsuBinary ¶
func (this *ScoresDbBeatMap) UnmarshalOsuBinary(buf io.Reader, version Int) error
type ScoresDbBeatMapScore ¶
type ScoresDbBeatMapScore struct { GameplayMode Byte Version Int Md5Hash String PlayerName String ReplayMd5Hash String Num300 Short Num200 Short Num50 Short NumMax300 Short Num100 Short NumMiss Short ReplayScore Int MaxCombo Short IsPerfectCombo Boolean Mods Int EmptyString String TimestampOfReplayWindowTicks Long AlwaysNegativeOne Int OnlineScoreId Long }
func (*ScoresDbBeatMapScore) MarshalOsuBinary ¶
func (this *ScoresDbBeatMapScore) MarshalOsuBinary(buf io.Writer, version Int) error
func (*ScoresDbBeatMapScore) UnmarshalOsuBinary ¶
func (this *ScoresDbBeatMapScore) UnmarshalOsuBinary(buf io.Reader, version Int) error
type String ¶
func (*String) MarshalOsuBinary ¶
type TimingPoint ¶
func (*TimingPoint) MarshalOsuBinary ¶
func (this *TimingPoint) MarshalOsuBinary(buf io.Writer, version Int) error
func (*TimingPoint) UnmarshalOsuBinary ¶
func (this *TimingPoint) UnmarshalOsuBinary(buf io.Reader, version Int) error