Documentation ¶
Index ¶
- Variables
- type ApiClient
- func (c *ApiClient) GetProfile(uid HabboId) (profile web.Profile, err error)
- func (c *ApiClient) GetRawUser(name string) (data []byte, err error)
- func (c *ApiClient) GetUser(uid HabboId) (user web.User, err error)
- func (c *ApiClient) GetUserByName(name string) (user web.User, err error)
- func (c *ApiClient) GetUserExists(name string) (exists bool, err error)
- type AvatarState
- type Figure
- type FigureItem
- type FigurePart
- type FigurePartType
- type FurniType
- type Gender
- type HabboId
- type HabboIdKind
- type ItemType
Constants ¶
This section is empty.
Variables ¶
var ( ErrUserNotFound = errors.New("the user was not found") ErrUserBanned = errors.New("the user is banned") ErrMaintenance = errors.New("the server is under maintenance") )
var AvatarActions = []AvatarState{ ActStand, ActWalk, ActWave, ActLay, ActBlowKiss, ActCarry, ActDrink, ActRespect, ActSign, ActSit, }
AvatarActions contains all of the avatar states that are actions.
var AvatarExpressions = []AvatarState{ ExprSpeak, ExprSleep, ExprSad, ExprSmile, ExprAngry, ExprSurprised, ExprSpeakLay, ExprSleepLay, ExprSadLay, ExprSmileLay, ExprAngryLay, ExprSurprisedLay, }
AvatarExpressions contains all of the avatar states that are expressions.
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶
type ApiClient struct { Http *http.Client Host string // Issue an extra request to determine if a user who is not found previously existed, // indicating that they have been permanently banned. // If so, the error returned will be ErrUserBanned. CheckBan bool Agent string // The user agent to use. }
func NewApiClient ¶
func (*ApiClient) GetProfile ¶
func (*ApiClient) GetRawUser ¶
Gets the raw response of the specified user's info.
func (*ApiClient) GetUserByName ¶
Gets a user's information by their name. If the user was not found, and CheckBan is true, an extra request will be issued to determine whether the user exists and was not found due to being permanently banned.
type AvatarState ¶
type AvatarState string
AvatarState defines an action or expression of an avatar.
const ( ActStand AvatarState = "std" // Standing. ActWalk AvatarState = "wlk" // Walking. ActWave AvatarState = "wav" // Waving. ActLay AvatarState = "lay" // Laying. ActBlowKiss AvatarState = "blw" // Blowing a kiss. ActCarry AvatarState = "crr" // Carrying a hand item. ActDrink AvatarState = "drk" // Drinking. ActRespect AvatarState = "respect" // Respecting. ActSign AvatarState = "sig" // Showing a sign. ActSit AvatarState = "sit" // Sitting. )
const ( // ExprNeutral is used to specify a neutral or no expression. // It is not an official expression, and is not included in AllExpressions. ExprNeutral AvatarState = "ntr" ExprSpeak AvatarState = "spk" // Speaking. ExprSleep AvatarState = "eyb" // Sleeping. ExprSad AvatarState = "sad" // Sad. ExprSmile AvatarState = "sml" // Smiling. ExprAngry AvatarState = "agr" // Angry. ExprSurprised AvatarState = "srp" // Surprised. ExprSpeakLay AvatarState = "lsp" // Speaking / laying. ExprSleepLay AvatarState = "ley" // Sleeping / laying. ExprSadLay AvatarState = "lsa" // Sad / laying. ExprSmileLay AvatarState = "lsm" // Smiling / laying. ExprAngryLay AvatarState = "lag" // Angry / laying. ExprSurprisedLay AvatarState = "lsr" // Surprised / laying. )
func (AvatarState) IsAction ¶
func (state AvatarState) IsAction() bool
IsAction reports whether the avatar state is an action.
func (AvatarState) IsExpression ¶
func (state AvatarState) IsExpression() bool
IsExpression reports whether the avatar state is an expression.
type Figure ¶
type Figure struct { Gender Gender Items []FigureItem }
A Figure represents a gender and a set of figure items.
type FigureItem ¶
type FigureItem struct { Type FigurePartType // The type of figure part set. Id int // The identifier of the figure part set. Colors []int // A list of color identifiers. }
FigureItem defines a figure part set type and identifier with colors.
func (*FigureItem) String ¶
func (item *FigureItem) String() string
String formats the figure item to its string representation.
type FigurePart ¶
type FigurePart struct { Type FigurePartType // The type of the figure part. Id int // The identifier of the figure part. }
A FigurePart defines a figure part type and identifier.
func (*FigurePart) String ¶
func (part *FigurePart) String() string
String formats the figure part to its string representation.
type FigurePartType ¶
type FigurePartType string
const ( Hair FigurePartType = "hr" // Hair. HairBelow FigurePartType = "hrb" // Hair below hat. Head FigurePartType = "hd" // Head. Hat FigurePartType = "ha" // Hat. HeadAcc FigurePartType = "he" // Head accessory. EyeAcc FigurePartType = "ea" // Eye accessory, i.e. glasses. FaceAcc FigurePartType = "fa" // Face accessory, i.e. masks. Eyes FigurePartType = "ey" // Eyes. Face FigurePartType = "fc" // Face. Body FigurePartType = "bd" // Body. LeftHand FigurePartType = "lh" // Left hand. RightHand FigurePartType = "rh" // Right hand. Chest FigurePartType = "ch" // Chest, i.e. shirts. ChestPrint FigurePartType = "cp" // Chest print. ChestAcc FigurePartType = "ca" // Chest accessory, i.e. jewellery. LeftSleeve FigurePartType = "ls" // Left sleeve. RightSleeve FigurePartType = "rs" // Right sleeve. Legs FigurePartType = "lg" // Legs, i.e. trousers. Shoes FigurePartType = "sh" // Shoes. Waist FigurePartType = "wa" // Waist, i.e. belts. Coat FigurePartType = "cc" // Coat/jacket. LeftCoat FigurePartType = "lc" // Left coat sleeve. RightCoat FigurePartType = "rc" // Right coat sleeve. LeftHandItem FigurePartType = "li" // Left hand item. RightHandItem FigurePartType = "ri" // Right hand item. )
func (FigurePartType) Flip ¶
func (pt FigurePartType) Flip() FigurePartType
Flip flips the part type between left and right arms, if it is an arm part. If not, the part type is returned unchanged.
func (FigurePartType) IsBody ¶
func (pt FigurePartType) IsBody() bool
IsBody reports whether the part type belongs to the body.
func (FigurePartType) IsHead ¶
func (pt FigurePartType) IsHead() bool
IsHead reports whether the part type belongs to the head.
func (FigurePartType) IsLeftArm ¶
func (pt FigurePartType) IsLeftArm() bool
IsLeftArm reports whether the part type belongs to the left arm.
func (FigurePartType) IsRightArm ¶
func (pt FigurePartType) IsRightArm() bool
IsRightArm reports whether the part type belongs to the right arm.
func (FigurePartType) IsWearable ¶
func (layer FigurePartType) IsWearable() (wearable bool)
IsWearable reports whether the figure part type is valid in a figure string.
type FurniType ¶
type FurniType int
FurniType represents the special type of a furni.
const ( FurniTypeNormal FurniType = iota + 1 FurniTypeWallpaper FurniTypeFloor FurniTypeLandscape FurniTypeSticky FurniTypePoster FurniTypeTrax FurniTypeDisk FurniTypeGift FurniTypeMysteryBox FurniTypeTrophy FurniTypeHorseDye FurniType = iota + 2 FurniTypeHorseHairstyle FurniTypeHorseHairdye FurniTypeHorseSaddle FurniTypeGroup FurniTypeSnowWar FurniTypeMonsterPlantSeed FurniTypeMonsterPlantRevival FurniTypeMonsterPlantRebreeding FurniTypeMonsterPlantFertiliser FurniTypeClothing )
type HabboId ¶
type HabboId struct { // The type of the identifier. Kind HabboIdKind // The hotel identifier. Hotel string // A 128-bit unique identifier. Uid [16]byte }
A HabboId is unique Habbo resource identifier.
type HabboIdKind ¶
type HabboIdKind int
HabboIdKind represents the kind of resource identified, i.e. user, group or room.
const ( HabboIdKindUser HabboIdKind = iota HabboIdKindGroup HabboIdKindRoom )
func (HabboIdKind) Prefix ¶
func (t HabboIdKind) Prefix() string
type ItemType ¶
type ItemType rune
ItemType represents the type of an item. May be floor, wall, badge, effect or bot.
func (ItemType) MarshalJSON ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package gamedata provides types for the following game data:
|
Package gamedata provides types for the following game data: |
Package imager provides functionality for rendering assets to images.
|
Package imager provides functionality for rendering assets to images. |
Package raw contains sub-packages for parsing raw JSON and XML assets.
|
Package raw contains sub-packages for parsing raw JSON and XML assets. |
json
Package json provides types for parsing raw JSON assets.
|
Package json provides types for parsing raw JSON assets. |
nitro
Package nitro provides functionality for reading Nitro assets.
|
Package nitro provides functionality for reading Nitro assets. |
xml
Package xml provides types for parsing XML assets.
|
Package xml provides types for parsing XML assets. |
Package res provides functionality for loading resources from figure part and furni libraries.
|
Package res provides functionality for loading resources from figure part and furni libraries. |
Package web provides types for parsing JSON responses from the web API.
|
Package web provides types for parsing JSON responses from the web API. |