realm

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelpColor = "FF50c41a"
	DemoColor = "FF99CCFF"
)
View Source
const (
	UseCompressionSmartly int = iota
	ForceCompressionOff
	ForceCompressionOn
)
View Source
const (
	Mana = iota
	Rage
	Focus
	Energy
	Happiness
)
View Source
const (
	OptionFlagAsync = 1 << iota
)

Variables

View Source
var (
	DefaultSpeeds = update.Speeds{
		update.Walk:           2.5,
		update.Run:            7,
		update.RunBackward:    4.5,
		update.Swim:           4.722222,
		update.SwimBackward:   2.5,
		update.Turn:           3.141594,
		update.Flight:         7.0,
		update.FlightBackward: 4.7222,
		update.Pitch:          3.14,
	}
)
View Source
var (
	MaxGoldNew, _ = econ.ParseShortString("9999999g99s99c")
)
View Source
var NullProp wdb.PropID
View Source
var (
	ObjectDebug = wdb.MakePropID("dbgobj")
)

Functions

func OptionAsync

func OptionAsync(t p.WorldType, data []byte, opts *Options) error

func PowerType

func PowerType(class packet.Class) uint8

func RegisterPlugin

func RegisterPlugin(name string, plugin Plugin)

func Start

func Start(opts *config.World) error

Types

type Command

type Command struct {
	Requires  CommandPrivileges
	Signature string
	// Can be multiline
	Description string
	Function    interface{}
}

type CommandPrivileges

type CommandPrivileges uint8

CommandPrivileges a bitmask of privileges to be compared with Command.Requires. Any player with sys.Tier_Admin tier can bypass this check.

const (
	Player CommandPrivileges = 1 << iota
	GameMaster
	PhaseBuilder
	PhaseOwner
)
const Admin CommandPrivileges = 0

No bits. This means only people who can bypass privilege checks can use this command.

type Creature

type Creature struct {
	*update.ValuesBlock
	ID            string
	MovementBlock *update.MovementBlock
}

func (*Creature) DisplayID

func (c *Creature) DisplayID() uint32

func (*Creature) Entry

func (c *Creature) Entry() uint32

func (*Creature) GUID

func (c *Creature) GUID() guid.GUID

func (*Creature) GetPowerType

func (c *Creature) GetPowerType() uint8

func (*Creature) Health

func (c *Creature) Health() uint32

func (*Creature) MaxHealth

func (c *Creature) MaxHealth() uint32

func (*Creature) MaxPower

func (c *Creature) MaxPower() uint32

func (*Creature) Movement

func (c *Creature) Movement() *update.MovementBlock

func (*Creature) Power

func (c *Creature) Power() uint32

func (*Creature) TypeID

func (c *Creature) TypeID() guid.TypeID

func (*Creature) Values

func (c *Creature) Values() *update.ValuesBlock

type EventType

type EventType int
const (
	AreaTriggerEvent EventType = iota
	GossipEvent
	ChatEvent
)

type GameObject

type GameObject struct {
	Position update.Position
	*update.ValuesBlock
}

func (*GameObject) Entry

func (gobj *GameObject) Entry() uint32

func (*GameObject) GUID

func (g *GameObject) GUID() guid.GUID

func (*GameObject) GameObjectType

func (gobj *GameObject) GameObjectType() uint32

func (*GameObject) Living

func (g *GameObject) Living() bool

func (*GameObject) Movement

func (gobj *GameObject) Movement() *update.MovementBlock

func (*GameObject) SetPosition

func (g *GameObject) SetPosition(pos update.Position)

func (*GameObject) SetRotation

func (g *GameObject) SetRotation(orientation, rot0, rot1, rot2, rot3 float32)

func (*GameObject) Speeds

func (g *GameObject) Speeds() update.Speeds

func (*GameObject) TypeID

func (g *GameObject) TypeID() guid.TypeID

func (*GameObject) Values

func (g *GameObject) Values() *update.ValuesBlock

type Group

type Group struct {
	sync.Mutex
	GroupType     uint8
	Server        *Server
	Leader        guid.GUID
	Members       []guid.GUID
	LootMethod    uint8
	LootThreshold uint8
}

func (*Group) Add

func (g *Group) Add(session *Session)

func (*Group) Disband

func (g *Group) Disband()

func (*Group) Empty

func (g *Group) Empty() bool

func (*Group) RemoveMember

func (g *Group) RemoveMember(id guid.GUID)

func (*Group) SetLeader

func (g *Group) SetLeader(id guid.GUID)

func (*Group) UpdateList

func (g *Group) UpdateList()

type Handlers

type Handlers struct {
	Map map[p.WorldType]*WorldClientHandler
}

func (*Handlers) On

func (h *Handlers) On(pt p.WorldType, requiredState SessionState, function interface{}, options ...Option)

type InstanceScripting

type InstanceScripting interface {
	AddCreature(id string, mapID uint32, x, y, z, o float32)
}

type InventoryHeap

type InventoryHeap []wdb.Inventory

