character

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClassNames = map[Class]string{}

Load with info from game database on startup

View Source
var FlagDescriptors = map[vsn.BuildRange]FlagDescriptor{
	{0, vsn.Max}: {
		FlagLockedForTransfer: 0x00000004,
		FlagHideHelm:          0x00000400,
		FlagHideCloak:         0x00000800,
		FlagGhost:             0x00002000,
		FlagRename:            0x00004000,
		FlagLockedByBilling:   0x01000000,
		FlagDeclined:          0x02000000,
	},
}
View Source
var LoginResultDescriptors = map[vsn.BuildRange]map[LoginResult]uint8{
	{0, 3368}: {
		LoginInProgress:         0x30,
		LoginSuccess:            0x31,
		LoginNoWorld:            0x32,
		LoginDuplicateCharacter: 0x33,
		LoginNoInstances:        0x34,
		LoginFailed:             0x35,
		LoginDisabled:           0x36,
	},

	{5875, vsn.V3_3_5a}: {
		LoginNoWorld:            0x01,
		LoginDuplicateCharacter: 0x02,
		LoginNoInstances:        0x03,
		LoginDisabled:           0x04,
		LoginNoCharacter:        0x05,
		LoginLockedForTransfer:  0x06,
		LoginLockedByBilling:    0x07,
		LoginFailed:             0x08,
	},
}
View Source
var RaceNames = map[Race]string{}

Load with info from game database on startup

