realm

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: 68 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelpColor = "FF50c41a"
	DemoColor = "FF99CCFF"
)
View Source
const (
	Mana = iota
	Rage
	Focus
	Energy
	Happiness
)
View Source
const (
	UseCompressionSmartly int = iota
	ForceCompressionOff
	ForceCompressionOn
)
View Source
const LogoutRequestPtag = "Gophercraft/core/realm/login#logging out"
View Source
const MovementManagerTag = "Gophercraft/core/realm/movement_mgr"
View Source
const NullProp models.PropID = ""
View Source
const ObjectDebug models.PropID = "gophercraft.realm.ObjectDebug"
View Source
const (
	OptionFlagAsync = 1 << iota
)
View Source
const PacketPipePid = "Gophercraft/core/realm/handshake.drainPacketPipe"
View Source
const (
	ProcKilled = 1 << iota
)
View Source
const (
	SpellMgrPtag = "Gophercraft/core/realm/spell_manager"
)

Variables

View Source
var (
	DefaultProps = map[models.PropID]string{
		ObjectDebug: "true",
	}
)
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, _ = models.ParseMoneyShort("9999999g99s99c")
)

Functions

func AuraEffectModResistance

func AuraEffectModResistance(sed *SpellEffectData, target Unit, au *Aura)

func EffectApplyAura

func EffectApplyAura(dat *SpellEffectData)

Applies the effect of an aura.

func IsUnit

func IsUnit(wo WorldObject) bool

func OptionAsync

func OptionAsync(wp *p.WorldPacket, opts *Options) error

func RegisterPlugin

func RegisterPlugin(name string, plugin Plugin)

func Start

func Start(opts *config.World) error

Types

type Aura

type Aura struct {
	ID           uint32
	Flag         update.AuraFlags
	Level        uint32
	Applications uint32
	Caster       guid.GUID
	ModEffects   []*ModEffect
	AppliedTime  time.Time
	ExpiryTime   time.Time
	ExpiryTimer  *time.Timer
}

func (*Aura) Duration

func (au *Aura) Duration() time.Duration

type AuraApplication

type AuraApplication struct {
	CastTime     time.Time
	ID           uint32
	Level        int32
	Caster       Unit
	Applications uint32
}

type AuraEffect

type AuraEffect func(sed *SpellEffectData, target Unit, au *Aura)

type AuraEffectData

type AuraEffectData struct {
}

type AuraState

type AuraState struct {
	Protect      sync.Mutex
	BaseStats    map[models.ModStat]float64
	AppliedStats map[models.ModStat]float64
	Auras        []*Aura
	AuraExpire   chan *Aura
}

Aura state holds both base and real stats. From this data, the update fields are set. Update fields are not used as a direct storage for these stats.

type ChatHistory

type ChatHistory struct {
	RecentMessage []*chat.ClientMessage
	// Simili
	SimilitaryToPrevious float32 // must be in range 0.0 - 1.0
}

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 rpcnet.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 {
	ID            string
	Map           *Map
	Group         *SpawnGroupInstance
	MovementBlock *update.MovementBlock

	*update.ValuesBlock
	// contains filtered or unexported fields
}

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 (
	// Triggered when a session is created.
	SessionCreateEvent EventType = iota
	SessionDestroyEvent
	AreaTriggerEvent
	ChatEvent
	GossipEvent
)

type FactionTeam

type FactionTeam struct {
	Template *dbdefs.Ent_FactionTemplate
	Faction  *dbdefs.Ent_Faction
}

func (*FactionTeam) ID

func (f *FactionTeam) ID() string

type FilterFunc

type FilterFunc func(wo WorldObject) bool

func WithoutGUID

func WithoutGUID(g guid.GUID) FilterFunc

type GameMode

type GameMode models.GameMode

type GameObject

type GameObject struct {
	ID       string
	Map      *Map
	Group    *SpawnGroupInstance
	Position tempest.C4Vector
	*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) SetOrientation

func (g *GameObject) SetOrientation(orientation float32)

func (*GameObject) SetPosition

func (g *GameObject) SetPosition(build vsn.Build, pos tempest.C4Vector)

func (*GameObject) SetRotation

func (g *GameObject) SetRotation(rot tempest.C4Quaternion)

func (*GameObject) Speeds

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

func (*GameObject) String

func (g *GameObject) String() string

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     party.GroupType
	Server        *Server
	Leader        guid.GUID
	Members       []guid.GUID
	LootMethod    party.LootMethod
	LootThreshold models.ItemQuality
}

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 Instance

type Instance struct {
	InstanceType

	Name i18n.Text
}

type InstanceType

type InstanceType uint32

type InventoryManager

type InventoryManager struct {
}

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

	ID uint32

	// If true, no part of the map is cut off from visibility.
	ShowEverywhere bool
	Phase          *Phase
	// contains filtered or unexported fields
}

Map describes a world map. Map is meant to be used asynchronously. Map has its a goroutine with which it can emplace/remove world objects, and query them repeatedly this way we can avoid race conditions.

func (*Map) AddObject

func (m *Map) AddObject(newObject ...WorldObject) error