this code collates the inventory slots based on order in the inventory

func (InventoryHeap) Len

func (ih InventoryHeap) Len() int

func (InventoryHeap) Less

func (ih InventoryHeap) Less(i, j int) bool

func (InventoryHeap) Swap

func (ih InventoryHeap) Swap(i, j int)

type Item

type Item struct {
	ItemID string
	*update.ValuesBlock
}

func (*Item) BagEmpty

func (i *Item) BagEmpty() bool

func (*Item) ContainerNumSlots

func (i *Item) ContainerNumSlots() uint32

func (*Item) Entry

func (i *Item) Entry() uint32

func (*Item) GUID

func (i *Item) GUID() guid.GUID

func (*Item) ID

func (i *Item) ID() uint64

func (*Item) IsBag

func (i *Item) IsBag() bool

func (*Item) PropertySeed

func (i *Item) PropertySeed() uint32

func (*Item) RandomPropertiesID

func (i *Item) RandomPropertiesID() uint32

func (*Item) StackCount

func (i *Item) StackCount() uint32

func (*Item) TypeID

func (i *Item) TypeID() guid.TypeID

func (*Item) Values

func (i *Item) Values() *update.ValuesBlock

type LoadedPlugin

type LoadedPlugin struct {
	PluginInfo
	Plugin
}

type Map

type Map struct {
	sync.Mutex

	Phase   *Phase
	Objects map[guid.GUID]WorldObject
}

Map describes a single map in the world

func (*Map) AddObject

func (m *Map) AddObject(obj WorldObject) error

func (*Map) Config

func (m *Map) Config() *config.World

func (*Map) GetObject

func (m *Map) GetObject(g guid.GUID) WorldObject

func (*Map) NearObjects

func (m *Map) NearObjects(nearTo WorldObject) WorldObjectSet

func (*Map) NearObjectsLimit

func (m *Map) NearObjectsLimit(nearTo WorldObject, limit float32) WorldObjectSet

func (*Map) NearSet

func (m *Map) NearSet(nearTo WorldObject) SessionSet

NeaSet enumerates a list of players close to (less than or equal to world.maxVisibilityRange) a game object on a map.

func (*Map) NearSetLimit

func (m *Map) NearSetLimit(nearTo WorldObject, limit float32) SessionSet

func (*Map) PlayMusic

func (m *Map) PlayMusic(id uint32)

func (*Map) PlayObjectSound

func (m *Map) PlayObjectSound(id guid.GUID, soundID uint32)

func (*Map) PlaySound

func (m *Map) PlaySound(id uint32)

func (*Map) PropagateChanges

func (m *Map) PropagateChanges(id guid.GUID)

func (*Map) RemoveObject

func (m *Map) RemoveObject(id guid.GUID)

func (*Map) SpawnGameObject

func (m *Map) SpawnGameObject(gobjID string, pos update.Position) error

func (*Map) UpdateSpeed

func (m *Map) UpdateSpeed(g guid.GUID, st update.SpeedType)

func (*Map) VisibilityDistance

func (m *Map) VisibilityDistance() float32

type MapChunkKey

type MapChunkKey struct {
	MapID uint32
	Index terrain.TileChunkLookupIndex
}

type MapChunkValue

type MapChunkValue struct {
	Loaded    time.Time
	ChunkData *terrain.ChunkData
}

type Object

type Object interface {
	GUID() guid.GUID
	TypeID() guid.TypeID
	// Values should return a pointer to underlying data, not a reference to a copy.
	Values() *update.ValuesBlock
}

type Option

type Option func(p.WorldType, []byte, *Options) error

type Options

type Options struct {
	OptionFlags uint32
}

type Phase

type Phase struct {
	sync.Mutex
	Server *Server
	Maps   map[uint32]*Map
}

Phase describes a plane of existence which contains multiple maps.

func (*Phase) AddCreature

func (ph *Phase) AddCreature(id string, mapID uint32, x, y, z, o float32)

func (*Phase) Map

func (ph *Phase) Map(i uint32) *Map

type Plugin

type Plugin interface {
	// For checking whether a plugin is actually operating, i.e. determine if there is a non-fatal error
	Activated() (activated bool, reason error)
	// Gracefully shutdown a plugin. The operation should fully complete before this function returns
	Terminate() error
	// Initialize the plugin's main functionality, and set the metadata
	Init(server *Server, plg *PluginInfo) error
}

type PluginInfo

type PluginInfo struct {
	ID string
	// Display name
	Name       string
	Descriptor string
	Authors    []string
	Version    string
}

type Server

type Server struct {
	Config     *config.World
	DB         *wdb.Core
	PhaseL     sync.Mutex
	Phases     map[string]*Phase
	PlayersL   sync.Mutex
	PlayerList map[string]*Session
	PackLoader *datapack.Loader
	Plugins    []*LoadedPlugin

	CommandHandlers   []Command
	AuthServiceClient sys.AuthServiceClient

	DynamicCounters map[guid.TypeID]uint64
	GuardCounters   sync.Mutex
	StartTime       time.Time
	TerrainMgr
	// Misc data stores
	LevelExperience           wdb.LevelExperience
	PlayerCreateInfo          []wdb.PlayerCreateInfo
	PlayerCreateItems         []wdb.PlayerCreateItem
	PlayerCreateActionButtons []wdb.PlayerCreateActionButton
	PlayerCreateAbilities     []wdb.PlayerCreateAbility
	// contains filtered or unexported fields
}

