handler

package
v0.0.0-...-5b25caa Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CACHED []*Cache
View Source
var CLIENT *redis.Client

Functions

func AchievementHandler

func AchievementHandler(w http.ResponseWriter, r *http.Request)

func BodyReader

func BodyReader(r *http.Request) []byte

func ClaimAchievement

func ClaimAchievement(u *consts.User, sdata *scoredata, bm *helper.DBBeatmap) string

func ClaimbutNoDisplayAchivement

func ClaimbutNoDisplayAchivement(u *consts.User, sdata *scoredata, bm *helper.DBBeatmap)

func DelCache

func DelCache(CacheKey string)

func GETAvatar

func GETAvatar(w http.ResponseWriter, r *http.Request)

func GETDirectSet

func GETDirectSet(w http.ResponseWriter, r *http.Request)

func GETScoreboard

func GETScoreboard(w http.ResponseWriter, r *http.Request)

func GETScreenshot

func GETScreenshot(w http.ResponseWriter, r *http.Request)

func GETUpdates

func GETUpdates(w http.ResponseWriter, r *http.Request)

func GETreplaycompressed

func GETreplaycompressed(w http.ResponseWriter, r *http.Request)

func GetCache

func GetCache(CacheKey string) ([]byte, error)

func GetScoreID

func GetScoreID(ScoreHash string) int

func March

func March(a ...string) string

func POSTScreenshot

func POSTScreenshot(w http.ResponseWriter, r *http.Request)

func POSTSubmitModular

func POSTSubmitModular(w http.ResponseWriter, r *http.Request)

func POSTosuerror

func POSTosuerror(w http.ResponseWriter, r *http.Request)

func Position

func Position(UserID int32, FileMD5 string) int

func SearchDirect

func SearchDirect(w http.ResponseWriter, r *http.Request)

func StartCacheCheck

func StartCacheCheck()

Types

type Achievement

type Achievement struct {
	ID          int32
	Name        string
	DisplayName string
	Description string
	Icon        []byte
}

func GetAchievement

func GetAchievement(name string) *Achievement

func (*Achievement) AddToUser

func (a *Achievement) AddToUser(u *consts.User)

func (*Achievement) DisplayToUser

func (a *Achievement) DisplayToUser(u *consts.User)

func (*Achievement) FileIcon

func (a *Achievement) FileIcon(x2 bool) []byte

func (*Achievement) ToString

func (a *Achievement) ToString() string

type Cache

type Cache struct {
	CacheHash   string
	DeleteCache time.Time
	Timeout     int64
}

func SetCache

func SetCache(CacheKey string, CacheData []byte, Timeout int64) *Cache

type Score

type Score struct {
	ScoreID   uint32
	UserID    uint32
	FileMD5   string
	ScoreMD5  string
	ReplayMD5 string
	Score     int32
	MaxCombo  uint16
	PlayMode  int8
	Mods      uint32
	Count300  uint16
	Count100  uint16
	Count50   uint16
	CountGeki uint16
	CountKatu uint16
	CountMiss uint16
	Date      time.Time
	Accuracy  float64
	PP        float32
}

func (*Score) Position

func (s *Score) Position() int

type Scoreboard

type Scoreboard struct {
	User              *consts.User
	ScoreboardType    int8
	ScoreboardVersion int8
	Beatmap           *helper.DBBeatmap
	PlayMode          int8
	Mods              uint16
	Friends           []*uint32
	Scores            []*Score
	ScoreIDs          []*uint32
}

func (*Scoreboard) DisplayScoreboard

func (sb *Scoreboard) DisplayScoreboard() (out string)

Jump to

Keyboard shortcuts

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