Documentation
¶
Index ¶
- Constants
- func CalculateMatchDurationHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func CollectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func PlayerConnectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func PlayerDisconnectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func PlayerTeamHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func PrintAsJson(msg interface{}) error
- func RoundAnnounceMatchStartHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func RoundEndHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func RoundOfficiallyEndHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- func RoundStartHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
- type DemoCmdHeader
- type DemoContext
- type DemoEventDispatcher
- type DemoGameEvent
- type DemoHeader
- type DemoParser
- type DemoStatistic
- type DemoStream
- func (d *DemoStream) CreatePacketStream() *DemoStream
- func (d *DemoStream) GetByte() byte
- func (d *DemoStream) GetCurrentOffset() int
- func (d *DemoStream) GetDataTableString() string
- func (d *DemoStream) GetInt() int32
- func (d *DemoStream) GetInt16() int16
- func (d *DemoStream) GetInt64() int64
- func (d *DemoStream) GetUInt8() uint8
- func (d *DemoStream) GetVarInt() uint64
- func (d *DemoStream) IsProcessed() bool
- func (d *DemoStream) ParseToStruct(msg proto.Message, messageLength uint64) error
- func (d *DemoStream) Read(out []byte) (int, error)
- func (d *DemoStream) Skip(n int64)
- type DispatcherFunc
- type EventDispatcher
- type MatchInfo
- type Player
- type Round
- type ServerClass
Constants ¶
View Source
const ( MaxOSPath = 260 PacketOffset = 160 DemoHeaderID = "HL2DEMO" DemSignon = 1 DemPacket = 2 DemSynctick = 3 DemConsoleCMD = 4 DemUserCMD = 5 DemDatatables = 6 DemStop = 7 DemCustomdata = 8 DemSringTables = 9 )
Variables ¶
This section is empty.
Functions ¶
func CalculateMatchDurationHandler ¶
func CalculateMatchDurationHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func CollectHandler ¶
func CollectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func PlayerConnectHandler ¶
func PlayerConnectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func PlayerDisconnectHandler ¶
func PlayerDisconnectHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func PlayerTeamHandler ¶
func PlayerTeamHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func PrintAsJson ¶
func PrintAsJson(msg interface{}) error
func RoundAnnounceMatchStartHandler ¶
func RoundAnnounceMatchStartHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func RoundEndHandler ¶
func RoundEndHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func RoundOfficiallyEndHandler ¶
func RoundOfficiallyEndHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
func RoundStartHandler ¶
func RoundStartHandler(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
Types ¶
type DemoCmdHeader ¶
type DemoContext ¶
type DemoContext struct {
GameEventList *protom.CSVCMsg_GameEventList
GameEventChan chan *DemoGameEvent
StopChan chan bool
// contains filtered or unexported fields
}
func NewDemoContext ¶
func NewDemoContext(header *DemoHeader) *DemoContext
func (*DemoContext) GetGameEventDescriptor ¶
func (dc *DemoContext) GetGameEventDescriptor(eventid int32) *protom.CSVCMsg_GameEventListDescriptorT
type DemoEventDispatcher ¶
type DemoEventDispatcher struct {
// contains filtered or unexported fields
}
func (*DemoEventDispatcher) Dispatch ¶
func (dispatcher *DemoEventDispatcher) Dispatch(eventName string, event *DemoGameEvent)
func (*DemoEventDispatcher) RegisterHandler ¶
func (dispatcher *DemoEventDispatcher) RegisterHandler(eventName string, handler DispatcherFunc)
type DemoGameEvent ¶
type DemoGameEvent struct {
EventId int32 `json:"eventId"`
Name string `json:"name"`
Tick int32 `json:"-"`
TimeInRound time.Duration `json:"timeInRound"`
Data map[string]interface{} `json:"data"`
}
func NewDemoGameEvent ¶
func NewDemoGameEvent(eventid int32, name string, tick int32) *DemoGameEvent
type DemoHeader ¶
type DemoParser ¶
type DemoParser struct {
Header *DemoHeader
Context *DemoContext
// contains filtered or unexported fields
}
func NewDemoParser ¶
func NewDemoParser(path string) (*DemoParser, error)
func (*DemoParser) ParseTicks ¶
func (dp *DemoParser) ParseTicks()
func (*DemoParser) PrintHeader ¶
func (dp *DemoParser) PrintHeader()
type DemoStatistic ¶
type DemoStatistic struct {
MatchInfo *MatchInfo `json:"matchInfo"`
MatchStartTick int32 `json:"-"`
Rounds []*Round `json:"rounds"`
UnmappedEvents []*DemoGameEvent `json:"unmappedEvents"`
// contains filtered or unexported fields
}
func NewDemoStatistic ¶
func NewDemoStatistic(demoHeader *DemoHeader) *DemoStatistic
func (*DemoStatistic) AddNewRound ¶
func (ds *DemoStatistic) AddNewRound(startTick int32)
func (*DemoStatistic) FindRoundByTick ¶
func (ds *DemoStatistic) FindRoundByTick(tick int32) (round *Round, found bool)
func (*DemoStatistic) RemoveWarmupRounds ¶
func (ds *DemoStatistic) RemoveWarmupRounds()
func (*DemoStatistic) RenumberRounds ¶
func (ds *DemoStatistic) RenumberRounds()
type DemoStream ¶
type DemoStream struct {
// contains filtered or unexported fields
}
func NewDemoStream ¶
func NewDemoStream(reader io.ReadSeeker, length int32) *DemoStream
func (*DemoStream) CreatePacketStream ¶
func (d *DemoStream) CreatePacketStream() *DemoStream
func (*DemoStream) GetByte ¶
func (d *DemoStream) GetByte() byte
func (*DemoStream) GetCurrentOffset ¶
func (d *DemoStream) GetCurrentOffset() int
func (*DemoStream) GetDataTableString ¶
func (d *DemoStream) GetDataTableString() string
func (*DemoStream) GetInt ¶
func (d *DemoStream) GetInt() int32
func (*DemoStream) GetInt16 ¶
func (d *DemoStream) GetInt16() int16
func (*DemoStream) GetInt64 ¶
func (d *DemoStream) GetInt64() int64
func (*DemoStream) GetUInt8 ¶
func (d *DemoStream) GetUInt8() uint8
func (*DemoStream) GetVarInt ¶
func (d *DemoStream) GetVarInt() uint64
func (*DemoStream) IsProcessed ¶
func (d *DemoStream) IsProcessed() bool
func (*DemoStream) ParseToStruct ¶
func (d *DemoStream) ParseToStruct(msg proto.Message, messageLength uint64) error
func (*DemoStream) Skip ¶
func (d *DemoStream) Skip(n int64)
type DispatcherFunc ¶
type DispatcherFunc func(context DemoContext, demoStatistic *DemoStatistic, event *DemoGameEvent)
type EventDispatcher ¶
type EventDispatcher interface {
Dispatch(eventName string, event *DemoGameEvent)
RegisterHandler(eventName string, handler DispatcherFunc)
}
func NewDemoEventDispatcher ¶
func NewDemoEventDispatcher(statistic *DemoStatistic, context *DemoContext) EventDispatcher
type MatchInfo ¶
type MatchInfo struct {
Map string `json:"map"`
ServerName string `json:"serverName"`
Players []*Player `json:"players"`
Duration time.Duration `json:"duration"`
// contains filtered or unexported fields
}
func (*MatchInfo) RemovePlayer ¶
type Round ¶
type Round struct {
Nr int `json:"nr"`
Duration time.Duration `json:"duration"`
Winner int `json:"winner"`
Reason int `json:"reason"`
Events []*DemoGameEvent `json:"events"`
StartTick int32 `json:"-"`
EndTick int32 `json:"-"`
// contains filtered or unexported fields
}
func (*Round) AddEvent ¶
func (r *Round) AddEvent(event *DemoGameEvent)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
demoparser-cli
command
|
|
|
demoparser-worker
command
|
|
|
Package main is a generated protocol buffer package.
|
Package main is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.