func (*Server) AllSessions

func (ws *Server) AllSessions() SessionSet

func (*Server) Build

func (ws *Server) Build() vsn.Build

func (*Server) Cmd

func (ws *Server) Cmd(req CommandPrivileges, sig, description string, function interface{})

func (*Server) CreateGameObject

func (ws *Server) CreateGameObject(tpl *wdb.GameObjectTemplate, pos update.Position) *GameObject

func (*Server) ExploreXPRate

func (ws *Server) ExploreXPRate() float32

func (*Server) GetExploreXP

func (ws *Server) GetExploreXP(explorationLevel uint32) uint32

func (*Server) GetFriendStatus

func (ws *Server) GetFriendStatus(id guid.GUID) packet.FriendStatus

func (*Server) GetGUIDByPlayerName

func (s *Server) GetGUIDByPlayerName(playerName string) (guid.GUID, error)

func (*Server) GetNative

func (s *Server) GetNative(race packet.Race, gender uint8) uint32

func (*Server) GetNextLevelXP

func (ws *Server) GetNextLevelXP(forLevel uint32) uint32

func (*Server) GetPlayerNameByGUID

func (ws *Server) GetPlayerNameByGUID(g guid.GUID) (string, error)

func (*Server) GetServerStats

func (ws *Server) GetServerStats() *ServerStats

func (*Server) GetSessionByGUID

func (s *Server) GetSessionByGUID(g guid.GUID) (*Session, error)

func (*Server) GetSessionByPlayerName

func (s *Server) GetSessionByPlayerName(playerName string) (*Session, error)

func (*Server) GetUnitNameByGUID

func (s *Server) GetUnitNameByGUID(g guid.GUID) (string, error)

func (*Server) Handle

func (ws *Server) Handle(c net.Conn)

func (*Server) InitTerrainMgr

func (ws *Server) InitTerrainMgr()

func (*Server) LoadDatapacks

func (ws *Server) LoadDatapacks() error

func (*Server) LoadObjectTemplates

func (ws *Server) LoadObjectTemplates(path string, typeID guid.TypeID, templates interface{}) error

LoadObjectTemplates (item/creature/gameobject templates)

func (*Server) LoadStaticFields

func (ws *Server) LoadStaticFields(path string, items interface{})

func (*Server) LookupMapChunk

func (ws *Server) LookupMapChunk(key MapChunkKey) (*terrain.ChunkData, error)

func (*Server) NewCreature

func (ws *Server) NewCreature(template *wdb.CreatureTemplate, position update.Position) *Creature

func (*Server) NextDynamicCounter

func (ws *Server) NextDynamicCounter(typeID guid.TypeID) uint64

func (*Server) NextGameObjectGUID

func (ws *Server) NextGameObjectGUID() guid.GUID

func (*Server) On

func (ws *Server) On(et EventType, key, handler interface{})

func (*Server) OverrideEventHandler

func (ws *Server) OverrideEventHandler(et EventType, key, handler interface{})

func (*Server) Phase

func (ws *Server) Phase(id string) *Phase

TODO: delete phases when players are not there.

func (*Server) RealmID

func (ws *Server) RealmID() uint64

func (*Server) RemovePlayerFromList

func (ws *Server) RemovePlayerFromList(name string)

func (*Server) ScrubCharacter

func (s *Server) ScrubCharacter(chr guid.GUID)

ScrubCharacter deletes a character PERMANENTLY from a server.

func (*Server) ThinkOn

func (ws *Server) ThinkOn(et EventType, scriptId interface{}, parameters ...interface{}) (shouldStop bool, err error)

Think on a particular scripting event.

func (*Server) UptimeMS

func (ws *Server) UptimeMS() uint32

type ServerStats

type ServerStats struct {
	Allocated      uint64
	TotalAllocated uint64
	SystemMemory   uint64
	NumGCCycles    uint32
	Goroutines     int
	Uptime         time.Duration
}

type Session

type Session struct {
	// Account data
	WS          *Server
	Connection  *packet.Connection
	State       SessionState
	Warden      *warden.Warden
	Tier        sys.Tier
	Locale      i18n.Locale
	Account     uint64
	GameAccount uint64
	SessionKey  []byte
	GuardProps  sync.Mutex
	Props       []wdb.PropID

	AddonData *packet.AddonList
	Char      *wdb.Character

	Inventory map[guid.GUID]*Item

	// In-world data
	CurrentPhase      string
	CurrentMap        uint32
	CurrentArea       uint32
	CurrentChunkIndex *terrain.TileChunkLookupIndex
	ZoneID            uint32

	// currently tracked objects
	GuardTrackedGUIDs sync.Mutex
	TrackedGUIDs      []guid.GUID

	*update.ValuesBlock

	MoveSpeeds   update.Speeds
	MovementInfo *update.MovementInfo

	LocationUpdateTimer *time.Ticker
	KillTimers          chan bool

	// Social
	Group       *Group
	GroupInvite guid.GUID
	// contains filtered or unexported fields
}

