app_messages

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 3 Imported by: 0

README

These files were all generated from this example protocol, using the default settings for each.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorFromBytes

func ColorFromBytes(data io.Reader, input *Color) error

func GetPackedSize added in v0.3.0

func GetPackedSize(msgList []Message) int

func PackMessages added in v0.3.0

func PackMessages(msgList []Message, data io.Writer)

func SpectrumFromBytes

func SpectrumFromBytes(data io.Reader, input *Spectrum) error

Types

type CharacterClass added in v0.2.0

type CharacterClass byte
const (
	CharacterClassFighter CharacterClass = 0
	CharacterClassWizard  CharacterClass = 1
	CharacterClassRogue   CharacterClass = 2
	CharacterClassCleric  CharacterClass = 3
)

type CharacterJoinedTeam

type CharacterJoinedTeam struct {
	CharacterID uint64
	TeamName    string
	TeamColors  []Color
	Role        TeamRole
}

func CharacterJoinedTeamFromBytes

func CharacterJoinedTeamFromBytes(data io.Reader) (*CharacterJoinedTeam, error)

func NewCharacterJoinedTeamDefault added in v0.2.0

func NewCharacterJoinedTeamDefault() CharacterJoinedTeam

func (CharacterJoinedTeam) GetMessageType

func (output CharacterJoinedTeam) GetMessageType() MessageType

func (CharacterJoinedTeam) GetSizeInBytes

func (output CharacterJoinedTeam) GetSizeInBytes() int

func (CharacterJoinedTeam) WriteBytes

func (output CharacterJoinedTeam) WriteBytes(data io.Writer, tag bool)

type Color

type Color struct {
	Red   float32
	Green float32
	Blue  float32
	Alpha float32
}

func NewColorDefault added in v0.2.0

func NewColorDefault() Color

func (Color) WriteBytes

func (output Color) WriteBytes(data io.Writer)

type Message

type Message interface {
	GetMessageType() MessageType
	WriteBytes(data io.Writer, tag bool)
	GetSizeInBytes() int
}

func ProcessRawBytes

func ProcessRawBytes(data io.Reader, max int) ([]Message, error)

func UnpackMessages added in v0.3.0

func UnpackMessages(data io.Reader) ([]Message, error)

type MessageType

type MessageType byte
const (
	Vector3MessageType      MessageType = 1
	NewCharacterMessageType MessageType = 2
	CharacterJoinedTeamType MessageType = 3
)

type NewCharacterMessage

type NewCharacterMessage struct {
	Id            uint64
	CharacterName string
	Job           CharacterClass
	Strength      uint16
	Intelligence  uint16
	Dexterity     uint16
	Wisdom        uint16
	GoldInWallet  uint32
	Nicknames     []string
}

func NewCharacterMessageFromBytes

func NewCharacterMessageFromBytes(data io.Reader) (*NewCharacterMessage, error)

func NewNewCharacterMessageDefault added in v0.2.0

func NewNewCharacterMessageDefault() NewCharacterMessage

func (NewCharacterMessage) GetMessageType

func (output NewCharacterMessage) GetMessageType() MessageType

func (NewCharacterMessage) GetSizeInBytes

func (output NewCharacterMessage) GetSizeInBytes() int

func (NewCharacterMessage) WriteBytes

func (output NewCharacterMessage) WriteBytes(data io.Writer, tag bool)

type Spectrum

type Spectrum struct {
	DefaultColor Color
	Colors       []Color
}

func NewSpectrumDefault added in v0.2.0

func NewSpectrumDefault() Spectrum

func (Spectrum) WriteBytes

func (output Spectrum) WriteBytes(data io.Writer)

type TeamRole added in v0.2.0

type TeamRole int16
const (
	TeamRoleMinion  TeamRole = 256
	TeamRoleAlly    TeamRole = 512
	TeamRoleLeader  TeamRole = 1024
	TeamRoleTraitor TeamRole = -1
)

type Vector3Message

type Vector3Message struct {
	X float32
	Y float32
	Z float32
}

func NewVector3MessageDefault added in v0.2.0

func NewVector3MessageDefault() Vector3Message

func Vector3MessageFromBytes

func Vector3MessageFromBytes(data io.Reader) (*Vector3Message, error)

func (Vector3Message) GetMessageType

func (output Vector3Message) GetMessageType() MessageType

func (Vector3Message) GetSizeInBytes

func (output Vector3Message) GetSizeInBytes() int

func (Vector3Message) WriteBytes

func (output Vector3Message) WriteBytes(data io.Writer, tag bool)

Jump to

Keyboard shortcuts

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