func (*Map) AddObjects

func (m *Map) AddObjects(objects WorldObjectSet) error

func (*Map) AllObjects

func (m *Map) AllObjects() WorldObjectSet

func (*Map) ApplyAura

func (m *Map) ApplyAura(target Unit, aa *AuraApplication) error

func (*Map) CanFight

func (m *Map) CanFight(u1, u2 TeamPlayer) bool

func (*Map) CanSee

func (m *Map) CanSee(eye WorldObject, object WorldObject, vis float32) bool

func (*Map) Config

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

func (*Map) DebugMapInfo

func (m *Map) DebugMapInfo(s *Session)

func (*Map) Definition

func (m *Map) Definition() *dbdefs.Ent_Map

func (*Map) GetObject

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

func (*Map) GetObjectsInRange

func (m *Map) GetObjectsInRange(vrange tempest.CAaSphere) WorldObjectSet

func (*Map) GetObjectsNearPosition

func (m *Map) GetObjectsNearPosition(pos tempest.C3Vector) WorldObjectSet

func (*Map) GoCast

func (m *Map) GoCast(cc *spell.Cast, caster Unit) error

func (*Map) HealAll

func (m *Map) HealAll(target Unit) error

Heals all wounds

func (*Map) Hostile

func (m *Map) Hostile(u1, u2 TeamPlayer) bool

func (*Map) LookupSpellInfo

func (m *Map) LookupSpellInfo(id uint32, spelldata **dbdefs.Ent_Spell, spellvisual **dbdefs.Ent_SpellVisual, casttimes **dbdefs.Ent_SpellCastTimes)

func (*Map) ObjectIsPlayer

func (m *Map) ObjectIsPlayer(player WorldObject) bool

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) PlaySpellVisual

func (m *Map) PlaySpellVisual(unit Unit, visualKit uint32)

func (*Map) PlaySpellVisualKind

func (m *Map) PlaySpellVisualKind(unit Unit, spellID uint32, class models.VisualClass)

func (*Map) PropagateChanges

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

func (*Map) PropagateObjectChanges

func (m *Map) PropagateObjectChanges(o WorldObject)

func (*Map) RefreshStats

func (m *Map) RefreshStats(unit Unit) error

func (*Map) RemoveObject

func (m *Map) RemoveObject(object ...guid.GUID) error

func (*Map) RemoveObjects

func (m *Map) RemoveObjects(objects []guid.GUID) error

func (*Map) Resurrect

func (m *Map) Resurrect(theDead Unit, health uint32) error

Resurrect only

func (*Map) Revive

func (m *Map) Revive(target Unit) error

Resurrect + heal

func (*Map) SpawnGameObject

func (m *Map) SpawnGameObject(gobjID string, pos tempest.C4Vector) error

func (*Map) StartCast

func (m *Map) StartCast(cc *spell.Cast, caster Unit) (castTime time.Duration, err error)

func (*Map) SyncAuraState

func (m *Map) SyncAuraState(unit Unit) error

func (*Map) Unaura

func (m *Map) Unaura(target Unit, id uint32, count int32, visuals bool) error

removes a finite or infinite amount of aura applications. if you are interested, show visuals for the

func (*Map) UnitIsAlive

func (m *Map) UnitIsAlive(target Unit) bool

func (*Map) UnitIsDead

func (m *Map) UnitIsDead(target Unit) bool

func (*Map) UpdateMapPosition

func (m *Map) UpdateMapPosition(object guid.GUID) error

Update an object's position within the Map. This has bearing on how the object is synchronized in relation to others, but does not modify the object's internal position.

func (*Map) UpdateSpeed

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

func (*Map) Vars

func (m *Map) Vars() config.WorldVars

func (*Map) ViewersOf

func (m *Map) ViewersOf(object WorldObject) WorldObjectSet

The inverse of VisibleObjects. Refers to WorldObjects that can see Object

func (*Map) VisibilityDistance

func (m *Map) VisibilityDistance() float32

func (*Map) VisibleObjects

func (m *Map) VisibleObjects(viewer WorldObject) WorldObjectSet

Refers to the objects that nearTo can see.

func (*Map) VisibleObjectsInRange

func (m *Map) VisibleObjectsInRange(viewer WorldObject, radius float32) WorldObjectSet

type MapBlock

type MapBlock struct {
	// contains filtered or unexported fields
}

type ModEffect

type ModEffect struct {
	Op       models.ModOp
	StatMask models.ModStatMask
	Value    float64
}

ModEffect. Stores mods for all the stats in StatMask

type MoveTick

type MoveTick struct {
}

type MovementManager

type MovementManager struct {
	Moves        chan *update.MovementPacket
	LastMove     time.Time
	MoveSpeeds   update.Speeds
	MovementInfo *update.MovementInfo
}

type Notification

type Notification uint8
const (
	NotifyCreate Notification = iota
	NotifyDelete
	NotifyMovement
	NotifyOutOfRange
)

type Object

type Object interface {
	GUID() guid.GUID
	TypeID() guid.TypeID
	// Values() must return a pointer to a values block that can be modified by the server
	Values() *update.ValuesBlock
}

type Option

