playerinfo

package
v0.26.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAction

func ContainsAction(actions []UpsertAction, action UpsertAction) bool

ContainsAction returns true if the given action is contained in the given action set.

Types

type Entry

type Entry struct {
	ProfileID         uuid.UUID
	Profile           profile.GameProfile
	Listed            bool
	Latency           int // in milliseconds
	GameMode          int
	DisplayName       component.Component     // nil-able
	RemoteChatSession *chat.RemoteChatSession // nil-able
}

type Remove

type Remove struct {
	PlayersToRemove []uuid.UUID
}

func (*Remove) Decode

func (r *Remove) Decode(c *proto.PacketContext, rd io.Reader) (err error)

func (*Remove) Encode

func (r *Remove) Encode(c *proto.PacketContext, wr io.Writer) error

type Upsert

type Upsert struct {
	ActionSet []UpsertAction
	Entries   []*Entry
}

func (*Upsert) Decode

func (u *Upsert) Decode(c *proto.PacketContext, rd io.Reader) (err error)

func (*Upsert) Encode

func (u *Upsert) Encode(c *proto.PacketContext, wr io.Writer) error

type UpsertAction

type UpsertAction interface {
	Encode(c *proto.PacketContext, wr io.Writer, info *Entry) error
	Decode(c *proto.PacketContext, rd io.Reader, info *Entry) (err error)
}
var (
	AddPlayerAction         UpsertAction = &addAction{}
	InitializeChatAction    UpsertAction = &initChatAction{}
	UpdateGameModeAction    UpsertAction = &updateGameModeAction{}
	UpdateListedAction      UpsertAction = &updateListedAction{}
	UpdateLatencyAction     UpsertAction = &updateLatencyAction{}
	UpdateDisplayNameAction UpsertAction = &updateDisplayNameAction{}

	UpsertActions = []UpsertAction{
		AddPlayerAction,
		InitializeChatAction,
		UpdateGameModeAction,
		UpdateListedAction,
		UpdateLatencyAction,
		UpdateDisplayNameAction,
	}
)

UpsertActions

Jump to

Keyboard shortcuts

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