Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
document events & attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-wa committed Nov 16, 2019
1 parent 355bbee commit 54b5d6b
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ Usage of csminify:

#### Supported Formats

Format | Command Line (`-format` Flag) | Structure
--- | --- | ---
JSON | `json` | [schema.json](schema.json)
MessagePack | `msgpack`, `mp` | [schema.json](schema.json)
Protocol Buffers | `protobuf`, `proto`, `pb` | [replay.proto](protobuf/gen/proto/replay.proto)
| Format | Command Line (`-format` Flag) | Structure |
| --- | --- | --- |
| JSON | `json` | [schema.json](schema.json) |
| MessagePack | `msgpack`, `mp` | [schema.json](schema.json) |
| Protocol Buffers | `protobuf`, `proto`, `pb` | [replay.proto](protobuf/gen/proto/replay.proto) |

Events and attributes are documented in [events.md](events.md).

More formats can be added programmatically by implementing the `ReplayMarshaller` interface.

Expand All @@ -76,6 +78,8 @@ If you would like to see additional formats supported please open a feature requ
This is an example on how to minify a demo to JSON and decode it to a `replay.Replay` again.

```go
package main

import (
"bytes"
"encoding/json"
Expand Down
86 changes: 86 additions & 0 deletions events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Events

- [`fire`](#fire)
- [`hurt`](#hurt)
- [`kill`](#kill)
- [`flashed`](#flashed)
- [`jump`](#jump)
- [`footstep`](#footstep)
- [`chat_message`](#chat_message)
- [`swap_team`](#swap_team)
- [`disconnect`](#disconnect)
- [`round_started`](#round_started)
- [`round_ended`](#round_ended)

## Attributes

### `fire`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `hurt`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `kill`

| attribute | type | description |
| --- | --- | --- |
| `victim` | `numVal` | EntityID |
| `weapon` | `numVal` | see [`EquipmentElement`](https://godoc.org/github.com/markus-wa/demoinfocs-golang/common#EquipmentElement) |
| `killer` | `numVal` | EntityID |
| `assister` | `numVal` | EntityID |

### `flashed`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `jump`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `footstep`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `chat_message`

| attribute | type | description |
| --- | --- | --- |
| `sender` | `numVal` | EntityID |
| `text` | `strVal` | chat message |

### `swap_team`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `disconnect`

| attribute | type | description |
| --- | --- | --- |
| `entityId` | `numVal` | EntityID |

### `round_started`

| attribute | type | description |
| --- | --- | --- |
| - | - | - |

### `round_ended`

| attribute | type | description |
| --- | --- | --- |
| `winner` | `numVal` | see [`Team`](https://godoc.org/github.com/markus-wa/demoinfocs-golang/common#Team) |
| `reason` | `numVal` | see [`RoundEndReason`](https://godoc.org/github.com/markus-wa/demoinfocs-golang/events#RoundEndReason) |

0 comments on commit 54b5d6b

Please sign in to comment.