type Option func(*p.WorldPacket, *Options) error

type Options

type Options struct {
	OptionFlags uint32
}

type Phase

type Phase struct {
	sync.Mutex
	ID     string
	Server *Server
	// contains filtered or unexported fields
}

Phase describes a plane of existence which contains multiple maps. When the list of maps is empty after too long, Phase itself becomes unloaded.

func (*Phase) Map

func (phase *Phase) Map(id uint32) *Map

func (*Phase) SpawnUnit

func (ph *Phase) SpawnUnit(id string, mapID uint32, pos tempest.C4Vector)

type PlayerSession

type PlayerSession struct {
	*update.ValuesBlock
	MovementManager

	Char           *models.Character
	CharacterProps []models.CharacterProp

	GuardInventory sync.Mutex
	Inventory      []models.Inventory
	Items          map[guid.GUID]*Item
	// In-world data
	JoinedWorldAt time.Time
	LevelJoinTime time.Time
	CurrentPhase  string
	CurrentMap    *Map
	CurrentArea   uint32
	// CurrentChunkIndex *terrain.TileChunkLookupIndex
	ZoneID       uint32
	AuraState    AuraState
	SpellManager *SpellManager

	// currently tracked objects
	Camera            Sight
	GuardTrackedGUIDs sync.Mutex
	TrackedGUIDs      []guid.GUID
	Flying            bool

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

func (*PlayerSession) Teams

func (ps *PlayerSession) Teams() []Team

func (*PlayerSession) Values

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

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
	Description string
	Authors     []string
	Version     string
}

type Pos

type Pos struct {
	tempest.C4Vector
	MapID uint32
}

type Process

type Process struct {
	Name          string
	CreationState SessionState
	ProcState     uint8
	Data          interface{}
	Cancel        chan<- bool
}

type ProtocolHandler

type ProtocolHandler struct {
	Op            p.WorldType
	RequiredState SessionState
	Fn            reflect.Value
	Options       []Option
}

type ProtocolHandlers

type ProtocolHandlers map[p.WorldType]*ProtocolHandler

func (ProtocolHandlers) On

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

type Reason

type Reason uint8
const (
	NoReason Reason = iota
	ReasonHelpedUs
	ReasonHurtUs
	ReasonAttackedUs
)

type Relation

type Relation uint8
const (
	NoRelation Relation = 0
	RelationPassive
	RelationFriendly
	RelationDisliked
	RelationHated
)

type Seer

type Seer interface {
	Object

	GetSight() *Sight
}

Used to interface with players

type Server

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

	ProtocolHandlers  ProtocolHandlers
	CommandHandlers   []Command
	HomeServiceClient rpcnet.HomeServiceClient
	WaitQueue         WaitQueue

	DynamicCounters map[guid.TypeID]uint64
	GuardCounters   sync.Mutex
	StartTime       time.Time
	// TerrainMgr
	// Misc data stores
	LevelExperience models.LevelExperience

	SpellEffects []SpellEffect
	AuraEffects  []AuraEffect
	// contains filtered or unexported fields
}

func (*Server) ActivePlayers

func (rs *Server) ActivePlayers() int

func (*Server) AllSessions

func (ws *Server) AllSessions() SessionSet

func (*Server) ApplyStats

func (s *Server) ApplyStats(unit Unit) error

Take a Unit's base stats and apply mods to them, value and movement blocks accordingly

func (*Server) AtCapacity

func (ws *Server) AtCapacity() bool

func (*Server) BoolVar

func (s *Server) BoolVar(vn string) bool

func (*Server) Build

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

func (*Server) Call

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

Call triggers a certain type of event

func (*Server) ClassPowerType

func (s *Server) ClassPowerType(class models.Class) spell.PowerType

func (*Server) Cmd

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

func (*Server) CreateCharacter

func (s *Server) CreateCharacter(playerCharacter *models.Character) character.Result

func (*Server) ExploreXPRate

func (ws *Server) ExploreXPRate() float32

func (*Server) FloatVar

func (s *Server) FloatVar(vn string) float32

func (*Server) GetExploreXP

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

func (*Server) GetFriendStatus

func (ws *Server) GetFriendStatus(id guid.GUID) social.Status

func (*Server) GetGUIDByPlayerName

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

func (*Server) GetNative

func (s *Server) GetNative(race models.Race, bodyType uint8) uint32

Get the native display ID for a race and body type

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) GetSpellAttributes

func (s *Server) GetSpellAttributes(sp *dbdefs.Ent_Spell) (*update.Bitmask, error)

func (*Server) GetSpellData

func (s *Server) GetSpellData(id uint32) *dbdefs.Ent_Spell

func (*Server) GetUnitNameByGUID

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

func (*Server) GetUnitPowerType

func (s *Server) GetUnitPowerType(unit Unit) models.Power

func (*Server) HandleConn

func (server *Server) HandleConn(conn net.Conn)

func (*Server) InitConfig

func (s *Server) InitConfig(cfg *config.World) error

func (*Server) LoadDatapacks

func (ws *Server) LoadDatapacks() error

LoadDatapacks loops through all the text ZIP files owned by this Worldserver, refreshing the server database cache

