chat

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

Documentation

Overview

package chat contains packets relating to the in-game chatbox feature.

Index

Constants

View Source
const (
	MsgAddon = iota
	MsgSay
	MsgParty
	MsgRaid
	MsgGuild
	MsgOfficer
	MsgYell
	MsgWhisper
	MsgWhisperForeign
	MsgWhisperInform
	MsgEmote
	MsgTextEmote
	MsgSystem
	MsgCreatureSay
	MsgCreatureYell
	MsgCreatureWhisper
	MsgCreatureEmote
	MsgChannel
	MsgChannelJoin
	MsgChannelLeave
	MsgChannelList
	MsgChannelNotice
	MsgChannelNoticeUser
	MsgAFK
	MsgDND
	MsgIgnored
	MsgSkill
	MsgLoot
	MsgMoney
	MsgOpening
	MsgBGSystemNeutral
	MsgBGSystemBlueTeam
	MsgBGSystemRedTeam
	MsgRaidLeader
	MsgRaidWarning
	MsgRaidBossWhisper
	MsgRaidBossEmote
	MsgBattleground
	MsgBattlegroundLeader
	MsgCreatureParty
	MsgTradeSkills
	MsgPetInfo
	MsgCombatMiscInfo
	MsgCombatXPGain
	MsgCombatHonorGain
	MsgCombatFactionGain
	MsgFiltered
	MsgRestricted
	MsgBNet
	MsgAchievement
	MsgGuildAchievement
	MsgArenaPoints
	MsgPartyLeader
	MsgBNetWhisper
	MsgBNetWhisperInform
	MsgBNetConversation
	MsgBNetConversationNotice
	MsgBNetConversationList
	MsgBNetInlineToastAlert
	MsgBNetInlineToastBroadcast
	MsgBNetInlineToastBroadcastInform
	MsgBNetInlineToastConversation
	MsgBNetWhisperPlayerOffline
	MsgCombatGuildXPGain
	MsgCurrency
)
View Source
const (
	LangUniversal = 0
	LangRedTeam   = 1
	LangBlueTeam  = 7
	LangAddon     = 0xFFFFFFFF
)

Variables

