Documentation ¶
Index ¶
- Constants
- Variables
- func OptionAsync(t p.WorldType, data []byte, opts *Options) error
- func PowerType(class packet.Class) uint8
- func RegisterPlugin(name string, plugin Plugin)
- func Start(opts *config.World) error
- type Command
- type CommandPrivileges
- type Creature
- func (c *Creature) DisplayID() uint32
- func (c *Creature) Entry() uint32
- func (c *Creature) GUID() guid.GUID
- func (c *Creature) GetPowerType() uint8
- func (c *Creature) Health() uint32
- func (c *Creature) MaxHealth() uint32
- func (c *Creature) MaxPower() uint32
- func (c *Creature) Movement() *update.MovementBlock
- func (c *Creature) Power() uint32
- func (c *Creature) TypeID() guid.TypeID
- func (c *Creature) Values() *update.ValuesBlock
- type EventType
- type GameObject
- func (gobj *GameObject) Entry() uint32
- func (g *GameObject) GUID() guid.GUID
- func (gobj *GameObject) GameObjectType() uint32
- func (g *GameObject) Living() bool
- func (gobj *GameObject) Movement() *update.MovementBlock
- func (g *GameObject) SetPosition(pos update.Position)
- func (g *GameObject) SetRotation(orientation, rot0, rot1, rot2, rot3 float32)
- func (g *GameObject) Speeds() update.Speeds
- func (g *GameObject) TypeID() guid.TypeID
- func (g *GameObject) Values() *update.ValuesBlock
- type Group
- type Handlers
- type InstanceScripting
- type InventoryHeap
- type Item
- func (i *Item) BagEmpty() bool
- func (i *Item) ContainerNumSlots() uint32
- func (i *Item) Entry() uint32
- func (i *Item) GUID() guid.GUID
- func (i *Item) ID() uint64
- func (i *Item) IsBag() bool
- func (i *Item) PropertySeed() uint32
- func (i *Item) RandomPropertiesID() uint32
- func (i *Item) StackCount() uint32
- func (i *Item) TypeID() guid.TypeID
- func (i *Item) Values() *update.ValuesBlock
- type LoadedPlugin
- type Map
- func (m *Map) AddObject(obj WorldObject) error
- func (m *Map) Config() *config.World
- func (m *Map) GetObject(g guid.GUID) WorldObject
- func (m *Map) NearObjects(nearTo WorldObject) WorldObjectSet
- func (m *Map) NearObjectsLimit(nearTo WorldObject, limit float32) WorldObjectSet
- func (m *Map) NearSet(nearTo WorldObject) SessionSet
- func (m *Map) NearSetLimit(nearTo WorldObject, limit float32) SessionSet
- func (m *Map) PlayMusic(id uint32)
- func (m *Map) PlayObjectSound(id guid.GUID, soundID uint32)
- func (m *Map) PlaySound(id uint32)
- func (m *Map) PropagateChanges(id guid.GUID)
- func (m *Map) RemoveObject(id guid.GUID)
- func (m *Map) SpawnGameObject(gobjID string, pos update.Position) error
- func (m *Map) UpdateSpeed(g guid.GUID, st update.SpeedType)
- func (m *Map) VisibilityDistance() float32
- type MapChunkKey
- type MapChunkValue
- type Object
- type Option
- type Options
- type Phase
- type Plugin
- type PluginInfo
- type Server
- func (ws *Server) AllSessions() SessionSet
- func (ws *Server) Build() vsn.Build
- func (ws *Server) Cmd(req CommandPrivileges, sig, description string, function interface{})
- func (ws *Server) CreateGameObject(tpl *wdb.GameObjectTemplate, pos update.Position) *GameObject
- func (ws *Server) ExploreXPRate() float32
- func (ws *Server) GetExploreXP(explorationLevel uint32) uint32
- func (ws *Server) GetFriendStatus(id guid.GUID) packet.FriendStatus
- func (s *Server) GetGUIDByPlayerName(playerName string) (guid.GUID, error)
- func (s *Server) GetNative(race packet.Race, gender uint8) uint32
- func (ws *Server) GetNextLevelXP(forLevel uint32) uint32
- func (ws *Server) GetPlayerNameByGUID(g guid.GUID) (string, error)
- func (ws *Server) GetServerStats() *ServerStats
- func (s *Server) GetSessionByGUID(g guid.GUID) (*Session, error)
- func (s *Server) GetSessionByPlayerName(playerName string) (*Session, error)
- func (s *Server) GetUnitNameByGUID(g guid.GUID) (string, error)
- func (ws *Server) Handle(c net.Conn)
- func (ws *Server) InitTerrainMgr()
- func (ws *Server) LoadDatapacks() error
- func (ws *Server) LoadObjectTemplates(path string, typeID guid.TypeID, templates interface{}) error
- func (ws *Server) LoadStaticFields(path string, items interface{})
- func (ws *Server) LookupMapChunk(key MapChunkKey) (*terrain.ChunkData, error)
- func (ws *Server) NewCreature(template *wdb.CreatureTemplate, position update.Position) *Creature
- func (ws *Server) NextDynamicCounter(typeID guid.TypeID) uint64
- func (ws *Server) NextGameObjectGUID() guid.GUID
- func (ws *Server) On(et EventType, key, handler interface{})
- func (ws *Server) OverrideEventHandler(et EventType, key, handler interface{})
- func (ws *Server) Phase(id string) *Phase
- func (ws *Server) RealmID() uint64
- func (ws *Server) RemovePlayerFromList(name string)
- func (s *Server) ScrubCharacter(chr guid.GUID)
- func (ws *Server) ThinkOn(et EventType, scriptId interface{}, parameters ...interface{}) (shouldStop bool, err error)
- func (ws *Server) UptimeMS() uint32
- type ServerStats
- type Session
- func (s *Session) AddExperience(newXP uint32)
- func (s *Session) AddItem(itemID string, count int, received, created bool) error
- func (s *Session) AddMoney(money econ.Money)
- func (s *Session) AddProp(id wdb.PropID)
- func (s *Session) AddTrackedGUID(g guid.GUID)
- func (s *Session) Alertf(format string, args ...interface{})
- func (s *Session) Annf(data string, args ...interface{})
- func (s *Session) BindpointUpdate()
- func (s *Session) BroadcastStatus(status packet.FriendStatus)
- func (s *Session) Build() vsn.Build
- func (s *Session) CanSpeak() bool
- func (s *Session) ChangeDefaultSpeeds(modifier float32)
- func (s *Session) Cleanup()
- func (s *Session) CleanupPlayer()
- func (s *Session) ColorPrintf(color string, data string, args ...interface{})
- func (s *Session) Config() *config.World
- func (s *Session) CreateCharacter(e *etc.Buffer)
- func (s *Session) DB() *wdb.Core
- func (s *Session) DebugGUID(dbg guid.GUID) string
- func (s *Session) DeleteCharacter(b []byte)
- func (s *Session) EquippableIn(it *Item, slot uint8) bool
- func (s *Session) FailCheck()
- func (s *Session) GUID() guid.GUID
- func (s *Session) GetActiveSpec() uint8
- func (s *Session) GetBagItem(bag uint8) *Item
- func (s *Session) GetContact(friend guid.GUID) *wdb.Contact
- func (s *Session) GetFreeTalentPoints() uint32
- func (s *Session) GetGameObjectTemplateByEntry(entry uint32) *wdb.GameObjectTemplate
- func (s *Session) GetInventoryHeap() InventoryHeap
- func (s *Session) GetItemByPos(bag, slot uint8) (*wdb.Inventory, *Item)
- func (s *Session) GetItemTemplate(it wdb.Item) *wdb.ItemTemplate
- func (s *Session) GetItemTemplateByEntry(entry uint32) *wdb.ItemTemplate
- func (s *Session) GetLevel() int
- func (s *Session) GetLoc(str string) string
- func (s *Session) GetMaxLevel() int
- func (s *Session) GetNextLevelXP() uint32
- func (s *Session) GetPlayerClass() packet.Class
- func (s *Session) GetPlayerRace() packet.Race
- func (s *Session) GetPowerType() uint8
- func (s *Session) GetSpecsCount() uint8
- func (s *Session) GetTarget() guid.GUID
- func (s *Session) GetValidGossipObject(id guid.GUID) (WorldObject, string)
- func (s *Session) Handle()
- func (s *Session) HandleAccountDataUpdate(data []byte)
- func (s *Session) HandleAreaTrigger(e *etc.Buffer)
- func (s *Session) HandleAutoEquipItem(e *etc.Buffer)
- func (s *Session) HandleChat(b []byte)
- func (s *Session) HandleCheck(data *etc.Buffer)
- func (s *Session) HandleCommand(c string)
- func (s *Session) HandleCreatureQuery(e *etc.Buffer)
- func (s *Session) HandleDestroyItem(e *etc.Buffer)
- func (s *Session) HandleEmoteCommand(emoteID uint32)
- func (s *Session) HandleFriendAdd(e *etc.Buffer)
- func (s *Session) HandleFriendDelete(e *etc.Buffer)
- func (s *Session) HandleFriendListRequest()
- func (s *Session) HandleGameObjectQuery(e *etc.Buffer)
- func (s *Session) HandleGameObjectUse(e *etc.Buffer)
- func (s *Session) HandleGossipHello(gguid *etc.Buffer)
- func (s *Session) HandleGossipSelectOption(e *etc.Buffer)
- func (s *Session) HandleGossipTextQuery(e *etc.Buffer)
- func (s *Session) HandleGroupAccept()
- func (s *Session) HandleGroupDecline()
- func (s *Session) HandleGroupDisband()
- func (s *Session) HandleGroupInvite(e *etc.Buffer)
- func (s *Session) HandleHashResult(data *etc.Buffer)
- func (s *Session) HandleIgnoreAdd(e *etc.Buffer)
- func (s *Session) HandleIgnoreDelete(e *etc.Buffer)
- func (s *Session) HandleItemQuery(e *etc.Buffer)
- func (s *Session) HandleJoin(e *etc.Buffer)
- func (s *Session) HandleLogoutRequest(b []byte)
- func (s *Session) HandleMoves(t packet.WorldType, b []byte)
- func (s *Session) HandleNameQuery(e *etc.Buffer)
- func (s *Session) HandlePartyMessage(party *chat.Message)
- func (s *Session) HandlePong(e *etc.Buffer)
- func (s *Session) HandleQuestgiverStatusQuery(e *etc.Buffer)
- func (s *Session) HandleRealmSplit(split *etc.Buffer)
- func (s *Session) HandleRequestCharacterList()
- func (s *Session) HandleRequestPartyMemberStats(e *etc.Buffer)
- func (s *Session) HandleSay(say *chat.Message)
- func (s *Session) HandleSetActionButton(e *etc.Buffer)
- func (s *Session) HandleSetWeaponMode(e *etc.Buffer)
- func (s *Session) HandleSheathe(e *etc.Buffer)
- func (s *Session) HandleSocialListRequest()
- func (s *Session) HandleSplitItem(e *etc.Buffer)
- func (s *Session) HandleStandStateChange(e *etc.Buffer)
- func (c *Session) HandleSummonResponse(e *etc.Buffer)
- func (s *Session) HandleSwapInventoryItem(e *etc.Buffer)
- func (s *Session) HandleSwapItem(e *etc.Buffer)
- func (s *Session) HandleTarget(e *etc.Buffer)
- func (s *Session) HandleTextEmote(e *etc.Buffer)
- func (s *Session) HandleUITimeRequest()
- func (s *Session) HandleUpdateMovement(minfo *update.MovementInfo)
- func (s *Session) HandleWhisper(whisper *chat.Message)
- func (s *Session) HandleWho(b []byte)
- func (s *Session) HandleWorldTeleport(e *etc.Buffer)
- func (s *Session) HandleWorldportAck(b []byte)
- func (s *Session) HandleZoneExperience(zoneID uint32)
- func (s *Session) HandleZoneUpdate(e *etc.Buffer)
- func (s *Session) HasItem(entry string) bool
- func (s *Session) HasProp(id wdb.PropID) bool
- func (s *Session) HasYouIgnored(g guid.GUID) bool
- func (s *Session) Health() uint32
- func (session *Session) Init()
- func (s *Session) InitGroup()
- func (s *Session) InitInventoryManager()
- func (s *Session) InitWarden()
- func (s *Session) InitializeModule()
- func (s *Session) IsAdmin() bool
- func (s *Session) IsAlive() bool
- func (s *Session) IsEnemy(wo WorldObject) bool
- func (s *Session) IsEquipmentPos(bag, slot uint8) bool
- func (s *Session) IsGM() bool
- func (s *Session) IsIgnoring(player guid.GUID) bool
- func (s *Session) IsValidPos(bag, slot uint8) bool
- func (s *Session) LeaveGroup()
- func (s *Session) LevelUp(to uint32)
- func (s *Session) MOTD(fstr string, args ...interface{})
- func (s *Session) Map() *Map
- func (s *Session) MaxHealth() uint32
- func (s *Session) MaxMoney() econ.Money
- func (s *Session) MaxPositiveAuras() int
- func (s *Session) MaxPower() uint32
- func (s *Session) Movement() *update.MovementBlock
- func (s *Session) NewItem(it wdb.Item) *Item
- func (s *Session) NoSuchPlayer(playerName string)
- func (s *Session) NumActionButtons() int
- func (s *Session) Pet() *Creature
- func (c *Session) PhaseTeleportTo(phaseID string, mapID uint32, pos update.Position)
- func (s *Session) PlayerID() uint64
- func (s *Session) PlayerName() string
- func (s *Session) Position() update.Position
- func (s *Session) Power() uint32
- func (s *Session) QuestDone(q uint32) bool
- func (s *Session) ReadCrypt() (packet.WorldType, []byte, error)
- func (s *Session) RemoveProp(id wdb.PropID)
- func (s *Session) RemoveTrackedGUID(g guid.GUID)
- func (s *Session) RequestData()
- func (s *Session) RequestHash()
- func (s *Session) SendAccountDataTimes()
- func (s *Session) SendActionButtons()
- func (s *Session) SendAlertText(data string)
- func (s *Session) SendAllAcheivementData()
- func (s *Session) SendAreaAll(p *packet.WorldPacket)
- func (s *Session) SendAsync(p *packet.WorldPacket)
- func (s *Session) SendAuthWaitQueue(position uint32)
- func (s *Session) SendBagUpdate(bag uint8)
- func (s *Session) SendCharacterOp(opcode packet.CharacterOp)
- func (s *Session) SendChat(ch *chat.Message)
- func (s *Session) SendChatPlayerIsEnemy(name string)
- func (s *Session) SendChatPlayerIsIgnoringYou(name string)
- func (s *Session) SendChatPlayerNotFound(name string)
- func (s *Session) SendDanceMoves()
- func (s *Session) SendEquipError(ir packet.InventoryResult, src, dest *Item)
- func (s *Session) SendEquipmentSetList()
- func (s *Session) SendExplorationXP(zoneID, exp uint32)
- func (s *Session) SendFactions()
- func (s *Session) SendFriendList()
- func (s *Session) SendFriendStatus(result uint8, id guid.GUID, note string, status packet.FriendStatus, ...)
- func (s *Session) SendGossip(gossip *packet.Gossip)
- func (s *Session) SendGroupDestroyed()
- func (s *Session) SendGroupInvite(from string)
- func (s *Session) SendGroupList()
- func (s *Session) SendIgnoreList()
- func (s *Session) SendInitWorldStates()
- func (s *Session) SendItemUpdate(it *Item)
- func (s *Session) SendLoginFailure(failure packet.CharLoginResult)
- func (s *Session) SendLoginSpell()
- func (s *Session) SendMetadataAfterSpawn()
- func (s *Session) SendNameQueryResponseFor(char *wdb.Character)
- func (s *Session) SendNewItem(item *Item, received, created, showInChat bool, bag, slot uint8, count uint32)
- func (s *Session) SendNewWorld(mapID uint32, pos update.Position)
- func (s *Session) SendObjectChanges(viewMask update.VisibilityFlags, object Object)
- func (s *Session) SendObjectCreate(objects ...Object)
- func (s *Session) SendObjectDelete(g guid.GUID)
- func (s *Session) SendPartyMemberStats(mask uint32, player *Session)
- func (s *Session) SendPartyResult(operation packet.PartyOperation, memberName string, result packet.PartyResult)
- func (s *Session) SendPet(b []byte)
- func (s *Session) SendPlayMusic(id uint32)
- func (s *Session) SendPlayObjectSound(id guid.GUID, soundID uint32)
- func (s *Session) SendPlaySound(id uint32)
- func (s *Session) SendPlayerTalentsInfoData()
- func (s *Session) SendQuestGiverStatus(id guid.GUID, dialogStatus uint8)
- func (s *Session) SendRawUpdateObjectData(encoded []byte, forceCompression int)
- func (s *Session) SendReputations()
- func (s *Session) SendRequiredItemZoneError(itemID string)
- func (s *Session) SendRequiredLevelZoneError(lvl int)
- func (s *Session) SendRequiredQuestZoneError(questEntry uint32)
- func (s *Session) SendRestStart()
- func (s *Session) SendSessionMetadata()
- func (s *Session) SendSetLeader(leaderName string)
- func (s *Session) SendSocialList()
- func (s *Session) SendSpellList()
- func (s *Session) SendSummonRequest(summoner guid.GUID, zoneID uint32, timeout time.Duration)
- func (s *Session) SendSync(p *packet.WorldPacket) error
- func (s *Session) SendSystemFeatures()
- func (s *Session) SendTeleportAck(g guid.GUID, mapID uint32, pos update.Position)
- func (s *Session) SendTransferPending(mapID uint32)
- func (s *Session) SendTutorialFlags()
- func (s *Session) SendUnlearnSpell()
- func (s *Session) SendVerifyLoginPacket()
- func (s *Session) SendWorldLoginMetadata()
- func (s *Session) SetBagGUIDSlot(bag, slot uint8, g guid.GUID)
- func (s *Session) SetCurrentXP(current uint32)
- func (s *Session) SetExplorationFlag(exploreFlag uint32)
- func (s *Session) SetFly(on bool)
- func (s *Session) SetStandState(value uint8)
- func (s *Session) SetSummonLocation(phase string, mapID uint32, pos update.Position)
- func (s *Session) SetTimeSpeed()
- func (s *Session) SetVisibleItemEntry(index int, entry uint32)
- func (s *Session) SetupOnLogin()
- func (s *Session) SitChair(chair *GameObject)
- func (s *Session) SpawnPlayer()
- func (s *Session) Speeds() update.Speeds
- func (s *Session) SwapItem(srcBag, srcSlot, dstBag, dstSlot uint8)
- func (s *Session) SyncSpeeds()
- func (s *Session) SyncTime()
- func (s *Session) Sysf(data string, args ...interface{})
- func (s *Session) SystemChat(data string)
- func (s *Session) Tag() uint8
- func (s *Session) Team() uint32
- func (s *Session) Teleport(mapID uint32, x, y, z, o float32)
- func (s *Session) TeleportTo(mapID uint32, newPos update.Position)
- func (s *Session) TransferWardenModule()
- func (s *Session) TypeID() guid.TypeID
- func (s *Session) UpdateArea()
- func (s *Session) UpdateCameraPosition(syncSelf bool, pos update.Position)
- func (s *Session) UpdatePlayer()
- func (s *Session) UpdatePosition(pos update.Position)
- func (s *Session) UpdateSelf()
- func (s *Session) UpdateWarden()
- func (s *Session) ValidateZoneWithPosition(zoneID uint32) bool
- func (s *Session) Values() *update.ValuesBlock
- func (s *Session) VehicleSeatID() uint32
- func (s *Session) WardenResponse(data []byte)
- func (s *Session) Warnf(data string, args ...interface{})
- func (s *Session) ZoneExplored(zoneID uint32) bool
- type SessionSet
- type SessionState
- type SpeedOpcodePair
- type SpellMgr
- type TerrainMgr
- type WorldClientHandler
- type WorldObject
- type WorldObjectSet
Constants ¶
const ( HelpColor = "FF50c41a" DemoColor = "FF99CCFF" )
const ( UseCompressionSmartly int = iota ForceCompressionOff ForceCompressionOn )
const ( Mana = iota Rage Focus Energy Happiness )
const (
OptionFlagAsync = 1 << iota
)
Variables ¶
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, } )
var (
MaxGoldNew, _ = econ.ParseShortString("9999999g99s99c")
)
var NullProp wdb.PropID
var (
ObjectDebug = wdb.MakePropID("dbgobj")
)
var ( SpeedCodes = map[update.SpeedType]SpeedOpcodePair{ update.Walk: {packet.SMSG_FORCE_WALK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_WALK_SPEED}, update.Run: {packet.SMSG_FORCE_RUN_SPEED_CHANGE, packet.SMSG_SPLINE_SET_RUN_SPEED}, update.RunBackward: {packet.SMSG_FORCE_RUN_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_RUN_BACK_SPEED}, update.Swim: {packet.SMSG_FORCE_SWIM_SPEED_CHANGE, packet.SMSG_SPLINE_SET_SWIM_SPEED}, update.SwimBackward: {packet.SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_SWIM_BACK_SPEED}, update.Turn: {packet.SMSG_FORCE_TURN_RATE_CHANGE, packet.SMSG_SPLINE_SET_TURN_RATE}, update.Flight: {packet.SMSG_FORCE_FLIGHT_SPEED_CHANGE, packet.SMSG_SPLINE_SET_FLIGHT_SPEED}, update.FlightBackward: {packet.SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_FLIGHT_BACK_SPEED}, } )
Functions ¶
func RegisterPlugin ¶
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) GetPowerType ¶
func (*Creature) Movement ¶
func (c *Creature) Movement() *update.MovementBlock
func (*Creature) Values ¶
func (c *Creature) Values() *update.ValuesBlock
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) RemoveMember ¶
func (*Group) UpdateList ¶
func (g *Group) UpdateList()
type Handlers ¶
type Handlers struct {
Map map[p.WorldType]*WorldClientHandler
}
type InstanceScripting ¶
type InventoryHeap ¶
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) ContainerNumSlots ¶
func (*Item) PropertySeed ¶
func (*Item) RandomPropertiesID ¶
func (*Item) StackCount ¶
func (*Item) Values ¶
func (i *Item) Values() *update.ValuesBlock
type LoadedPlugin ¶
type LoadedPlugin struct { PluginInfo Plugin }
type Map ¶
Map describes a single map in the world
func (*Map) AddObject ¶
func (m *Map) AddObject(obj WorldObject) error
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) PropagateChanges ¶
func (*Map) RemoveObject ¶
func (*Map) SpawnGameObject ¶
func (*Map) VisibilityDistance ¶
type MapChunkKey ¶
type MapChunkKey struct { MapID uint32 Index terrain.TileChunkLookupIndex }
type Phase ¶
Phase describes a plane of existence which contains multiple maps.
func (*Phase) AddCreature ¶
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 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) 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 (*Server) GetExploreXP ¶
func (*Server) GetFriendStatus ¶
func (ws *Server) GetFriendStatus(id guid.GUID) packet.FriendStatus
func (*Server) GetGUIDByPlayerName ¶
func (*Server) GetNextLevelXP ¶
func (*Server) GetPlayerNameByGUID ¶
func (*Server) GetServerStats ¶
func (ws *Server) GetServerStats() *ServerStats
func (*Server) GetSessionByPlayerName ¶
func (*Server) InitTerrainMgr ¶
func (ws *Server) InitTerrainMgr()
func (*Server) LoadDatapacks ¶
func (*Server) LoadObjectTemplates ¶
LoadObjectTemplates (item/creature/gameobject templates)
func (*Server) LoadStaticFields ¶
func (*Server) LookupMapChunk ¶
func (ws *Server) LookupMapChunk(key MapChunkKey) (*terrain.ChunkData, error)
func (*Server) NewCreature ¶
func (*Server) NextGameObjectGUID ¶
func (*Server) OverrideEventHandler ¶
func (*Server) RemovePlayerFromList ¶
func (*Server) ScrubCharacter ¶
ScrubCharacter deletes a character PERMANENTLY from a server.
type ServerStats ¶
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 (*Session) AddTrackedGUID ¶
func (*Session) Annf ¶
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) ChangeDefaultSpeeds ¶
func (*Session) CleanupPlayer ¶
func (s *Session) CleanupPlayer()
func (*Session) ColorPrintf ¶
func (*Session) CreateCharacter ¶
func (*Session) DeleteCharacter ¶
func (*Session) GetActiveSpec ¶
func (*Session) GetBagItem ¶
func (*Session) GetFreeTalentPoints ¶
func (*Session) GetGameObjectTemplateByEntry ¶
func (s *Session) GetGameObjectTemplateByEntry(entry uint32) *wdb.GameObjectTemplate
func (*Session) GetInventoryHeap ¶
func (s *Session) GetInventoryHeap() InventoryHeap
func (*Session) GetItemByPos ¶
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) GetMaxLevel ¶
func (*Session) GetNextLevelXP ¶
func (*Session) GetPlayerClass ¶
func (*Session) GetPlayerRace ¶
func (*Session) GetPowerType ¶
func (*Session) GetSpecsCount ¶
func (*Session) GetValidGossipObject ¶
func (s *Session) GetValidGossipObject(id guid.GUID) (WorldObject, string)
func (*Session) HandleAccountDataUpdate ¶
func (*Session) HandleAreaTrigger ¶
func (*Session) HandleAutoEquipItem ¶
func (*Session) HandleChat ¶
func (*Session) HandleCheck ¶
func (*Session) HandleCommand ¶
func (*Session) HandleCreatureQuery ¶
func (*Session) HandleDestroyItem ¶
func (*Session) HandleEmoteCommand ¶
func (*Session) HandleFriendAdd ¶
func (*Session) HandleFriendDelete ¶
func (*Session) HandleFriendListRequest ¶
func (s *Session) HandleFriendListRequest()
func (*Session) HandleGameObjectQuery ¶
func (*Session) HandleGameObjectUse ¶
func (*Session) HandleGossipHello ¶
func (*Session) HandleGossipSelectOption ¶
func (*Session) HandleGossipTextQuery ¶
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 (*Session) HandleHashResult ¶
func (*Session) HandleIgnoreAdd ¶
func (*Session) HandleIgnoreDelete ¶
func (*Session) HandleItemQuery ¶
func (*Session) HandleJoin ¶
func (*Session) HandleLogoutRequest ¶
func (*Session) HandleNameQuery ¶
func (*Session) HandlePartyMessage ¶
func (*Session) HandlePong ¶
func (*Session) HandleQuestgiverStatusQuery ¶
func (*Session) HandleRealmSplit ¶
func (*Session) HandleRequestCharacterList ¶
func (s *Session) HandleRequestCharacterList()
func (*Session) HandleRequestPartyMemberStats ¶
func (*Session) HandleSetActionButton ¶
func (*Session) HandleSetWeaponMode ¶
func (*Session) HandleSheathe ¶
func (*Session) HandleSocialListRequest ¶
func (s *Session) HandleSocialListRequest()
func (*Session) HandleSplitItem ¶
func (*Session) HandleStandStateChange ¶
func (*Session) HandleSummonResponse ¶
func (*Session) HandleSwapInventoryItem ¶
func (*Session) HandleSwapItem ¶
func (*Session) HandleTarget ¶
func (*Session) HandleTextEmote ¶
func (*Session) HandleUITimeRequest ¶
func (s *Session) HandleUITimeRequest()
func (*Session) HandleUpdateMovement ¶
func (s *Session) HandleUpdateMovement(minfo *update.MovementInfo)
func (*Session) HandleWhisper ¶
func (*Session) HandleWorldTeleport ¶
func (*Session) HandleWorldportAck ¶
func (*Session) HandleZoneExperience ¶
func (*Session) HandleZoneUpdate ¶
func (*Session) InitInventoryManager ¶
func (s *Session) InitInventoryManager()
func (*Session) InitWarden ¶
func (s *Session) InitWarden()
func (*Session) InitializeModule ¶
func (s *Session) InitializeModule()
func (*Session) IsEnemy ¶
func (s *Session) IsEnemy(wo WorldObject) bool
func (*Session) IsEquipmentPos ¶
func (*Session) IsValidPos ¶
func (*Session) LeaveGroup ¶
func (s *Session) LeaveGroup()
func (*Session) MaxPositiveAuras ¶
func (*Session) Movement ¶
func (s *Session) Movement() *update.MovementBlock
func (*Session) NoSuchPlayer ¶
func (*Session) NumActionButtons ¶
func (*Session) PhaseTeleportTo ¶
func (*Session) PlayerName ¶
func (*Session) RemoveProp ¶
func (*Session) RemoveTrackedGUID ¶
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 (*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 (*Session) SendBagUpdate ¶
func (*Session) SendCharacterOp ¶
func (s *Session) SendCharacterOp(opcode packet.CharacterOp)
func (*Session) SendChatPlayerIsEnemy ¶
func (*Session) SendChatPlayerIsIgnoringYou ¶
func (*Session) SendChatPlayerNotFound ¶
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 (*Session) SendFactions ¶
func (s *Session) SendFactions()
func (*Session) SendFriendList ¶
func (s *Session) SendFriendList()
func (*Session) SendFriendStatus ¶
func (*Session) SendGossip ¶
func (*Session) SendGroupDestroyed ¶
func (s *Session) SendGroupDestroyed()
func (*Session) SendGroupInvite ¶
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 (*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 (*Session) SendNewItem ¶
func (*Session) SendObjectChanges ¶
func (s *Session) SendObjectChanges(viewMask update.VisibilityFlags, object Object)
func (*Session) SendObjectCreate ¶
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 (*Session) SendPartyMemberStats ¶
func (*Session) SendPartyResult ¶
func (s *Session) SendPartyResult(operation packet.PartyOperation, memberName string, result packet.PartyResult)
func (*Session) SendPlayMusic ¶
func (*Session) SendPlayObjectSound ¶
func (*Session) SendPlaySound ¶
func (*Session) SendPlayerTalentsInfoData ¶
func (s *Session) SendPlayerTalentsInfoData()
func (*Session) SendQuestGiverStatus ¶
func (*Session) SendRawUpdateObjectData ¶
func (*Session) SendReputations ¶
func (s *Session) SendReputations()
func (*Session) SendRequiredItemZoneError ¶
func (*Session) SendRequiredLevelZoneError ¶
func (*Session) SendRequiredQuestZoneError ¶
func (*Session) SendRestStart ¶
func (s *Session) SendRestStart()
func (*Session) SendSessionMetadata ¶
func (s *Session) SendSessionMetadata()
func (*Session) SendSetLeader ¶
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 (*Session) SendSystemFeatures ¶
func (s *Session) SendSystemFeatures()
func (*Session) SendTeleportAck ¶
func (*Session) SendTransferPending ¶
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) SetCurrentXP ¶
func (*Session) SetExplorationFlag ¶
func (*Session) SetStandState ¶
func (*Session) SetSummonLocation ¶
func (*Session) SetTimeSpeed ¶
func (s *Session) SetTimeSpeed()
func (*Session) SetVisibleItemEntry ¶
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) SyncSpeeds ¶
func (s *Session) SyncSpeeds()
func (*Session) SystemChat ¶
func (*Session) TeleportTo ¶
TeleportTo teleports a player to a new location. This function should be called carefully.
func (*Session) TransferWardenModule ¶
func (s *Session) TransferWardenModule()
func (*Session) UpdateArea ¶
func (s *Session) UpdateArea()
func (*Session) UpdateCameraPosition ¶
func (*Session) UpdatePosition ¶
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 ¶
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 (*Session) WardenResponse ¶
func (*Session) ZoneExplored ¶
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 TerrainMgr ¶
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))
Source Files ¶
- accountprops.go
- achievements.go
- action_buttons.go
- alpha_handshake.go
- character.go
- chat.go
- command.go
- command_handlers.go
- creature.go
- datapacks.go
- emote.go
- equipmentsets.go
- experience.go
- game_object.go
- gossip.go
- group_mgr.go
- intro.go
- item_mgr.go
- loc.go
- modern_handshake.go
- movement.go
- object_sync.go
- player_attributes.go
- plugin.go
- protocol_handlers.go
- quest_mgr.go
- reputation.go
- scripting.go
- server.go
- session.go
- social_mgr.go
- sound.go
- spawn.go
- spell_mgr.go
- talents.go
- teleport.go
- terrain_mgr.go
- trade.go
- warden.go
- world_redirect.go
- world_rpc.go