func (*Server) LoadObjectTemplates

func (ws *Server) LoadObjectTemplates(name string, typeID guid.TypeID, typeOf reflect.Type) error

LoadObjectTemplates (item/creature/gameobject templates) Most pertinent to object templates that are queried by the client, i.e. structs that have an Entry field

func (*Server) LoadPlayerCreateItems

func (ws *Server) LoadPlayerCreateItems() error

func (*Server) LoadServerDB

func (ws *Server) LoadServerDB(name string, typeOf reflect.Type) error

Read game data as a unified source. The BASE data can be supplied by the game itself. DBC edits can be supplied in text format

func (*Server) LoadStaticInfo

func (ws *Server) LoadStaticInfo(name string, typeOf reflect.Type) error

func (*Server) LogoutTime

func (s *Server) LogoutTime() time.Duration

func (*Server) NewCreature

func (ws *Server) NewCreature(template *models.CreatureTemplate, position tempest.C4Vector) *Creature

func (*Server) NewGameObject

func (ws *Server) NewGameObject(tpl *models.GameObjectTemplate, pos tempest.C4Vector) *GameObject

func (*Server) NextDynamicCounter

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

Increments the dynamic conter for typeID and returns the result.

func (*Server) NextGameObjectGUID

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

func (*Server) On

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

func (*Server) Phase

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

func (*Server) PlayerCapacity

func (ws *Server) PlayerCapacity() int

func (*Server) PosVar

func (s *Server) PosVar(vn string) (pos *Pos)

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) SetHandler

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

func (*Server) StringVar

func (s *Server) StringVar(vn string) string

func (*Server) UintVar

func (s *Server) UintVar(vn string) uint64

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
	CacheSize      uint64
}

type Session

type Session struct {
	// Account data
	Server        *Server
	Connection    *packet.Connection
	AuthChallenge *auth.Challenge
	GuardSession  sync.Mutex

	Tier        rpcnet.Tier
	Locale      i18n.Locale
	Account     uint64
	GameAccount uint64
	SessionKey  []byte
	Processes   []*Process
	PacketPipe  chan *packet.WorldPacket
	// In-world Data: better kept as pointer
	// Otherwise we're allocating EVERYTHING when someone opens a socket
	*PlayerSession
	// 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 models.Money)

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) ApplyUpdateMods

func (s *Session) ApplyUpdateMods(viewedObject Object, fields *update.ValuesBlock)

Use this function to send manipulated update field changes, without polluting the main store

func (*Session) BindpointUpdate

func (s *Session) BindpointUpdate()

func (*Session) BoolProp

func (s *Session) BoolProp(id models.PropID) bool

func (*Session) BroadcastStatus

func (s *Session) BroadcastStatus(status social.Status)

func (*Session) Build

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

func (*Session) CanCast

func (s *Session) CanCast(cc *spell.Cast) (err packet.Encodable)

func (*Session) CanSpeak

func (s *Session) CanSpeak() bool

func (*Session) CanUnaura

func (s *Session) CanUnaura(spellID uint32) bool

func (*Session) Cast

func (s *Session) Cast(spellID uint32, target Object) error

func (*Session) ChangeDefaultSpeeds

func (s *Session) ChangeDefaultSpeeds(modifier float32)

func (*Session) CleanupPlayer

func (s *Session) CleanupPlayer()

func (*Session) ClientOrigin

func (s *Session) ClientOrigin() string

func (*Session) ColorPrintf

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

func (*Session) CompleteHandshake

func (session *Session) CompleteHandshake()

This function is called after initial encryption checks are found to be correct.

func (*Session) CompleteLogin

func (s *Session) CompleteLogin()

This function gets called after wait queue is completed or skipped.

func (*Session) Config

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

func (*Session) CreateProcess

func (s *Session) CreateProcess(name string, fn func(*Session, <-chan bool)) *Process

Creates a background function that will run until canceled, or until the session state changes to a lower value

func (*Session) DB

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

func (*Session) DebugGUID

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

func (*Session) EnableEncryption

func (s *Session) EnableEncryption(sessionKey []byte) error

func (*Session) End

func (s *Session) End()

End signals the termination of a session. End can be called anywhere, for any reason.

func (*Session) EnterWaitQueue

func (s *Session) EnterWaitQueue()

func (*Session) EquippableIn

func (s *Session) EquippableIn(it *Item, slot models.ItemSlot) bool

func (*Session) FindProcess

func (s *Session) FindProcess(name string) *Process

func (*Session) GUID

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

func (*Session) GameMode

func (s *Session) GameMode() models.GameMode

func (*Session) GetActiveSpec

func (s *Session) GetActiveSpec() uint8

func (*Session) GetAuras

func (player *Session) GetAuras() *AuraState

func (*Session) GetBagItem

func (s *Session) GetBagItem(bag models.ItemSlot) *Item

func (*Session) GetCharacterClass

func (s *Session) GetCharacterClass() models.Class

func (*Session) GetCharacterHealth

func (s *Session) GetCharacterHealth() uint32

func (*Session) GetCharacterLevel