func (*Session) AddExperience

func (s *Session) AddExperience(newXP uint32)

func (*Session) AddItem

func (s *Session) AddItem(itemID string, count int, received, created bool) error

May fail. run s.VerifyAvailableSpaceFor(itemID) before executing

func (*Session) AddMoney

func (s *Session) AddMoney(money econ.Money)

func (*Session) AddProp

func (s *Session) AddProp(id wdb.PropID)

func (*Session) AddTrackedGUID

func (s *Session) AddTrackedGUID(g guid.GUID)

func (*Session) Alertf

func (s *Session) Alertf(format string, args ...interface{})

func (*Session) Annf

func (s *Session) Annf(data string, args ...interface{})

prints something in green text with [SERVER] prepended for use in global announcements

func (*Session) BindpointUpdate

func (s *Session) BindpointUpdate()

func (*Session) BroadcastStatus

func (s *Session) BroadcastStatus(status packet.FriendStatus)

func (*Session) Build

func (s *Session) Build() vsn.Build

func (*Session) CanSpeak

func (s *Session) CanSpeak() bool

func (*Session) ChangeDefaultSpeeds

func (s *Session) ChangeDefaultSpeeds(modifier float32)

func (*Session) Cleanup

func (s *Session) Cleanup()

func (*Session) CleanupPlayer

func (s *Session) CleanupPlayer()

func (*Session) ColorPrintf

func (s *Session) ColorPrintf(color string, data string, args ...interface{})

func (*Session) Config

func (s *Session) Config() *config.World

func (*Session) CreateCharacter

func (s *Session) CreateCharacter(e *etc.Buffer)

func (*Session) DB

func (s *Session) DB() *wdb.Core

func (*Session) DebugGUID

func (s *Session) DebugGUID(dbg guid.GUID) string

func (*Session) DeleteCharacter

func (s *Session) DeleteCharacter(b []byte)

func (*Session) EquippableIn

func (s *Session) EquippableIn(it *Item, slot uint8) bool

func (*Session) FailCheck

func (s *Session) FailCheck()

func (*Session) GUID

func (s *Session) GUID() guid.GUID

func (*Session) GetActiveSpec

func (s *Session) GetActiveSpec() uint8

func (*Session) GetBagItem

func (s *Session) GetBagItem(bag uint8) *Item

func (*Session) GetContact

func (s *Session) GetContact(friend guid.GUID) *wdb.Contact

func (*Session) GetFreeTalentPoints

func (s *Session) GetFreeTalentPoints() uint32

func (*Session) GetGameObjectTemplateByEntry

func (s *Session) GetGameObjectTemplateByEntry(entry uint32) *wdb.GameObjectTemplate

func (*Session) GetInventoryHeap

func (s *Session) GetInventoryHeap() InventoryHeap

func (*Session) GetItemByPos

func (s *Session) GetItemByPos(bag, slot uint8) (*wdb.Inventory, *Item)

func (*Session) GetItemTemplate

func (s *Session) GetItemTemplate(it wdb.Item) *wdb.ItemTemplate

func (*Session) GetItemTemplateByEntry

func (s *Session) GetItemTemplateByEntry(entry uint32) *wdb.ItemTemplate

func (*Session) GetLevel

func (s *Session) GetLevel() int

func (*Session) GetLoc

func (s *Session) GetLoc(str string) string

func (*Session) GetMaxLevel

func (s *Session) GetMaxLevel() int

func (*Session) GetNextLevelXP

func (s *Session) GetNextLevelXP() uint32

func (*Session) GetPlayerClass

func (s *Session) GetPlayerClass() packet.Class

func (*Session) GetPlayerRace

func (s *Session) GetPlayerRace() packet.Race

func (*Session) GetPowerType

func (s *Session) GetPowerType() uint8

func (*Session) GetSpecsCount

func (s *Session) GetSpecsCount() uint8

func (*Session) GetTarget

func (s *Session) GetTarget() guid.GUID

func (*Session) GetValidGossipObject

func (s *Session) GetValidGossipObject(id guid.GUID) (WorldObject, string)

func (*Session) Handle

func (s *Session) Handle()

func (*Session) HandleAccountDataUpdate

func (s *Session) HandleAccountDataUpdate(data []byte)

func (*Session) HandleAreaTrigger

func (s *Session) HandleAreaTrigger(e *etc.Buffer)

func (*Session) HandleAutoEquipItem

func (s *Session) HandleAutoEquipItem(e *etc.Buffer)

func (*Session) HandleChat

func (s *Session) HandleChat(b []byte)

func (*Session) HandleCheck

