forked from nielsAD/gowarcraft3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
w3gs.go
29 lines (26 loc) · 834 Bytes
/
w3gs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Author: Niels A.D.
// Project: gowarcraft3 (https://github.com/nielsAD/gowarcraft3)
// License: Mozilla Public License, v2.0
// Package w3gs implements the game protocol for Warcraft III.
//
// Based on protocol documentation by https://bnetdocs.org/
//
// Each packet type is mapped to a struct type that implements the Packet
// interface. To deserialize from a binary stream, use DeserializePacket().
//
// This package tries to keep ammortized heap memory allocations to 0.
//
// General serialization format:
//
// (UINT8) Protocol signature (0xF7)
// (UINT8) Packet type ID
// (UINT16) Packet size
// [Packet Data]
//
package w3gs
import "github.com/nielsAD/gowarcraft3/protocol"
// Packet interface.
type Packet interface {
Serialize(buf *protocol.Buffer) error
Deserialize(buf *protocol.Buffer) error
}