View Source
var MsgTypeDescriptors = map[vsn.BuildRange]MsgTypeDescriptor{
	vsn.Range(0, 3368): {
		MsgSay:               0x00,
		MsgParty:             0x01,
		MsgGuild:             0x02,
		MsgOfficer:           0x03,
		MsgYell:              0x04,
		MsgWhisper:           0x05,
		MsgWhisperInform:     0x06,
		MsgEmote:             0x07,
		MsgTextEmote:         0x08,
		MsgSystem:            0x09,
		MsgCreatureSay:       0x0A,
		MsgCreatureYell:      0x0B,
		MsgCreatureEmote:     0x0C,
		MsgChannel:           0x0D,
		MsgChannelJoin:       0x0E,
		MsgChannelLeave:      0xF,
		MsgChannelList:       0x10,
		MsgChannelNotice:     0x11,
		MsgChannelNoticeUser: 0x12,
		MsgAFK:               0x13,
		MsgDND:               0x14,
		MsgIgnored:           0x16,
		MsgSkill:             0x17,
		MsgLoot:              0x18,
	},

	vsn.Range(5875, 6005): {
		MsgAddon:              0xFFFFFFFF,
		MsgSay:                0x00,
		MsgParty:              0x01,
		MsgRaid:               0x02,
		MsgGuild:              0x03,
		MsgOfficer:            0x04,
		MsgYell:               0x05,
		MsgWhisper:            0x06,
		MsgWhisperInform:      0x07,
		MsgEmote:              0x08,
		MsgTextEmote:          0x09,
		MsgSystem:             0x0A,
		MsgCreatureSay:        0x0B,
		MsgCreatureYell:       0x0C,
		MsgCreatureEmote:      0x0D,
		MsgChannel:            0x0E,
		MsgChannelJoin:        0x0F,
		MsgChannelLeave:       0x10,
		MsgChannelList:        0x11,
		MsgChannelNotice:      0x12,
		MsgChannelNoticeUser:  0x13,
		MsgAFK:                0x14,
		MsgDND:                0x15,
		MsgIgnored:            0x16,
		MsgSkill:              0x17,
		MsgLoot:               0x18,
		MsgCreatureWhisper:    0x1A,
		MsgBGSystemNeutral:    0x52,
		MsgBGSystemBlueTeam:   0x53,
		MsgBGSystemRedTeam:    0x54,
		MsgRaidLeader:         0x57,
		MsgRaidWarning:        0x58,
		MsgRaidBossWhisper:    0x59,
		MsgRaidBossEmote:      0x5A,
		MsgBattleground:       0x5C,
		MsgBattlegroundLeader: 0x5D,
	},

	vsn.Range(6180, 8606): {
		MsgAddon:              0xFFFFFFFF,
		MsgSystem:             0x00,
		MsgSay:                0x01,
		MsgParty:              0x02,
		MsgRaid:               0x03,
		MsgGuild:              0x04,
		MsgOfficer:            0x05,
		MsgYell:               0x06,
		MsgWhisper:            0x07,
		MsgWhisperForeign:     0x08,
		MsgWhisperInform:      0x09,
		MsgEmote:              0x0A,
		MsgTextEmote:          0x0B,
		MsgCreatureSay:        0x0C,
		MsgCreatureParty:      0x0D,
		MsgCreatureYell:       0x0E,
		MsgCreatureWhisper:    0x0F,
		MsgCreatureEmote:      0x10,
		MsgChannel:            0x11,
		MsgChannelJoin:        0x12,
		MsgChannelLeave:       0x13,
		MsgChannelList:        0x14,
		MsgChannelNotice:      0x15,
		MsgChannelNoticeUser:  0x16,
		MsgAFK:                0x17,
		MsgDND:                0x18,
		MsgIgnored:            0x19,
		MsgSkill:              0x1A,
		MsgLoot:               0x1B,
		MsgMoney:              0x1C,
		MsgOpening:            0x1D,
		MsgTradeSkills:        0x1E,
		MsgPetInfo:            0x1F,
		MsgCombatMiscInfo:     0x20,
		MsgCombatXPGain:       0x21,
		MsgCombatHonorGain:    0x22,
		MsgCombatFactionGain:  0x23,
		MsgBGSystemNeutral:    0x24,
		MsgBGSystemBlueTeam:   0x25,
		MsgBGSystemRedTeam:    0x26,
		MsgRaidLeader:         0x27,
		MsgRaidWarning:        0x28,
		MsgRaidBossEmote:      0x29,
		MsgRaidBossWhisper:    0x2A,
		MsgFiltered:           0x2B,
		MsgBattleground:       0x2C,
		MsgBattlegroundLeader: 0x2D,
		MsgRestricted:         0x2E,
	},

	vsn.Range(9056, 12340): {
		MsgAddon:                          0xFFFFFFFF,
		MsgSystem:                         0x00,
		MsgSay:                            0x01,
		MsgParty:                          0x02,
		MsgRaid:                           0x03,
		MsgGuild:                          0x04,
		MsgOfficer:                        0x05,
		MsgYell:                           0x06,
		MsgWhisper:                        0x07,
		MsgWhisperForeign:                 0x08,
		MsgWhisperInform:                  0x09,
		MsgEmote:                          0x0A,
		MsgTextEmote:                      0x0B,
		MsgCreatureSay:                    0x0C,
		MsgCreatureParty:                  0x0D,
		MsgCreatureYell:                   0x0E,
		MsgCreatureWhisper:                0x0F,
		MsgCreatureEmote:                  0x10,
		MsgChannel:                        0x11,
		MsgChannelJoin:                    0x12,
		MsgChannelLeave:                   0x13,
		MsgChannelList:                    0x14,
		MsgChannelNotice:                  0x15,
		MsgChannelNoticeUser:              0x16,
		MsgAFK:                            0x17,
		MsgDND:                            0x18,
		MsgIgnored:                        0x19,
		MsgSkill:                          0x1A,
		MsgLoot:                           0x1B,
		MsgMoney:                          0x1C,
		MsgOpening:                        0x1D,
		MsgTradeSkills:                    0x1E,
		MsgPetInfo:                        0x1F,
		MsgCombatMiscInfo:                 0x20,
		MsgCombatXPGain:                   0x21,
		MsgCombatHonorGain:                0x22,
		MsgCombatFactionGain:              0x23,
		MsgBGSystemNeutral:                0x24,
		MsgBGSystemBlueTeam:               0x25,
		MsgBGSystemRedTeam:                0x26,
		MsgRaidLeader:                     0x27,
		MsgRaidWarning:                    0x28,
		MsgRaidBossEmote:                  0x29,
		MsgRaidBossWhisper:                0x2A,
		MsgFiltered:                       0x2B,
		MsgBattleground:                   0x2C,
		MsgBattlegroundLeader:             0x2D,
		MsgRestricted:                     0x2E,
		MsgBNet:                           0x2F,
		MsgAchievement:                    0x30,
		MsgGuildAchievement:               0x31,
		MsgArenaPoints:                    0x32,
		MsgPartyLeader:                    0x33,
		MsgBNetWhisper:                    0x35,
		MsgBNetWhisperInform:              0x36,
		MsgBNetConversation:               0x37,
		MsgBNetConversationNotice:         0x38,
		MsgBNetConversationList:           0x39,
		MsgBNetInlineToastAlert:           0x3A,
		MsgBNetInlineToastBroadcast:       0x3B,
		MsgBNetInlineToastBroadcastInform: 0x3C,
		MsgBNetInlineToastConversation:    0x3D,
		MsgBNetWhisperPlayerOffline:       0x3E,
		MsgCombatGuildXPGain:              0x3F,
		MsgCurrency:                       0x40,
	},
}
View Source
var TagDescriptors = map[vsn.BuildRange]TagDescriptor{
	{0, 5875}: {
		TagNone: 0,
		TagAFK:  1,
		TagDND:  2,
		TagGM:   3,
	},

	{vsn.V2_0_1, vsn.Max}: {
		TagNone:        0x00,
		TagAFK:         0x01,
		TagDND:         0x02,
		TagGM:          0x04,
		TagCommentator: 0x08,
		TagDeveloper:   0x10,
	},
}