func (s *Session) HandleCheck(data *etc.Buffer)

func (*Session) HandleCommand

func (s *Session) HandleCommand(c string)

func (*Session) HandleCreatureQuery

func (s *Session) HandleCreatureQuery(e *etc.Buffer)

func (*Session) HandleDestroyItem

func (s *Session) HandleDestroyItem(e *etc.Buffer)

func (*Session) HandleEmoteCommand

func (s *Session) HandleEmoteCommand(emoteID uint32)

func (*Session) HandleFriendAdd

func (s *Session) HandleFriendAdd(e *etc.Buffer)

func (*Session) HandleFriendDelete

func (s *Session) HandleFriendDelete(e *etc.Buffer)

func (*Session) HandleFriendListRequest

func (s *Session) HandleFriendListRequest()

func (*Session) HandleGameObjectQuery

func (s *Session) HandleGameObjectQuery(e *etc.Buffer)

func (*Session) HandleGameObjectUse

func (s *Session) HandleGameObjectUse(e *etc.Buffer)

func (*Session) HandleGossipHello

func (s *Session) HandleGossipHello(gguid *etc.Buffer)

func (*Session) HandleGossipSelectOption

func (s *Session) HandleGossipSelectOption(e *etc.Buffer)

func (*Session) HandleGossipTextQuery

func (s *Session) HandleGossipTextQuery(e *etc.Buffer)

func (*Session) HandleGroupAccept

func (s *Session) HandleGroupAccept()

func (*Session) HandleGroupDecline

func (s *Session) HandleGroupDecline()

func (*Session) HandleGroupDisband

func (s *Session) HandleGroupDisband()

func (*Session) HandleGroupInvite

func (s *Session) HandleGroupInvite(e *etc.Buffer)

func (*Session) HandleHashResult

func (s *Session) HandleHashResult(data *etc.Buffer)

func (*Session) HandleIgnoreAdd

func (s *Session) HandleIgnoreAdd(e *etc.Buffer)

func (*Session) HandleIgnoreDelete

func (s *Session) HandleIgnoreDelete(e *etc.Buffer)

func (*Session) HandleItemQuery

func (s *Session) HandleItemQuery(e *etc.Buffer)

func (*Session) HandleJoin

func (s *Session) HandleJoin(e *etc.Buffer)

func (*Session) HandleLogoutRequest

func (s *Session) HandleLogoutRequest(b []byte)

func (*Session) HandleMoves

func (s *Session) HandleMoves(t packet.WorldType, b []byte)

func (*Session) HandleNameQuery

func (s *Session) HandleNameQuery(e *etc.Buffer)

func (*Session) HandlePartyMessage

func (s *Session) HandlePartyMessage(party *chat.Message)

func (*Session) HandlePong

func (s *Session) HandlePong(e *etc.Buffer)

func (*Session) HandleQuestgiverStatusQuery

func (s *Session) HandleQuestgiverStatusQuery(e *etc.Buffer)

func (*Session) HandleRealmSplit

func (s *Session) HandleRealmSplit(split *etc.Buffer)

func (*Session) HandleRequestCharacterList

func (s *Session) HandleRequestCharacterList()

func (*Session) HandleRequestPartyMemberStats

func (s *Session) HandleRequestPartyMemberStats(e *etc.Buffer)

func (*Session) HandleSay

func (s *Session) HandleSay(say *chat.Message)

func (*Session) HandleSetActionButton

func (s *Session) HandleSetActionButton(e *etc.Buffer)

func (*Session) HandleSetWeaponMode

func (s *Session) HandleSetWeaponMode(e *etc.Buffer)

func (*Session) HandleSheathe

func (s *Session) HandleSheathe(e *etc.Buffer)

func (*Session) HandleSocialListRequest

func (s *Session) HandleSocialListRequest()

func (*Session) HandleSplitItem

func (s *Session) HandleSplitItem(e *etc.Buffer)

func (*Session) HandleStandStateChange

func (s *Session) HandleStandStateChange(e *etc.Buffer)

func (*Session) HandleSummonResponse

func (c *Session) HandleSummonResponse(e *etc.Buffer)

func (*Session) HandleSwapInventoryItem

func (s *Session) HandleSwapInventoryItem(e *etc.Buffer)

func (*Session) HandleSwapItem

func (s *Session) HandleSwapItem(e *etc.Buffer)

func (*Session) HandleTarget

func (s *Session) HandleTarget(e *etc.Buffer)

func (*Session) HandleTextEmote

func (s *Session) HandleTextEmote(e *etc.Buffer)

func (*Session) HandleUITimeRequest

func (s *Session) HandleUITimeRequest()

func (*Session) HandleUpdateMovement

func (s *Session) HandleUpdateMovement(minfo *update.MovementInfo)

func (*Session) HandleWhisper

func (s *Session) HandleWhisper(whisper *chat.Message)

func (*Session) HandleWho

func (s *Session) HandleWho(b []byte)

func (*Session) HandleWorldTeleport

func (s *Session) HandleWorldTeleport(e *etc.Buffer)

