protocol

package
v0.0.0-...-6210f80 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelHeartbeat = 0
	ChannelGameInfo  = 1
	ChannelBusy      = 2
	ChannelData      = 3
	ChannelLocalMap  = 4
	ChannelRequest   = 5
	ChannelResponse  = 6
)

Variables

View Source
var ErrInvalidBinaryProtocol = errors.New("invalid binary protocol")

Functions

This section is empty.

Types

type Command

type Command struct {
	Type int
	Args []interface{}
}

type CommandResponse

type CommandResponse struct {
	ID      int    `json:"id"`
	Allowed bool   `json:"allowed"`
	Message string `json:"message"`
	Success bool   `json:"success"`
}

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Buffered

func (dec *Decoder) Buffered() io.Reader

func (*Decoder) Decode

func (dec *Decoder) Decode() (int, interface{}, error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (enc *Encoder) Encode(cmd Command) (id int, err error)

func (*Encoder) EncodePong

func (enc *Encoder) EncodePong() error

type Extent

type Extent struct {
	X, Y float32
}

type Extents

type Extents struct {
	NW, NE, SW Extent
}

func UnmarshalMap

func UnmarshalMap(r io.Reader, size int) (img image.Image, extents Extents, err error)

type GameInfo

type GameInfo struct {
	Language string `json:"lang"`
	Version  string `json:"version"`
}

{"lang": "en", "version": "1.1.30.0"}

type LocalMap

type LocalMap struct {
	Image   image.Image
	Extents Extents
}

type PipboyMemory

type PipboyMemory struct {
	Added   map[uint32]interface{}
	Removed []uint32
}

func UnmarshalBinary

func UnmarshalBinary(r io.Reader) (memory PipboyMemory, err error)

func (PipboyMemory) MarshalJSON

func (d PipboyMemory) MarshalJSON() ([]byte, error)

type UnknownChannelError

type UnknownChannelError struct {
	Channel int
	Data    []byte
}

func (*UnknownChannelError) Error

func (e *UnknownChannelError) Error() string

Jump to

Keyboard shortcuts

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