Versions in this module Expand all Collapse all v1 v1.6.0 Apr 11, 2020 Changes in this version + const RidPlayerExtra + type PlayerExtra struct + func (rec *PlayerExtra) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *PlayerExtra) Serialize(buf *protocol.Buffer, enc *Encoding) error type Replay + PlayerExtra []*PlayerExtra + PlayerInfo []*PlayerInfo v1.5.0 Apr 23, 2019 Changes in this version + const RidChatMessage + const RidCountDownEnd + const RidCountDownStart + const RidDesync + const RidEndTimer + const RidGameInfo + const RidGameStart + const RidPlayerInfo + const RidPlayerLeft + const RidSlotInfo + const RidTimeSlot + const RidTimeSlot2 + const RidTimeSlotAck + var DefaultFactory = MapFactory + var ErrBadFormat = errors.New("w3g: Invalid file format") + var ErrInvalidChecksum = errors.New("w3g: Checksum invalid") + var ErrUnexpectedConst = errors.New("w3g: Unexpected constant value") + var ErrUnknownRecord = errors.New("w3g: Unknown record ID") + var Signature = "Warcraft III recorded game\x1A" + func DecodeHeader(r io.Reader, f RecordFactory) (*Header, *Decompressor, int, error) + func FindHeader(r Peeker) (int, error) + func SerializeRecord(r Record, e Encoding) ([]byte, error) + func WriteRecord(w io.Writer, r Record, e Encoding) (int, error) + type BlockCompressor struct + NumBlocks uint32 + SizeTotal uint32 + SizeWritten uint32 + func NewBlockCompressor(w io.Writer) *BlockCompressor + func (d *BlockCompressor) Write(b []byte) (int, error) + type CacheFactory struct + func (f CacheFactory) NewRecord(rid uint8, enc *Encoding) Record + type ChatMessage struct + func (rec *ChatMessage) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *ChatMessage) Serialize(buf *protocol.Buffer, enc *Encoding) error + type Compressor struct + func NewCompressor(w io.Writer, e Encoding) *Compressor + func NewCompressorSize(w io.Writer, e Encoding, size int) *Compressor + func (d *Compressor) Close() error + func (d *Compressor) Write(p []byte) (int, error) + func (d *Compressor) WriteRecord(r Record) (int, error) + func (d *Compressor) WriteRecords(r ...Record) (int, error) + type CountDownEnd struct + func (rec *CountDownEnd) Serialize(buf *protocol.Buffer, enc *Encoding) error + type CountDownStart struct + func (rec *CountDownStart) Serialize(buf *protocol.Buffer, enc *Encoding) error + type Decompressor struct + NumBlocks uint32 + SizeBlock uint16 + SizeRead uint32 + SizeTotal uint32 + func NewDecompressor(r io.Reader, e Encoding, f RecordFactory, numBlocks uint32, sizeTotal uint32) *Decompressor + func (d *Decompressor) ForEach(f func(r Record) error) error + func (d *Decompressor) Read(b []byte) (int, error) + type Desync struct + func (rec *Desync) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *Desync) Serialize(buf *protocol.Buffer, enc *Encoding) error + type Encoder struct + func NewEncoder(w io.Writer, e Encoding) (*Encoder, error) + func (e *Encoder) Close() error + type Encoding struct + type EndTimer struct + CountDownSec uint32 + GameOver bool + func (rec *EndTimer) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *EndTimer) Serialize(buf *protocol.Buffer, enc *Encoding) error + type FactoryFunc func(enc *Encoding) Record + type GameInfo struct + GameFlags w3gs.GameFlags + GameName string + GameSettings w3gs.GameSettings + HostPlayer PlayerInfo + LanguageID uint32 + NumSlots uint32 + func (rec *GameInfo) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *GameInfo) Serialize(buf *protocol.Buffer, enc *Encoding) error + type GameStart struct + func (rec *GameStart) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *GameStart) Serialize(buf *protocol.Buffer, enc *Encoding) error + type Header struct + BuildNumber uint16 + DurationMS uint32 + GameVersion w3gs.GameVersion + SinglePlayer bool + func (h *Header) Encoding() Encoding + type MapFactory map[uint8]FactoryFunc + func (f MapFactory) NewRecord(rid uint8, enc *Encoding) Record + type Peeker interface + Discard func(n int) (discarded int, err error) + Peek func(n int) ([]byte, error) + type PlayerInfo struct + ID uint8 + JoinCounter uint32 + Name string + Race w3gs.RacePref + func (rec *PlayerInfo) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *PlayerInfo) DeserializeContent(buf *protocol.Buffer, enc *Encoding) error + func (rec *PlayerInfo) Serialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *PlayerInfo) SerializeContent(buf *protocol.Buffer, enc *Encoding) + type PlayerLeft struct + Counter uint32 + Local bool + PlayerID uint8 + Reason w3gs.LeaveReason + func (rec *PlayerLeft) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *PlayerLeft) Serialize(buf *protocol.Buffer, enc *Encoding) error + type Record interface + Deserialize func(buf *protocol.Buffer, enc *Encoding) error + Serialize func(buf *protocol.Buffer, enc *Encoding) error + func DeserializeRecord(b []byte, e Encoding) (Record, int, error) + func ReadRecord(r Peeker, e Encoding) (Record, int, error) + type RecordDecoder struct + func NewRecordDecoder(e Encoding, f RecordFactory) *RecordDecoder + func (dec *RecordDecoder) Deserialize(b []byte) (Record, int, error) + func (dec *RecordDecoder) Read(r Peeker) (Record, int, error) + type RecordEncoder struct + func NewRecordEncoder(e Encoding) *RecordEncoder + func (enc *RecordEncoder) Serialize(r Record) ([]byte, error) + func (enc *RecordEncoder) Write(w io.Writer, r Record) (int, error) + type RecordFactory interface + NewRecord func(rid uint8, enc *Encoding) Record + func NewFactoryCache(factory RecordFactory) RecordFactory + type Replay struct + Players []*PlayerInfo + Records []Record + func Decode(r io.Reader) (*Replay, error) + func Open(name string) (*Replay, error) + func (r *Replay) Encode(w io.Writer) error + func (r *Replay) Save(name string) error + type SlotInfo struct + func (rec *SlotInfo) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *SlotInfo) Serialize(buf *protocol.Buffer, enc *Encoding) error + type TimeSlot struct + func (rec *TimeSlot) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *TimeSlot) Serialize(buf *protocol.Buffer, enc *Encoding) error + type TimeSlotAck struct + Checksum []byte + func (rec *TimeSlotAck) Deserialize(buf *protocol.Buffer, enc *Encoding) error + func (rec *TimeSlotAck) Serialize(buf *protocol.Buffer, enc *Encoding) error