func (*Session) HandleWorldportAck

func (s *Session) HandleWorldportAck(b []byte)

func (*Session) HandleZoneExperience

func (s *Session) HandleZoneExperience(zoneID uint32)

func (*Session) HandleZoneUpdate

func (s *Session) HandleZoneUpdate(e *etc.Buffer)

func (*Session) HasItem

func (s *Session) HasItem(entry string) bool

func (*Session) HasProp

func (s *Session) HasProp(id wdb.PropID) bool

func (*Session) HasYouIgnored

func (s *Session) HasYouIgnored(g guid.GUID) bool

func (*Session) Health

func (s *Session) Health() uint32

func (*Session) Init

func (session *Session) Init()

func (*Session) InitGroup

func (s *Session) InitGroup()

func (*Session) InitInventoryManager

func (s *Session) InitInventoryManager()

func (*Session) InitWarden

func (s *Session) InitWarden()

func (*Session) InitializeModule

func (s *Session) InitializeModule()

func (*Session) IsAdmin

func (s *Session) IsAdmin() bool

func (*Session) IsAlive

func (s *Session) IsAlive() bool

func (*Session) IsEnemy

func (s *Session) IsEnemy(wo WorldObject) bool

func (*Session) IsEquipmentPos

func (s *Session) IsEquipmentPos(bag, slot uint8) bool

func (*Session) IsGM

func (s *Session) IsGM() bool

func (*Session) IsIgnoring

func (s *Session) IsIgnoring(player guid.GUID) bool

func (*Session) IsValidPos

func (s *Session) IsValidPos(bag, slot uint8) bool

func (*Session) LeaveGroup

func (s *Session) LeaveGroup()

func (*Session) LevelUp

func (s *Session) LevelUp(to uint32)

func (*Session) MOTD

func (s *Session) MOTD(fstr string, args ...interface{})

func (*Session) Map

func (s *Session) Map() *Map

func (*Session) MaxHealth

func (s *Session) MaxHealth() uint32

func (*Session) MaxMoney

func (s *Session) MaxMoney() econ.Money

func (*Session) MaxPositiveAuras

func (s *Session) MaxPositiveAuras() int

func (*Session) MaxPower

func (s *Session) MaxPower() uint32

func (*Session) Movement

func (s *Session) Movement() *update.MovementBlock

func (*Session) NewItem

func (s *Session) NewItem(it wdb.Item) *Item

func (*Session) NoSuchPlayer

func (s *Session) NoSuchPlayer(playerName string)

func (*Session) NumActionButtons

func (s *Session) NumActionButtons() int

func (*Session) Pet

func (s *Session) Pet() *Creature

func (*Session) PhaseTeleportTo

func (c *Session) PhaseTeleportTo(phaseID string, mapID uint32, pos update.Position)

func (*Session) PlayerID

func (s *Session) PlayerID() uint64

func (*Session) PlayerName

func (s *Session) PlayerName() string

func (*Session) Position

func (s *Session) Position() update.Position

func (*Session) Power

func (s *Session) Power() uint32

func (*Session) QuestDone

func (s *Session) QuestDone(q uint32) bool

func (*Session) ReadCrypt

func (s *Session) ReadCrypt() (packet.WorldType, []byte, error)

func (*Session) RemoveProp

func (s *Session) RemoveProp(id wdb.PropID)

func (*Session) RemoveTrackedGUID

func (s *Session) RemoveTrackedGUID(g guid.GUID)

func (*Session) RequestData

func (s *Session) RequestData()

Naive warden server

func (*Session) RequestHash

func (s *Session) RequestHash()

func (*Session) SendAccountDataTimes

func (s *Session) SendAccountDataTimes()

func (*Session) SendActionButtons

func (s *Session) SendActionButtons()

func (*Session) SendAlertText

func (s *Session) SendAlertText(data string)

func (*Session) SendAllAcheivementData

func (s *Session) SendAllAcheivementData()

func (*Session) SendAreaAll

func (s *Session) SendAreaAll(p *packet.WorldPacket)

func (*Session) SendAsync

func (s *Session) SendAsync(p *packet.WorldPacket)

todo: make more consistent

func (*Session) SendAuthWaitQueue

func (s *Session) SendAuthWaitQueue(position uint32)

func (*Session) SendBagUpdate

func (s *Session) SendBagUpdate(bag uint8)

func (*Session) SendCharacterOp

func (s *Session) SendCharacterOp(opcode packet.CharacterOp)

func (*Session) SendChat

func (s *Session) SendChat(ch *chat.Message)

func (*Session) SendChatPlayerIsEnemy

func (s *Session) SendChatPlayerIsEnemy(name string)

func (*Session) SendChatPlayerIsIgnoringYou

func (s *Session) SendChatPlayerIsIgnoringYou(name string)

func (*Session) SendChatPlayerNotFound

func (s *Session) SendChatPlayerNotFound(name string)

func (*Session) SendDanceMoves

func (s *Session) SendDanceMoves()