Functions

func ConvertMsgType

func ConvertMsgType(build vsn.Build, value MsgType) (uint32, error)

func DecodeChatString

func DecodeChatString(build vsn.Build, in *etc.Buffer) string

func EncodeChatString

func EncodeChatString(build vsn.Build, out *etc.Buffer, str string)

Types

type ClientMessage

type ClientMessage struct {
	Type     MsgType
	Language Language
	To       string
	Body     string
}

func (*ClientMessage) Decode

func (msg *ClientMessage) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*ClientMessage) Encode

func (msg *ClientMessage) Encode(build vsn.Build, out *packet.WorldPacket) error

type Emote

type Emote struct {
	Emote uint32
	GUID  guid.GUID
}

func (*Emote) Decode

func (em *Emote) Decode(build vsn.Build, in *packet.WorldPacket) (err error)

func (*Emote) Encode

func (em *Emote) Encode(build vsn.Build, out *packet.WorldPacket) error

type Error

type Error struct {
	Type packet.WorldType
	Name string
}

func (*Error) Decode

func (e *Error) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*Error) Encode

func (e *Error) Encode(build vsn.Build, out *packet.WorldPacket) error

type HyperlinkData

type HyperlinkData struct {
	Type   string
	Fields []string
}

func (HyperlinkData) String

func (h HyperlinkData) String() string

type Language

type Language uint32

type LearnedDanceMoves

type LearnedDanceMoves struct {
	Mask [2]uint32
}

func (*LearnedDanceMoves) Decode

func (ldm *LearnedDanceMoves) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*LearnedDanceMoves) Encode

func (ldm *LearnedDanceMoves) Encode(build vsn.Build, out *packet.WorldPacket) error

type MOTD

type MOTD struct {
	Lines []string
}

func (*MOTD) Decode

func (m *MOTD) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*MOTD) Encode

func (m *MOTD) Encode(build vsn.Build, out *packet.WorldPacket) error

type Markup

type Markup struct {
	Type MarkupType
	Text string
	Data MarkupData
}

func ParseMarkup

func ParseMarkup(s string) (*Markup, error)

func (*Markup) ExtractHyperlinkData

func (m *Markup) ExtractHyperlinkData() (HyperlinkData, error)

func (*Markup) String

func (m *Markup) String() string

type MarkupData

type MarkupData interface {
	String() string
}

type MarkupType

type MarkupType uint8
const (
	Color     MarkupType = 'c'
	Hyperlink MarkupType = 'H'
)

type MsgType

type MsgType uint8

func ResolveMsgType

func ResolveMsgType(build vsn.Build, code uint32) (MsgType, error)

type MsgTypeDescriptor

type MsgTypeDescriptor map[MsgType]uint32

type ServerMessage

type ServerMessage struct {
	Type        MsgType
	Language    Language
	ChannelName string
	PlayerRank  uint32
	Name        string
	SenderGUID  guid.GUID
	TargetGUID  guid.GUID
	TargetName  string
	Body        string
	Tag         Tag
}

func (*ServerMessage) Decode

func (msg *ServerMessage) Decode(build vsn.Build, in *packet.WorldPacket) error

func (*ServerMessage) Encode

func (msg *ServerMessage) Encode(build vsn.Build, out *packet.WorldPacket) error

type Tag

type Tag uint8
const (
	TagNone Tag = iota
	TagAFK
	TagDND
	TagGM
	TagCommentator
	TagDeveloper
)

func (*Tag) Decode

func (myTag *Tag) Decode(build vsn.Build, in io.Reader) error

func (*Tag) Encode

func (myTag *Tag) Encode(build vsn.Build, out io.Writer) error

type TagDescriptor

type TagDescriptor map[Tag]uint8

type TextEmote

type TextEmote struct {
	GUID  guid.GUID
	Text  uint32
	Emote uint32
	Name  string
}

func (*TextEmote) Decode

func (em *TextEmote) Decode(build vsn.Build, in *packet.WorldPacket) (err error)

func (*TextEmote) Encode

func (em *TextEmote) Encode(build vsn.Build, out *packet.WorldPacket) error

type TextEmoteRequest

type TextEmoteRequest struct {
	Text  uint32
	Emote uint32
	GUID  guid.GUID
}

func (*TextEmoteRequest) Decode

func (em *TextEmoteRequest) Decode(build vsn.Build, in *packet.WorldPacket) (err error)

func (*TextEmoteRequest) Encode

func (em *TextEmoteRequest) Encode(build vsn.Build, out *packet.WorldPacket) error

Jump to

Keyboard shortcuts

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