func (s *Session) GetCharacterLevel() uint32

func (*Session) GetCharacterPower

func (s *Session) GetCharacterPower() spell.PowerType

func (*Session) GetCharacterRace

func (s *Session) GetCharacterRace() models.Race

func (*Session) GetContact

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

func (*Session) GetFreeTalentPoints

func (s *Session) GetFreeTalentPoints() uint32

func (*Session) GetGameObjectTemplateByEntry

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

func (*Session) GetItemByPos

func (s *Session) GetItemByPos(bag, slot models.ItemSlot) (*models.Inventory, *Item)

func (*Session) GetItemTemplate

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

func (*Session) GetItemTemplateByEntry

func (s *Session) GetItemTemplateByEntry(entry uint32) *models.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() models.Class

func (*Session) GetPlayerRace

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

func (*Session) GetPowerType

func (s *Session) GetPowerType() uint8

func (*Session) GetProp

func (s *Session) GetProp(id models.PropID, value interface{}) bool

func (*Session) GetPropIndex

func (s *Session) GetPropIndex(id models.PropID) int

func (*Session) GetSight

func (s *Session) GetSight() *Sight

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) God

func (s *Session) God() bool

func (*Session) HandleAccountDataUpdate

func (s *Session) HandleAccountDataUpdate(upd8 *account.ClientUpdateData)

func (*Session) HandleAreaTrigger

func (s *Session) HandleAreaTrigger(trigger *area.Trigger)

func (*Session) HandleAuraCancel

func (s *Session) HandleAuraCancel(ac *spell.AuraCancel)

func (*Session) HandleAuthSession

func (s *Session) HandleAuthSession(as *auth.SessionClient)

func (*Session) HandleAutoEquipItem

func (s *Session) HandleAutoEquipItem(ae *item.AutoEquipItemRequest)

func (*Session) HandleAutoStoreBagItem

func (s *Session) HandleAutoStoreBagItem(ab *item.AutoStoreBag)

func (*Session) HandleCast

func (s *Session) HandleCast(cc *spell.Cast)

func (*Session) HandleChat

func (s *Session) HandleChat(cm *chat.ClientMessage)

func (*Session) HandleCommand

func (s *Session) HandleCommand(c string)

func (*Session) HandleCreateCharacter

func (s *Session) HandleCreateCharacter(cc *character.Create)

func (*Session) HandleCreatureQuery

func (s *Session) HandleCreatureQuery(cq *creature.Query)

func (*Session) HandleDeleteCharacter

func (s *Session) HandleDeleteCharacter(del *character.Delete)

func (*Session) HandleDestroyItem

func (s *Session) HandleDestroyItem(id *item.Destroy)

func (*Session) HandleDisconnect

func (s *Session) HandleDisconnect(dc *packet.ClientDisconnect)

func (*Session) HandleEmoteCommand

func (s *Session) HandleEmoteCommand(emoteID uint32)

func (*Session) HandleEnableNaglesAlgorithm

func (s *Session) HandleEnableNaglesAlgorithm()

func (*Session) HandleEnterEncryptedModeAck

func (s *Session) HandleEnterEncryptedModeAck()

func (*Session) HandleFriendAdd

func (s *Session) HandleFriendAdd(add *social.Add)

func (*Session) HandleFriendDelete

func (s *Session) HandleFriendDelete(del *social.Delete)

func (*Session) HandleFriendListRequest

func (s *Session) HandleFriendListRequest()

func (*Session) HandleGameObjectQuery

func (s *Session) HandleGameObjectQuery(goq *gameobject.Query)

func (*Session) HandleGameObjectUse

func (s *Session) HandleGameObjectUse(use *gameobject.Use)

func (*Session) HandleGossipHello

func (s *Session) HandleGossipHello(hello *gossip.Hello)

func (*Session) HandleGossipSelectOption

func (s *Session) HandleGossipSelectOption(so *gossip.SelectOption)

func (*Session) HandleGossipTextQuery

func (s *Session) HandleGossipTextQuery(tq *gossip.TextQuery)

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(ir *party.InviteRequest)

func (*Session) HandleIgnoreAdd

func (s *Session) HandleIgnoreAdd(add *social.Add)

func (*Session) HandleIgnoreDelete

func (s *Session) HandleIgnoreDelete(del *social.Delete)

func (*Session) HandleItemQuerySingle

func (s *Session) HandleItemQuerySingle(siq *item.QuerySingle)

func (*Session) HandleLogoutCancel

func (s *Session) HandleLogoutCancel()

func (*Session) HandleLogoutRequest

func (s *Session) HandleLogoutRequest()

func (*Session) HandleMoves

func (s *Session) HandleMoves(moves *update.MovementPacket)

func (*Session) HandleNameQuery

func (s *Session) HandleNameQuery(nq *query.Name)

func (*Session) HandleNewSpellSlot

func (s *Session) HandleNewSpellSlot(sl *spell.NewSlot)

func (*Session) HandlePartyMessage

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

func (*Session) HandlePetNameQuery

func (s *Session) HandlePetNameQuery(p *query.PetName)

func (*Session) HandlePing

func (s *Session) HandlePing(pi *packet.Ping)