func (*Session) SendEquipError

func (s *Session) SendEquipError(ir packet.InventoryResult, src, dest *Item)

func (*Session) SendEquipmentSetList

func (s *Session) SendEquipmentSetList()

func (*Session) SendExplorationXP

func (s *Session) SendExplorationXP(zoneID, exp uint32)

func (*Session) SendFactions

func (s *Session) SendFactions()

func (*Session) SendFriendList

func (s *Session) SendFriendList()

func (*Session) SendFriendStatus

func (s *Session) SendFriendStatus(result uint8, id guid.GUID, note string, status packet.FriendStatus, area, level, class uint32)

func (*Session) SendGossip

func (s *Session) SendGossip(gossip *packet.Gossip)

func (*Session) SendGroupDestroyed

func (s *Session) SendGroupDestroyed()

func (*Session) SendGroupInvite

func (s *Session) SendGroupInvite(from string)

func (*Session) SendGroupList

func (s *Session) SendGroupList()

func (*Session) SendIgnoreList

func (s *Session) SendIgnoreList()

func (*Session) SendInitWorldStates

func (s *Session) SendInitWorldStates()

func (*Session) SendItemUpdate

func (s *Session) SendItemUpdate(it *Item)

func (*Session) SendLoginFailure

func (s *Session) SendLoginFailure(failure packet.CharLoginResult)

func (*Session) SendLoginSpell

func (s *Session) SendLoginSpell()

func (*Session) SendMetadataAfterSpawn

func (s *Session) SendMetadataAfterSpawn()

func (*Session) SendNameQueryResponseFor

func (s *Session) SendNameQueryResponseFor(char *wdb.Character)

func (*Session) SendNewItem

func (s *Session) SendNewItem(item *Item, received, created, showInChat bool, bag, slot uint8, count uint32)

func (*Session) SendNewWorld

func (s *Session) SendNewWorld(mapID uint32, pos update.Position)

func (*Session) SendObjectChanges

func (s *Session) SendObjectChanges(viewMask update.VisibilityFlags, object Object)

func (*Session) SendObjectCreate

func (s *Session) SendObjectCreate(objects ...Object)

Send spawn packets for 1+ objects. This function is optimized to fit as many Create/Spawn blocks into one compressed packet as possible.

func (*Session) SendObjectDelete

func (s *Session) SendObjectDelete(g guid.GUID)

func (*Session) SendPartyMemberStats

func (s *Session) SendPartyMemberStats(mask uint32, player *Session)

func (*Session) SendPartyResult

func (s *Session) SendPartyResult(operation packet.PartyOperation, memberName string, result packet.PartyResult)

func (*Session) SendPet

func (s *Session) SendPet(b []byte)

func (*Session) SendPlayMusic

func (s *Session) SendPlayMusic(id uint32)

func (*Session) SendPlayObjectSound

func (s *Session) SendPlayObjectSound(id guid.GUID, soundID uint32)

func (*Session) SendPlaySound

func (s *Session) SendPlaySound(id uint32)

func (*Session) SendPlayerTalentsInfoData

func (s *Session) SendPlayerTalentsInfoData()

func (*Session) SendQuestGiverStatus

func (s *Session) SendQuestGiverStatus(id guid.GUID, dialogStatus uint8)

func (*Session) SendRawUpdateObjectData

func (s *Session) SendRawUpdateObjectData(encoded []byte, forceCompression int)

func (*Session) SendReputations

func (s *Session) SendReputations()

func (*Session) SendRequiredItemZoneError

func (s *Session) SendRequiredItemZoneError(itemID string)

func (*Session) SendRequiredLevelZoneError

func (s *Session) SendRequiredLevelZoneError(lvl int)

func (*Session) SendRequiredQuestZoneError

func (s *Session) SendRequiredQuestZoneError(questEntry uint32)

func (*Session) SendRestStart

func (s *Session) SendRestStart()

func (*Session) SendSessionMetadata

func (s *Session) SendSessionMetadata()

func (*Session) SendSetLeader

func (s *Session) SendSetLeader(leaderName string)

func (*Session) SendSocialList

func (s *Session) SendSocialList()

Starting in protocol 8606, the friends list and the ignore list are merged into a single packet.

func (*Session) SendSpellList

func (s *Session) SendSpellList()

func (*Session) SendSummonRequest

func (s *Session) SendSummonRequest(summoner guid.GUID, zoneID uint32, timeout time.Duration)

func (*Session) SendSync

func (s *Session) SendSync(p *packet.WorldPacket) error

func (*Session) SendSystemFeatures

func (s *Session) SendSystemFeatures()

func (*Session) SendTeleportAck

func (s *Session) SendTeleportAck(g guid.GUID, mapID uint32, pos update.Position)

func (*Session) SendTransferPending

func (s *Session) SendTransferPending(mapID uint32)

func (*Session) SendTutorialFlags

func (s *Session) SendTutorialFlags()

func (*Session) SendUnlearnSpell

func (s *Session) SendUnlearnSpell()