View Source
var ResultDescriptors = map[vsn.BuildRange]ResultDescriptor{
	{0, 3368}: {
		CharCreateInProgress: 0x27,
		CharCreateSuccess:    0x28,
		CharCreateError:      0x29,
		CharCreateFailed:     0x2A,
		CharCreateNameInUse:  0x2B,
		CharCreateDisabled:   0x2C,
		CharDeleteInProgress: 0x2D,
		CharDeleteSuccess:    0x2E,
		CharDeleteFailed:     0x2F,
	},

	{5875, 6005}: {
		CharCreateInProgress:        0x2D,
		CharCreateSuccess:           0x2E,
		CharCreateError:             0x2F,
		CharCreateFailed:            0x30,
		CharCreateNameInUse:         0x31,
		CharCreateDisabled:          0x3A,
		CharCreatePvpTeamsViolation: 0x33,
		CharCreateServerLimit:       0x34,
		CharCreateAccountLimit:      0x35,
		CharCreateServerQueue:       0x30,
		CharCreateOnlyExisting:      0x30,

		CharDeleteInProgress:              0x38,
		CharDeleteSuccess:                 0x39,
		CharDeleteFailed:                  0x3A,
		CharDeleteFailedLockedForTransfer: 0x3A,
		CharDeleteFailedGuildLeader:       0x3A,

		CharNameSuccess:                                0x50,
		CharNameFailure:                                0x4F,
		CharNameNoName:                                 0x43,
		CharNameTooShort:                               0x44,
		CharNameTooLong:                                0x45,
		CharNameInvalidCharacter:                       0x46,
		CharNameMixedLanguages:                         0x47,
		CharNameProfane:                                0x48,
		CharNameReserved:                               0x49,
		CharNameInvalidApostrophe:                      0x4A,
		CharNameMultipleApostrophes:                    0x4B,
		CharNameThreeConsecutive:                       0x4C,
		CharNameInvalidSpace:                           0x4D,
		CharNameConsecutiveSpaces:                      0x4E,
		CharNameRussianConsecutiveSilentCharacters:     0x4E,
		CharNameRussianSilentCharacterAtBeginningOrEnd: 0x4E,
		CharNameDeclensionDoesntMatchBaseName:          0x4E,
	},

	{6180, 8606}: {
		CharCreateInProgress:        0x2E,
		CharCreateSuccess:           0x2F,
		CharCreateError:             0x30,
		CharCreateFailed:            0x31,
		CharCreateNameInUse:         0x32,
		CharCreateDisabled:          0x33,
		CharCreatePvpTeamsViolation: 0x34,
		CharCreateServerLimit:       0x35,
		CharCreateAccountLimit:      0x36,
		CharCreateServerQueue:       0x37,
		CharCreateOnlyExisting:      0x38,
		CharCreateExpansion:         0x39,

		CharDeleteInProgress:              0x3A,
		CharDeleteSuccess:                 0x3B,
		CharDeleteFailed:                  0x3C,
		CharDeleteFailedLockedForTransfer: 0x3D,
		CharDeleteFailedGuildLeader:       0x3E,
		CharDeleteFailedArenaCaptain:      0x3F,

		CharNameSuccess:                                0x4A,
		CharNameFailure:                                0x4B,
		CharNameNoName:                                 0x4C,
		CharNameTooShort:                               0x4D,
		CharNameTooLong:                                0x4E,
		CharNameInvalidCharacter:                       0x4F,
		CharNameMixedLanguages:                         0x50,
		CharNameProfane:                                0x51,
		CharNameReserved:                               0x52,
		CharNameInvalidApostrophe:                      0x53,
		CharNameMultipleApostrophes:                    0x54,
		CharNameThreeConsecutive:                       0x55,
		CharNameInvalidSpace:                           0x56,
		CharNameConsecutiveSpaces:                      0x57,
		CharNameRussianConsecutiveSilentCharacters:     0x58,
		CharNameRussianSilentCharacterAtBeginningOrEnd: 0x59,
		CharNameDeclensionDoesntMatchBaseName:          0x5A,
	},

	{vsn.V3_0_2, vsn.V3_3_5a}: {
		CharCreateInProgress:           46,
		CharCreateSuccess:              47,
		CharCreateError:                48,
		CharCreateFailed:               49,
		CharCreateNameInUse:            50,
		CharCreateDisabled:             51,
		CharCreatePvpTeamsViolation:    52,
		CharCreateServerLimit:          53,
		CharCreateAccountLimit:         54,
		CharCreateServerQueue:          55,
		CharCreateOnlyExisting:         56,
		CharCreateExpansion:            57,
		CharCreateExpansionClass:       58,
		CharCreateLevelRequirement:     59,
		CharCreateUniqueClassLimit:     60,
		CharCreateCharacterInGuild:     61,
		CharCreateRestrictedRaceclass:  62,
		CharCreateCharacterChooseRace:  63,
		CharCreateCharacterArenaLeader: 64,
		CharCreateCharacterDeleteMail:  65,
		CharCreateCharacterSwapFaction: 66,
		CharCreateCharacterRaceOnly:    67,
		CharCreateCharacterGoldLimit:   68,
		CharCreateForceLogin:           69,

		CharDeleteInProgress:              70,
		CharDeleteSuccess:                 71,
		CharDeleteFailed:                  72,
		CharDeleteFailedLockedForTransfer: 73,
		CharDeleteFailedGuildLeader:       74,
		CharDeleteFailedArenaCaptain:      75,

		CharNameSuccess:                                87,
		CharNameFailure:                                88,
		CharNameNoName:                                 89,
		CharNameTooShort:                               90,
		CharNameTooLong:                                91,
		CharNameInvalidCharacter:                       92,
		CharNameMixedLanguages:                         93,
		CharNameProfane:                                94,
		CharNameReserved:                               95,
		CharNameInvalidApostrophe:                      96,
		CharNameMultipleApostrophes:                    97,
		CharNameThreeConsecutive:                       98,
		CharNameInvalidSpace:                           99,
		CharNameConsecutiveSpaces:                      100,
		CharNameRussianConsecutiveSilentCharacters:     101,
		CharNameRussianSilentCharacterAtBeginningOrEnd: 102,
		CharNameDeclensionDoesntMatchBaseName:          103,
	},
}

Functions

func EquipLen

func EquipLen(build vsn.Build) int

Types

type Char

type Char struct {
	GUID          guid.GUID
	Name          string
	Race          Race
	Class         Class
	BodyType      uint8
	Skin          uint8
	Face          uint8
	HairStyle     uint8
	HairColor     uint8
	FacialHair    uint8
	Level         uint8
	Zone          uint32
	Map           uint32
	X             float32
	Y             float32
	Z             float32
	Guild         uint32
	Flags         Flags
	Customization uint32
	FirstLogin    bool
	PetModel      uint32
	PetLevel      uint32
	PetFamily     uint32
	Equipment     []Equipment
}

type Class

type Class uint8

func (Class) String

func (r Class) String() string

type Create

type Create struct {
	Name       string
	Race       models.Race
	Class      models.Class
	BodyType   uint8
	Skin       uint8
	Face       uint8
	HairStyle  uint8
	HairColor  uint8
	FacialHair uint8
}

func (*Create) Decode

func (cc *Create) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*Create) Encode

func (cc *Create) Encode(build vsn.Build, out *packet.WorldPacket) error

type CreateResult

type CreateResult struct {
	Result
}

func (*CreateResult) Decode