func (*Session) HandlePlayedTimeRequest

func (s *Session) HandlePlayedTimeRequest()

func (*Session) HandlePlayerLogin

func (s *Session) HandlePlayerLogin(join *login.Player)

func (*Session) HandleQueryTime

func (s *Session) HandleQueryTime(q *synctime.QueryTime)

func (*Session) HandleQuestgiverStatusQuery

func (s *Session) HandleQuestgiverStatusQuery(q *quest.GiverStatusQuery)

func (*Session) HandleRealmSplit

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

func (*Session) HandleRequestCharacterList

func (s *Session) HandleRequestCharacterList()

func (*Session) HandleRequestPartyMemberStats

func (s *Session) HandleRequestPartyMemberStats(rq *party.RequestMemberStats)

func (*Session) HandleRequestRaidInfo

func (s *Session) HandleRequestRaidInfo()

func (*Session) HandleSay

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

func (*Session) HandleSetActionButton

func (s *Session) HandleSetActionButton(sab *spell.SetActionButton)

func (*Session) HandleSetActiveMover

func (s *Session) HandleSetActiveMover(sam *update.SetActiveMover)

func (*Session) HandleSetWeaponMode

func (s *Session) HandleSetWeaponMode(swm *update.SetWeaponMode)

func (*Session) HandleSheathe

func (s *Session) HandleSheathe(sheathe *update.SetSheathe)

func (*Session) HandleSocialListRequest

func (s *Session) HandleSocialListRequest()

func (*Session) HandleSplitItem

func (s *Session) HandleSplitItem(isr *item.SplitRequest)

func (*Session) HandleStandStateChange

func (s *Session) HandleStandStateChange(sss *update.SetStandState)

func (*Session) HandleSummonResponse

func (c *Session) HandleSummonResponse()

func (*Session) HandleSwapInventoryItem

func (s *Session) HandleSwapInventoryItem(swp *item.SwapBackpackRequest)

func (*Session) HandleSwapItem

func (s *Session) HandleSwapItem(swp *item.SwapRequest)

func (*Session) HandleTarget

func (s *Session) HandleTarget(target *update.Target)

func (*Session) HandleTextEmote

func (s *Session) HandleTextEmote(textemote *chat.TextEmoteRequest)

func (*Session) HandleUITimeRequest

func (s *Session) HandleUITimeRequest()

func (*Session) HandleUpdateMovement

func (s *Session) HandleUpdateMovement(mpacket *update.MovementPacket)

Important TODO: validate position

func (*Session) HandleWhisper

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

func (*Session) HandleWho

func (s *Session) HandleWho(wr *social.WhoRequest)

func (*Session) HandleWorldTeleport

func (s *Session) HandleWorldTeleport(wt *teleport.Worldport)

func (*Session) HandleWorldportAck

func (s *Session) HandleWorldportAck()

For some reason this is necessary

func (*Session) HandleZoneExperience

func (s *Session) HandleZoneExperience(zoneID uint32)

func (*Session) HandleZoneUpdate

func (s *Session) HandleZoneUpdate(zu *area.ZoneUpdate)

func (*Session) HasItem

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

func (*Session) HasState

func (s *Session) HasState(ss SessionState) bool

func (*Session) HasYouIgnored

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

func (*Session) Health

func (s *Session) Health() uint32

func (*Session) InCombat

func (s *Session) InCombat() bool

func (*Session) InitBaseStats

func (player *Session) InitBaseStats() error

func (*Session) InitGroup

func (s *Session) InitGroup()

func (*Session) InitInventoryManager

func (s *Session) InitInventoryManager()

func (*Session) InitPlayerSession

func (s *Session) InitPlayerSession(char *models.Character)

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 models.ItemSlot) bool

func (*Session) IsGM

func (s *Session) IsGM() bool

func (*Session) IsIgnoring

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

func (*Session) IsSpam

func (s *Session) IsSpam(cm *chat.ClientMessage) bool

func (*Session) IsTrackedGUID

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

func (*Session) IsValidPos

func (s *Session) IsValidPos(bag, slot models.ItemSlot) bool

func (*Session) KillAllProcesses

func (s *Session) KillAllProcesses()

func (*Session) KillProcessesWithTag

func (s *Session) KillProcessesWithTag(tag string)

func (*Session) KnowsAbility

func (s *Session) KnowsAbility(spellID uint32) bool

func (*Session) Kv

func (s *Session) Kv(name, format string, args ...any)

func (*Session) LearnAbility

func (s *Session) LearnAbility(spellID uint32) error

func (*Session) LeaveGroup

func (s *Session) LeaveGroup()

func (*Session) LevelUp

func (s *Session) LevelUp(to uint32)

func (*Session) Log

func (s *Session) Log(msg ...any)

func (*Session) Logout

func (s *Session) Logout()

func (*Session) Map

func (s *Session) Map() *Map

func (*Session) MapID

func (s *Session) MapID() uint32

func (*Session) MaxHealth

func (s *Session) MaxHealth() uint32

func (*Session) MaxMoney

func (s *Session) MaxMoney() models.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 models.Item) *Item