func (*Session) SendVerifyLoginPacket

func (s *Session) SendVerifyLoginPacket()

func (*Session) SendWorldLoginMetadata

func (s *Session) SendWorldLoginMetadata()

func (*Session) SetBagGUIDSlot

func (s *Session) SetBagGUIDSlot(bag, slot uint8, g guid.GUID)

func (*Session) SetCurrentXP

func (s *Session) SetCurrentXP(current uint32)

func (*Session) SetExplorationFlag

func (s *Session) SetExplorationFlag(exploreFlag uint32)

func (*Session) SetFly

func (s *Session) SetFly(on bool)

func (*Session) SetStandState

func (s *Session) SetStandState(value uint8)

func (*Session) SetSummonLocation

func (s *Session) SetSummonLocation(phase string, mapID uint32, pos update.Position)

func (*Session) SetTimeSpeed

func (s *Session) SetTimeSpeed()

func (*Session) SetVisibleItemEntry

func (s *Session) SetVisibleItemEntry(index int, entry uint32)

func (*Session) SetupOnLogin

func (s *Session) SetupOnLogin()

func (*Session) SitChair

func (s *Session) SitChair(chair *GameObject)

func (*Session) SpawnPlayer

func (s *Session) SpawnPlayer()

SpawnPlayer initializes the player into the object manager and sends the packets needed to log the client into the world.

func (*Session) Speeds

func (s *Session) Speeds() update.Speeds

func (*Session) SwapItem

func (s *Session) SwapItem(srcBag, srcSlot, dstBag, dstSlot uint8)

func (*Session) SyncSpeeds

func (s *Session) SyncSpeeds()

func (*Session) SyncTime

func (s *Session) SyncTime()

func (*Session) Sysf

func (s *Session) Sysf(data string, args ...interface{})

func (*Session) SystemChat

func (s *Session) SystemChat(data string)

func (*Session) Tag

func (s *Session) Tag() uint8

func (*Session) Team

func (s *Session) Team() uint32

func (*Session) Teleport

func (s *Session) Teleport(mapID uint32, x, y, z, o float32)

func (*Session) TeleportTo

func (s *Session) TeleportTo(mapID uint32, newPos update.Position)

TeleportTo teleports a player to a new location. This function should be called carefully.

func (*Session) TransferWardenModule

func (s *Session) TransferWardenModule()

func (*Session) TypeID

func (s *Session) TypeID() guid.TypeID

func (*Session) UpdateArea

func (s *Session) UpdateArea()

func (*Session) UpdateCameraPosition

func (s *Session) UpdateCameraPosition(syncSelf bool, pos update.Position)

func (*Session) UpdatePlayer

func (s *Session) UpdatePlayer()

Broadcast changes to nearby players

func (*Session) UpdatePosition

func (s *Session) UpdatePosition(pos update.Position)

func (*Session) UpdateSelf

func (s *Session) UpdateSelf()

Send updated fields directly to client. Use for setting private fields.

func (*Session) UpdateWarden

func (s *Session) UpdateWarden()

func (*Session) ValidateZoneWithPosition

func (s *Session) ValidateZoneWithPosition(zoneID uint32) bool

important todo: verify zone ID against geometric bounds of area: Just a dummy function until ADT parsing is available

func (*Session) Values

func (s *Session) Values() *update.ValuesBlock

func (*Session) VehicleSeatID

func (s *Session) VehicleSeatID() uint32

func (*Session) WardenResponse

func (s *Session) WardenResponse(data []byte)

func (*Session) Warnf

func (s *Session) Warnf(data string, args ...interface{})

func (*Session) ZoneExplored

func (s *Session) ZoneExplored(zoneID uint32) bool

type SessionSet

type SessionSet []*Session

func (SessionSet) Iter

func (s SessionSet) Iter(iterFunc func(*Session))

func (SessionSet) Send

func (s SessionSet) Send(p *packet.WorldPacket)

type SessionState

type SessionState uint8
const (
	CharacterSelectMenu SessionState = iota
	InWorld
)

type SpeedOpcodePair

type SpeedOpcodePair struct {
	Force  packet.WorldType
	Spline packet.WorldType
}

type SpellMgr

type SpellMgr struct {
}

type TerrainMgr

type TerrainMgr struct {
	Chunks *sync.Map
}

type WorldClientHandler

type WorldClientHandler struct {
	Op            p.WorldType
	RequiredState SessionState
	Fn            interface{}
	Options       []Option
}

type WorldObject

type WorldObject interface {
	Object
	// movement data
	Movement() *update.MovementBlock
}

Objects that have a presence in the world in a specific location (players, creatures)

type WorldObjectSet

type WorldObjectSet []WorldObject

func (WorldObjectSet) Iter

func (wos WorldObjectSet) Iter(iterFunc func(WorldObject))

Directories

Path Synopsis
plugins
Package wdb contains the Worldserver databases.
Package wdb contains the Worldserver databases.
Package worldserver is the main ent
Package worldserver is the main ent

Jump to

Keyboard shortcuts

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