func (ccr *CreateResult) Decode(build vsn.Build, in *packet.WorldPacket) (err error)

func (*CreateResult) Encode

func (ccr *CreateResult) Encode(build vsn.Build, out *packet.WorldPacket) error

type Delete

type Delete struct {
	ID guid.GUID
}

func (*Delete) Decode

func (dc *Delete) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*Delete) Encode

func (dc *Delete) Encode(build vsn.Build, out *packet.WorldPacket) error

type DeleteResult

type DeleteResult struct {
	Result
}

func (*DeleteResult) Decode

func (dcr *DeleteResult) Decode(build vsn.Build, in *packet.WorldPacket) (err error)

func (*DeleteResult) Encode

func (dcr *DeleteResult) Encode(build vsn.Build, out *packet.WorldPacket) error

type Equipment

type Equipment struct {
	Model       uint32
	Type        uint8
	Enchantment uint32
}

type FlagDescriptor

type FlagDescriptor map[Flags]uint32

type Flags

type Flags uint32
const (
	FlagLockedForTransfer Flags = 1 << iota
	FlagHideHelm
	FlagHideCloak
	FlagGhost
	FlagRename
	FlagLockedByBilling
	FlagDeclined
)

func (*Flags) Decode

func (f *Flags) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*Flags) Encode

func (f *Flags) Encode(build vsn.Build, out *packet.WorldPacket) error

type List

type List struct {
	Chars []Char
}

func (*List) Decode

func (chh *List) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*List) Encode

func (c *List) Encode(build vsn.Build, out *packet.WorldPacket) error

type LoginResult

type LoginResult uint8
const (
	LoginNoWorld LoginResult = iota
	LoginSuccess
	LoginInProgress
	LoginDuplicateCharacter
	LoginNoInstances
	LoginDisabled
	LoginNoCharacter
	LoginLockedForTransfer
	LoginLockedByBilling
	LoginFailed
)

type LoginStatus

type LoginStatus struct {
	Type   packet.WorldType
	Result LoginResult
}

func (*LoginStatus) Encode

func (l *LoginStatus) Encode(build vsn.Build, out *packet.WorldPacket) error

type Race

type Race uint8

func (Race) String

func (r Race) String() string

type Result

type Result uint8
const (
	CharCreateInProgress Result = iota
	CharCreateSuccess
	CharCreateError
	CharCreateFailed
	CharCreateNameInUse
	CharCreateDisabled
	CharCreatePvpTeamsViolation
	CharCreateServerLimit
	CharCreateAccountLimit
	CharCreateServerQueue
	CharCreateOnlyExisting
	CharCreateExpansion
	CharCreateExpansionClass
	CharCreateLevelRequirement
	CharCreateUniqueClassLimit
	CharCreateCharacterInGuild
	CharCreateRestrictedRaceclass
	CharCreateCharacterChooseRace
	CharCreateCharacterArenaLeader
	CharCreateCharacterDeleteMail
	CharCreateCharacterSwapFaction
	CharCreateCharacterRaceOnly
	CharCreateCharacterGoldLimit
	CharCreateForceLogin
	CharNameSuccess
	CharNameFailure
	CharNameNoName
	CharNameTooShort
	CharNameTooLong
	CharNameInvalidCharacter
	CharNameMixedLanguages
	CharNameProfane
	CharNameReserved
	CharNameInvalidApostrophe
	CharNameMultipleApostrophes
	CharNameThreeConsecutive
	CharNameInvalidSpace
	CharNameConsecutiveSpaces
	CharNameRussianConsecutiveSilentCharacters
	CharNameRussianSilentCharacterAtBeginningOrEnd
	CharNameDeclensionDoesntMatchBaseName
	CharDeleteInProgress
	CharDeleteSuccess
	CharDeleteFailed
	CharDeleteFailedLockedForTransfer
	CharDeleteFailedGuildLeader
	CharDeleteFailedArenaCaptain
	CharCreateTimeout
	CharCreateThrottle
	CharCreateAlliedRaceAchievement
	CharCreateLevelRequirementDemonHunter
	CharCreateCharacterInCommunity
)

type ResultDescriptor

type ResultDescriptor map[Result]uint8

type Template

type Template struct {
	TemplateSetID uint32
	Classes       []TemplateClass
	Name          string
	Description   string
	Level         uint8
}

type TemplateClass

type TemplateClass struct {
	FactionGroup uint8
	ClassID      uint8
}

Jump to

Keyboard shortcuts

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