func (*Session) NoSuchPlayer

func (s *Session) NoSuchPlayer(playerName string)

func (*Session) Notify

func (s *Session) Notify(notif UnitNotification, wo WorldObject, args ...any)

func (*Session) NotifyGroup

func (s *Session) NotifyGroup()

func (*Session) NotifyMovement

func (s *Session) NotifyMovement(wt packet.WorldType, wo WorldObject)

func (*Session) PaperDollEnd

func (s *Session) PaperDollEnd() models.ItemSlot

func (*Session) PartyMemberAuraState

func (s *Session) PartyMemberAuraState() []party.MemberAuraState

func (*Session) Pet

func (s *Session) Pet() *Creature

func (*Session) Phase

func (s *Session) Phase() *Phase

func (*Session) PhaseTeleportTo

func (c *Session) PhaseTeleportTo(phaseID string, mapID uint32, pos tempest.C4Vector)

func (*Session) PlayerID

func (s *Session) PlayerID() uint64

func (*Session) PlayerName

func (s *Session) PlayerName() string

func (*Session) Position

func (s *Session) Position() tempest.C4Vector

func (*Session) Power

func (s *Session) Power() uint32

func (*Session) QuestDone

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

func (*Session) RefreshInventory

func (s *Session) RefreshInventory()

func (*Session) RemoveFromWaitQueue

func (s *Session) RemoveFromWaitQueue()

func (*Session) RemoveProp

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

func (*Session) RemoveTrackedGUID

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

func (*Session) SavePowers

func (s *Session) SavePowers()

func (*Session) Send

func (s *Session) Send(f packet.Encodable)

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) SendArea

func (s *Session) SendArea(f packet.Codec)

func (*Session) SendAreaPacket

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

func (*Session) SendAuthSuccess

func (session *Session) SendAuthSuccess()

func (*Session) SendAuthWaitQueue

func (s *Session) SendAuthWaitQueue(position uint32)

func (*Session) SendBagUpdate

func (s *Session) SendBagUpdate(bag models.ItemSlot)

func (*Session) SendDanceMoves

func (s *Session) SendDanceMoves()

func (*Session) SendEquipmentSetList

func (s *Session) SendEquipmentSetList()

func (*Session) SendFriendList

func (s *Session) SendFriendList()

func (*Session) SendFriendStatus

func (s *Session) SendFriendStatus(result social.FriendResult, id guid.GUID, note string, status social.Status, area, level, class uint32)

func (*Session) SendGossip

func (s *Session) SendGossip(m *gossip.Menu)

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) SendInitFactions

func (s *Session) SendInitFactions()

func (*Session) SendInitWaitQueue

func (s *Session) SendInitWaitQueue(position int)

func (*Session) SendInitWorldStates

func (s *Session) SendInitWorldStates()

func (*Session) SendItemUpdate

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

func (*Session) SendLoginFailure

func (s *Session) SendLoginFailure(failure character.LoginResult)

func (*Session) SendNameQueryResponseFor

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

func (*Session) SendNewItem

func (s *Session) SendNewItem(newitem *Item, received, created, showInChat bool, bag, slot models.ItemSlot, count uint32)

func (*Session) SendNewWorld

func (s *Session) SendNewWorld(mapID uint32, pos tempest.C4Vector)

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) SendPacket

func (s *Session) SendPacket(wPacket *packet.WorldPacket)

func (*Session) SendPartyMemberStats

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

func (*Session) SendPartyResult

func (s *Session) SendPartyResult(operation party.Operation, memberName string, result party.Result)

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 quest.GiverStatus)

func (*Session) SendRawUpdateObjectData

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

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()

Sends metadata important to handshake after session is initially confirmed

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) SendSystemFeatures

func (s *Session) SendSystemFeatures()

func (*Session) SendTeleportAck

func (s *Session) SendTeleportAck(g guid.GUID, mapID uint32, pos tempest.C4Vector)

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) SendUpdateWaitQueuePosition

func (s *Session) SendUpdateWaitQueuePosition(position uint32)

func (*Session) SendVerifyLoginPacket

func (s *Session) SendVerifyLoginPacket()

func (*Session) SetBagGUIDSlot

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

func (*Session) SetBoolProp

func (s *Session) SetBoolProp(id models.PropID, value bool)

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) SetGameMode

func (s *Session) SetGameMode(gm models.GameMode) error

func (*Session) SetHealth

func (s *Session) SetHealth(u uint32)

func (*Session) SetPosition

func (s *Session) SetPosition(c4 tempest.C4Vector)

func (*Session) SetProp

func (s *Session) SetProp(id models.PropID, value interface{})

func (*Session) SetStandState

func (s *Session) SetStandState(value update.StandState)

func (*Session) SetState

func (s *Session) SetState(ss SessionState)

func (*Session) SetStringProp

func (s *Session) SetStringProp(id models.PropID, value string)

func (*Session) SetSummonLocation

func (s *Session) SetSummonLocation(phase string, mapID uint32, pos tempest.C4Vector)

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) SortInventory

func (s *Session) SortInventory()

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) StartAuthChallenge

func (s *Session) StartAuthChallenge()

func (*Session) StartInv

func (s *Session) StartInv() models.ItemSlot

func (*Session) State

func (s *Session) State() SessionState

error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

func (*Session) String

func (s *Session) String() string

func (*Session) SwapItem

func (s *Session) SwapItem(srcBag, srcSlot, dstBag, dstSlot models.ItemSlot)

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() chat.Tag

func (*Session) Target

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

func (*Session) TeleportTo

func (s *Session) TeleportTo(mapID uint32, newPos tempest.C4Vector)

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

func (*Session) TimeInWorld

func (s *Session) TimeInWorld() (time.Duration, error)

func (*Session) TypeID

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

func (*Session) UpdateAllAuraDurations

func (s *Session) UpdateAllAuraDurations()

func (*Session) UpdateAuraDuration

func (s *Session) UpdateAuraDuration(slot int)

func (*Session) UpdatePlayer

func (s *Session) UpdatePlayer()

Broadcast changes to nearby players

func (*Session) UpdatePosition

func (s *Session) UpdatePosition()

func (*Session) UpdateSelf

func (s *Session) UpdateSelf()

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

func (*Session) ValidName

func (s *Session) ValidName(name string) bool

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) VehicleSeatID

func (s *Session) VehicleSeatID() uint32

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) SendPacket

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

type SessionState

type SessionState int8
const (
	Handshaking SessionState = iota
	Authed
	Waiting
	CharacterSelectMenu
	InWorld
)
const Ended SessionState = -1

type Sight

type Sight struct {
	Position tempest.C4Vector
}

type SpawnGroupInstance

type SpawnGroupInstance struct {
	Position tempest.C4Vector
	Group    models.SpawnGroup
	Objects  WorldObjectSet
}

type SpellEffect

type SpellEffect func(*SpellEffectData)

type SpellEffectData

type SpellEffectData struct {
	Map         *Map
	Spell       *dbdefs.Ent_Spell
	EffectIndex int
	Caster      Unit
	Target      Unit
	Aura        *Aura
}

type SpellManager

type SpellManager struct {
	PlayerMoved    chan MoveTick
	StartCast      chan *spell.Cast
	GoCast         chan *spell.Cast
	PendingCast    *spell.Cast
	RechargeTicker *time.Ticker
}

type StaticTeamRelationship

type StaticTeamRelationship struct {
	TeamID   string
	Relation Relation
	Reason   Reason
}

type Subscriber

type Subscriber interface {
	Notify(notif Notification, object WorldObject, args ...any)
}

type Summons

type Summons struct {
	Phase string
	Map   uint32
	Pos   tempest.C4Vector
}

type Team

type Team interface {
	ID() string
	Name() i18n.Text
	Color() string
	Relationships() *TeamRelationships
}

type TeamPlayer

type TeamPlayer interface {
	GUID() guid.GUID
	Teams() []Team
}

type TeamRelationships

type TeamRelationships struct {
	Statics []StaticTeamRelationship
}

type Unit

type Unit interface {
	WorldObject

	Target(guid.GUID)
	GetTarget() guid.GUID
	GetAuras() *AuraState
	Notify(UnitNotification, WorldObject, ...any)
}

Objects that can cast and receive spells

type UnitNotification

type UnitNotification uint8
const (
	UnitNotifyCreate UnitNotification = iota
	UnitNotifyDelete
	UnitNotifyMovement
	UnitNotifyOutOfRange
)

type UnitSet

type UnitSet []Unit

func (UnitSet) Notify

func (us UnitSet) Notify(notif UnitNotification, wo WorldObject, args ...any)

func (UnitSet) NotifyMovement

func (us UnitSet) NotifyMovement(movementType packet.WorldType, wo WorldObject)

type WaitQueue

type WaitQueue struct {
	sync.Mutex
	Q []*Session
}

func (*WaitQueue) DeleteSession

func (wq *WaitQueue) DeleteSession(s *Session)

func (*WaitQueue) Dequeue

func (wq *WaitQueue) Dequeue()

func (*WaitQueue) EnqueueSession

func (wq *WaitQueue) EnqueueSession(s *Session)

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) Filter

func (wobjs WorldObjectSet) Filter(fn FilterFunc) WorldObjectSet

func (WorldObjectSet) Iter

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

func (WorldObjectSet) OfTypeID

func (wobjs WorldObjectSet) OfTypeID(id guid.TypeID) WorldObjectSet

func (WorldObjectSet) Sessions

func (wos WorldObjectSet) Sessions() SessionSet

func (WorldObjectSet) Units

func (wos WorldObjectSet) Units() UnitSet

func (WorldObjectSet) WithoutGUID

func (wobjs WorldObjectSet) WithoutGUID(g guid.GUID) WorldObjectSet

Directories

Path Synopsis
plugins
randomness provides pseudo-random utilities for in-game use.
randomness provides pseudo-random utilities for in-game use.
wdb
Package wdb contains the realm databases.
Package wdb contains the realm databases.
models
package realm/wdb/models Contains models for game data, type enums, and conversion functions
package realm/wdb/models Contains models for game data, type enums, and conversion functions
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