diff --git a/csminify.go b/csminify.go index 13265c1..c378989 100644 --- a/csminify.go +++ b/csminify.go @@ -9,6 +9,7 @@ import ( r3 "github.com/golang/geo/r3" dem "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs" + common "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/common" events "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events" rep "github.com/markus-wa/cs-demo-minifier/replay" @@ -163,6 +164,7 @@ func (m *minifier) snapshot() rep.Snapshot { AngleY: int(pl.ViewDirectionY()), HasHelmet: pl.HasHelmet(), HasDefuseKit: pl.HasDefuseKit(), + Equipment: toEntityEquipment(pl.Weapons()), } // FIXME: Smoothify Positions @@ -201,3 +203,15 @@ func r3VectorToPoint(v r3.Vector) rep.Point { func roundTo(x, precision float64) float64 { return math.Round(x/precision) * precision } + +func toEntityEquipment(eq []*common.Equipment) []rep.EntityEquipment { + var equipmentForPlayer = make([]rep.EntityEquipment, 0, len(eq)) + + for _, equipment := range eq { + equipmentForPlayer = append(equipmentForPlayer, rep.EntityEquipment{ + Type: int(equipment.Type), + }) + } + + return equipmentForPlayer +} diff --git a/examples/minimal.json b/examples/minimal.json index 01f21fc..6818e5d 100644 --- a/examples/minimal.json +++ b/examples/minimal.json @@ -5,37 +5,6 @@ "snapshotRate": 51 }, "entities": [ - { - "id": 5, - "name": "ALEX * Intel", - "team": 2 - }, - { - "id": 7, - "name": "Ex6TenZ-BALLISTIX", - "team": 2 - }, - { - "id": 8, - "name": "eswc.com | Samy", - "team": 1 - }, - { - "id": 10, - "name": "syrsoNR", - "team": 3 - }, - { - "id": 1, - "name": "ESWC TV - By VeryGames.net", - "team": 0, - "isNpc": true - }, - { - "id": 2, - "name": "xms*ASUS ♥ /F/", - "team": 2 - }, { "id": 3, "name": "to1nou * Seagate", @@ -46,6 +15,11 @@ "name": "tiziaN", "team": 3 }, + { + "id": 12, + "name": "Ptikrazy", + "team": 1 + }, { "id": 13, "name": "keev", @@ -61,14 +35,40 @@ "name": "crisby", "team": 3 }, + { + "id": 10, + "name": "syrsoNR", + "team": 3 + }, { "id": 11, "name": "mistou * Cooler Master", "team": 2 }, { - "id": 12, - "name": "Ptikrazy", + "id": 1, + "name": "ESWC TV - By VeryGames.net", + "team": 0, + "isNpc": true + }, + { + "id": 2, + "name": "xms*ASUS ♥ /F/", + "team": 2 + }, + { + "id": 5, + "name": "ALEX * Intel", + "team": 2 + }, + { + "id": 7, + "name": "Ex6TenZ-BALLISTIX", + "team": 2 + }, + { + "id": 8, + "name": "eswc.com | Samy", "team": 1 }, { @@ -81,6 +81,102 @@ { "tick": 51, "entityUpdates": [ + { + "entityId": 11, + "positions": [ + { + "x": 529, + "y": -250, + "z": 1748 + } + ], + "angleX": 195, + "angleY": 6, + "hp": 16, + "armor": 98, + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 4 + } + ] + }, + { + "entityId": 4, + "positions": [ + { + "x": -817, + "y": -451, + "z": 1614 + } + ], + "angleX": 92, + "angleY": 12, + "hp": 97, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] + }, + { + "entityId": 3, + "positions": [ + { + "x": 555, + "y": 186, + "z": 1613 + } + ], + "angleX": 187, + "angleY": 357, + "hp": 100, + "armor": 100, + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 2 + }, + { + "type": 303 + } + ] + }, + { + "entityId": 2, + "positions": [ + { + "x": 513, + "y": -85, + "z": 1744 + } + ], + "angleX": 170, + "angleY": 4, + "hp": 24, + "armor": 83, + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 2 + }, + { + "type": 303 + } + ] + }, { "entityId": 5, "positions": [ @@ -94,19 +190,15 @@ "angleY": 357, "hp": 11, "armor": 86, - "hasHelmet": true - }, - { - "entityId": 7, - "positions": [ + "hasHelmet": true, + "equipment": [ { - "x": 2973, - "y": 250, - "z": 1613 + "type": 405 + }, + { + "type": 3 } - ], - "angleX": 182, - "hp": 100 + ] }, { "entityId": 13, @@ -119,7 +211,15 @@ ], "angleX": 270, "angleY": 359, - "hp": 100 + "hp": 100, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] }, { "entityId": 14, @@ -134,65 +234,41 @@ "angleY": 8, "hp": 8, "armor": 86, - "hasHelmet": true - }, - { - "entityId": 11, - "positions": [ + "hasHelmet": true, + "equipment": [ { - "x": 529, - "y": -250, - "z": 1748 - } - ], - "angleX": 195, - "angleY": 6, - "hp": 16, - "armor": 98, - "hasHelmet": true - }, - { - "entityId": 2, - "positions": [ + "type": 405 + }, { - "x": 513, - "y": -85, - "z": 1744 + "type": 9 + }, + { + "type": 309 + }, + { + "type": 505 } - ], - "angleX": 170, - "angleY": 4, - "hp": 24, - "armor": 83, - "hasHelmet": true + ] }, { - "entityId": 3, + "entityId": 7, "positions": [ { - "x": 555, - "y": 186, + "x": 2973, + "y": 250, "z": 1613 } ], - "angleX": 187, - "angleY": 357, + "angleX": 182, "hp": 100, - "armor": 100, - "hasHelmet": true - }, - { - "entityId": 4, - "positions": [ + "equipment": [ { - "x": -817, - "y": -451, - "z": 1614 + "type": 405 + }, + { + "type": 2 } - ], - "angleX": 92, - "angleY": 12, - "hp": 97 + ] }, { "entityId": 10, @@ -204,7 +280,15 @@ } ], "angleX": 270, - "hp": 100 + "hp": 100, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] } ] }, @@ -212,16 +296,24 @@ "tick": 102, "entityUpdates": [ { - "entityId": 10, + "entityId": 7, "positions": [ { - "x": -1382, - "y": 815, - "z": 1614 + "x": 2973, + "y": 250, + "z": 1613 } ], - "angleX": 270, - "hp": 100 + "angleX": 182, + "hp": 100, + "equipment": [ + { + "type": 405 + }, + { + "type": 2 + } + ] }, { "entityId": 3, @@ -235,47 +327,39 @@ "angleX": 150, "hp": 100, "armor": 100, - "hasHelmet": true - }, - { - "entityId": 4, - "positions": [ + "hasHelmet": true, + "equipment": [ { - "x": -840, - "y": 37, - "z": 1614 + "type": 405 + }, + { + "type": 2 + }, + { + "type": 303 } - ], - "angleX": 87, - "angleY": 11, - "hp": 97 + ] }, { - "entityId": 5, + "entityId": 13, "positions": [ { - "x": -29, - "y": 368, - "z": 1613 + "x": -1572, + "y": 722, + "z": 1614 } ], - "angleX": 101, - "angleY": 353, - "hp": 11, - "armor": 86, - "hasHelmet": true - }, - { - "entityId": 7, - "positions": [ + "angleX": 270, + "angleY": 359, + "hp": 100, + "equipment": [ { - "x": 2973, - "y": 250, - "z": 1613 + "type": 405 + }, + { + "type": 9 } - ], - "angleX": 182, - "hp": 100 + ] }, { "entityId": 14, @@ -290,20 +374,21 @@ "angleY": 8, "hp": 8, "armor": 86, - "hasHelmet": true - }, - { - "entityId": 9, - "positions": [ + "hasHelmet": true, + "equipment": [ { - "x": -1394, - "y": 515, - "z": 1614 + "type": 505 + }, + { + "type": 405 + }, + { + "type": 9 + }, + { + "type": 309 } - ], - "angleX": 281, - "angleY": 2, - "hp": 100 + ] }, { "entityId": 11, @@ -318,7 +403,15 @@ "angleY": 1, "hp": 16, "armor": 98, - "hasHelmet": true + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 4 + } + ] }, { "entityId": 2, @@ -333,20 +426,103 @@ "angleY": 8, "hp": 24, "armor": 83, - "hasHelmet": true + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 2 + }, + { + "type": 303 + } + ] }, { - "entityId": 13, + "entityId": 9, "positions": [ { - "x": -1572, - "y": 722, + "x": -1394, + "y": 515, + "z": 1614 + } + ], + "angleX": 281, + "angleY": 2, + "hp": 100, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] + }, + { + "entityId": 10, + "positions": [ + { + "x": -1382, + "y": 815, "z": 1614 } ], "angleX": 270, - "angleY": 359, - "hp": 100 + "hp": 100, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] + }, + { + "entityId": 4, + "positions": [ + { + "x": -840, + "y": 37, + "z": 1614 + } + ], + "angleX": 87, + "angleY": 11, + "hp": 97, + "equipment": [ + { + "type": 405 + }, + { + "type": 9 + } + ] + }, + { + "entityId": 5, + "positions": [ + { + "x": -29, + "y": 368, + "z": 1613 + } + ], + "angleX": 101, + "angleY": 353, + "hp": 11, + "armor": 86, + "hasHelmet": true, + "equipment": [ + { + "type": 405 + }, + { + "type": 3 + } + ] } ] } diff --git a/examples/minimal.mp b/examples/minimal.mp index b2d36f6..3f76d65 100644 Binary files a/examples/minimal.mp and b/examples/minimal.mp differ diff --git a/examples/minimal.pb b/examples/minimal.pb index 94752b7..8dbaf6b 100644 Binary files a/examples/minimal.pb and b/examples/minimal.pb differ diff --git a/protobuf/gen/proto/replay.proto b/protobuf/gen/proto/replay.proto index 0d9aa39..878ef3a 100644 --- a/protobuf/gen/proto/replay.proto +++ b/protobuf/gen/proto/replay.proto @@ -30,6 +30,10 @@ message Replay { } message Snapshot { + message EntityEquipment { + int32 type = 1; + } + message EntityUpdate{ int32 entityId = 1; repeated Point positions = 2; @@ -42,6 +46,7 @@ message Replay { int32 angleY = 9; // TODO: move next to angleX, and change to int16 before v1.0 bool hasHelmet = 10; bool hasDefuseKit = 11; + repeated EntityEquipment equipment = 12; } int32 tick = 1; diff --git a/protobuf/gen/replay.pb.go b/protobuf/gen/replay.pb.go index af1bbf7..f36ecdc 100644 --- a/protobuf/gen/replay.pb.go +++ b/protobuf/gen/replay.pb.go @@ -69,14 +69,14 @@ const ( Replay_Tick_Event_CUSTOM Replay_Tick_Event_Kind = 9 Replay_Tick_Event_MATCH_STARTED Replay_Tick_Event_Kind = 10 Replay_Tick_Event_GAME_PHASE_CHANGED Replay_Tick_Event_Kind = 11 - Replay_Tick_Event_SMOKE_STARTED Replay_Tick_Event_Kind = 12 - Replay_Tick_Event_SMOKE_EXPIRED Replay_Tick_Event_Kind = 13 - Replay_Tick_Event_DECOY_STARTED Replay_Tick_Event_Kind = 14 - Replay_Tick_Event_DECOY_EXPIRED Replay_Tick_Event_Kind = 15 - Replay_Tick_Event_FIRE_GRENADE_STARTED Replay_Tick_Event_Kind = 16 - Replay_Tick_Event_FIRE_GRENADE_EXPIRED Replay_Tick_Event_Kind = 17 - Replay_Tick_Event_HE_GRENADE_EXPLOSION Replay_Tick_Event_Kind = 18 - Replay_Tick_Event_FLASH_EXPLOSION Replay_Tick_Event_Kind = 19 + Replay_Tick_Event_SMOKE_STARTED Replay_Tick_Event_Kind = 12 + Replay_Tick_Event_SMOKE_EXPIRED Replay_Tick_Event_Kind = 13 + Replay_Tick_Event_DECOY_STARTED Replay_Tick_Event_Kind = 14 + Replay_Tick_Event_DECOY_EXPIRED Replay_Tick_Event_Kind = 15 + Replay_Tick_Event_FIRE_GRENADE_STARTED Replay_Tick_Event_Kind = 16 + Replay_Tick_Event_FIRE_GRENADE_EXPIRED Replay_Tick_Event_Kind = 17 + Replay_Tick_Event_HE_GRENADE_EXPLOSION Replay_Tick_Event_Kind = 18 + Replay_Tick_Event_FLASH_EXPLOSION Replay_Tick_Event_Kind = 19 ) var Replay_Tick_Event_Kind_name = map[int32]string{ @@ -103,26 +103,26 @@ var Replay_Tick_Event_Kind_name = map[int32]string{ } var Replay_Tick_Event_Kind_value = map[string]int32{ - "JUMP": 0, - "FIRE": 1, - "HURT": 2, - "FLASHED": 3, - "KILL": 4, - "ROUND_STARTED": 5, - "SWAP_TEAM": 6, - "DISCONNECT": 7, - "CHAT_MESSAGE": 8, - "CUSTOM": 9, + "JUMP": 0, + "FIRE": 1, + "HURT": 2, + "FLASHED": 3, + "KILL": 4, + "ROUND_STARTED": 5, + "SWAP_TEAM": 6, + "DISCONNECT": 7, + "CHAT_MESSAGE": 8, + "CUSTOM": 9, "MATCH_STARTED": 10, "GAME_PHASE_CHANGED": 11, - "SMOKE_STARTED": 12, - "SMOKE_EXPIRED": 13, - "DECOY_STARTED": 14, - "DECOY_EXPIRED": 15, - "FIRE_GRENADE_STARTED": 16, - "FIRE_GRENADE_EXPIRED": 17, - "HE_GRENADE_EXPLOSION": 18, - "FLASH_EXPLOSION": 19, + "SMOKE_STARTED": 12, + "SMOKE_EXPIRED": 13, + "DECOY_STARTED": 14, + "DECOY_EXPIRED": 15, + "FIRE_GRENADE_STARTED": 16, + "FIRE_GRENADE_EXPIRED": 17, + "HE_GRENADE_EXPLOSION": 18, + "FLASH_EXPLOSION": 19, } func (x Replay_Tick_Event_Kind) String() string { @@ -136,14 +136,14 @@ func (Replay_Tick_Event_Kind) EnumDescriptor() ([]byte, []int) { type Replay_Tick_Event_Attribute_Kind int32 const ( - Replay_Tick_Event_Attribute_ENTITY_ID Replay_Tick_Event_Attribute_Kind = 0 - Replay_Tick_Event_Attribute_VICTIM Replay_Tick_Event_Attribute_Kind = 1 - Replay_Tick_Event_Attribute_KILLER Replay_Tick_Event_Attribute_Kind = 2 - Replay_Tick_Event_Attribute_ASSISTER Replay_Tick_Event_Attribute_Kind = 3 - Replay_Tick_Event_Attribute_TEXT Replay_Tick_Event_Attribute_Kind = 4 - Replay_Tick_Event_Attribute_EVENT_NAME Replay_Tick_Event_Attribute_Kind = 5 - Replay_Tick_Event_Attribute_CUSTOM Replay_Tick_Event_Attribute_Kind = 6 - Replay_Tick_Event_Attribute_THROWER_ENTITY_ID Replay_Tick_Event_Attribute_Kind = 7 + Replay_Tick_Event_Attribute_ENTITY_ID Replay_Tick_Event_Attribute_Kind = 0 + Replay_Tick_Event_Attribute_VICTIM Replay_Tick_Event_Attribute_Kind = 1 + Replay_Tick_Event_Attribute_KILLER Replay_Tick_Event_Attribute_Kind = 2 + Replay_Tick_Event_Attribute_ASSISTER Replay_Tick_Event_Attribute_Kind = 3 + Replay_Tick_Event_Attribute_TEXT Replay_Tick_Event_Attribute_Kind = 4 + Replay_Tick_Event_Attribute_EVENT_NAME Replay_Tick_Event_Attribute_Kind = 5 + Replay_Tick_Event_Attribute_CUSTOM Replay_Tick_Event_Attribute_Kind = 6 + Replay_Tick_Event_Attribute_THROWER_ENTITY_ID Replay_Tick_Event_Attribute_Kind = 7 ) var Replay_Tick_Event_Attribute_Kind_name = map[int32]string{ @@ -158,14 +158,14 @@ var Replay_Tick_Event_Attribute_Kind_name = map[int32]string{ } var Replay_Tick_Event_Attribute_Kind_value = map[string]int32{ - "ENTITY_ID": 0, - "VICTIM": 1, - "KILLER": 2, - "ASSISTER": 3, - "TEXT": 4, - "EVENT_NAME": 5, - "CUSTOM": 6, - "THROWER_ENTITY_ID": 7, + "ENTITY_ID": 0, + "VICTIM": 1, + "KILLER": 2, + "ASSISTER": 3, + "TEXT": 4, + "EVENT_NAME": 5, + "CUSTOM": 6, + "THROWER_ENTITY_ID": 7, } func (x Replay_Tick_Event_Attribute_Kind) String() string { @@ -484,25 +484,70 @@ func (m *Replay_Snapshot) GetEntityUpdates() []*Replay_Snapshot_EntityUpdate { return nil } +type Replay_Snapshot_EntityEquipment struct { + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` +} + +func (m *Replay_Snapshot_EntityEquipment) Reset() { *m = Replay_Snapshot_EntityEquipment{} } +func (m *Replay_Snapshot_EntityEquipment) String() string { return proto.CompactTextString(m) } +func (*Replay_Snapshot_EntityEquipment) ProtoMessage() {} +func (*Replay_Snapshot_EntityEquipment) Descriptor() ([]byte, []int) { + return fileDescriptor_eed9461330ccfc03, []int{1, 2, 0} +} +func (m *Replay_Snapshot_EntityEquipment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Replay_Snapshot_EntityEquipment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Replay_Snapshot_EntityEquipment.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Replay_Snapshot_EntityEquipment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Replay_Snapshot_EntityEquipment.Merge(m, src) +} +func (m *Replay_Snapshot_EntityEquipment) XXX_Size() int { + return m.Size() +} +func (m *Replay_Snapshot_EntityEquipment) XXX_DiscardUnknown() { + xxx_messageInfo_Replay_Snapshot_EntityEquipment.DiscardUnknown(m) +} + +var xxx_messageInfo_Replay_Snapshot_EntityEquipment proto.InternalMessageInfo + +func (m *Replay_Snapshot_EntityEquipment) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + type Replay_Snapshot_EntityUpdate struct { - EntityId int32 `protobuf:"varint,1,opt,name=entityId,proto3" json:"entityId,omitempty"` - Positions []*Point `protobuf:"bytes,2,rep,name=positions,proto3" json:"positions,omitempty"` - AngleX int32 `protobuf:"varint,3,opt,name=angleX,proto3" json:"angleX,omitempty"` - Hp int32 `protobuf:"varint,4,opt,name=hp,proto3" json:"hp,omitempty"` - Armor int32 `protobuf:"varint,5,opt,name=armor,proto3" json:"armor,omitempty"` - FlashDuration float32 `protobuf:"fixed32,6,opt,name=flashDuration,proto3" json:"flashDuration,omitempty"` - Team Team `protobuf:"varint,7,opt,name=team,proto3,enum=gen.Team" json:"team,omitempty"` - IsNpc bool `protobuf:"varint,8,opt,name=isNpc,proto3" json:"isNpc,omitempty"` - AngleY int32 `protobuf:"varint,9,opt,name=angleY,proto3" json:"angleY,omitempty"` - HasHelmet bool `protobuf:"varint,10,opt,name=hasHelmet,proto3" json:"hasHelmet,omitempty"` - HasDefuseKit bool `protobuf:"varint,11,opt,name=hasDefuseKit,proto3" json:"hasDefuseKit,omitempty"` + EntityId int32 `protobuf:"varint,1,opt,name=entityId,proto3" json:"entityId,omitempty"` + Positions []*Point `protobuf:"bytes,2,rep,name=positions,proto3" json:"positions,omitempty"` + AngleX int32 `protobuf:"varint,3,opt,name=angleX,proto3" json:"angleX,omitempty"` + Hp int32 `protobuf:"varint,4,opt,name=hp,proto3" json:"hp,omitempty"` + Armor int32 `protobuf:"varint,5,opt,name=armor,proto3" json:"armor,omitempty"` + FlashDuration float32 `protobuf:"fixed32,6,opt,name=flashDuration,proto3" json:"flashDuration,omitempty"` + Team Team `protobuf:"varint,7,opt,name=team,proto3,enum=gen.Team" json:"team,omitempty"` + IsNpc bool `protobuf:"varint,8,opt,name=isNpc,proto3" json:"isNpc,omitempty"` + AngleY int32 `protobuf:"varint,9,opt,name=angleY,proto3" json:"angleY,omitempty"` + HasHelmet bool `protobuf:"varint,10,opt,name=hasHelmet,proto3" json:"hasHelmet,omitempty"` + HasDefuseKit bool `protobuf:"varint,11,opt,name=hasDefuseKit,proto3" json:"hasDefuseKit,omitempty"` + Equipment []*Replay_Snapshot_EntityEquipment `protobuf:"bytes,12,rep,name=equipment,proto3" json:"equipment,omitempty"` } func (m *Replay_Snapshot_EntityUpdate) Reset() { *m = Replay_Snapshot_EntityUpdate{} } func (m *Replay_Snapshot_EntityUpdate) String() string { return proto.CompactTextString(m) } func (*Replay_Snapshot_EntityUpdate) ProtoMessage() {} func (*Replay_Snapshot_EntityUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_eed9461330ccfc03, []int{1, 2, 0} + return fileDescriptor_eed9461330ccfc03, []int{1, 2, 1} } func (m *Replay_Snapshot_EntityUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -608,6 +653,13 @@ func (m *Replay_Snapshot_EntityUpdate) GetHasDefuseKit() bool { return false } +func (m *Replay_Snapshot_EntityUpdate) GetEquipment() []*Replay_Snapshot_EntityEquipment { + if m != nil { + return m.Equipment + } + return nil +} + type Replay_Tick struct { Nr int32 `protobuf:"varint,1,opt,name=nr,proto3" json:"nr,omitempty"` Events []*Replay_Tick_Event `protobuf:"bytes,2,rep,name=events,proto3" json:"events,omitempty"` @@ -789,6 +841,7 @@ func init() { proto.RegisterType((*Replay_Header)(nil), "gen.Replay.Header") proto.RegisterType((*Replay_Entity)(nil), "gen.Replay.Entity") proto.RegisterType((*Replay_Snapshot)(nil), "gen.Replay.Snapshot") + proto.RegisterType((*Replay_Snapshot_EntityEquipment)(nil), "gen.Replay.Snapshot.EntityEquipment") proto.RegisterType((*Replay_Snapshot_EntityUpdate)(nil), "gen.Replay.Snapshot.EntityUpdate") proto.RegisterType((*Replay_Tick)(nil), "gen.Replay.Tick") proto.RegisterType((*Replay_Tick_Event)(nil), "gen.Replay.Tick.Event") @@ -798,63 +851,71 @@ func init() { func init() { proto.RegisterFile("replay.proto", fileDescriptor_eed9461330ccfc03) } var fileDescriptor_eed9461330ccfc03 = []byte{ - // 894 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0x4f, 0x6f, 0xe2, 0x46, - 0x14, 0x8f, 0x8d, 0xed, 0xe0, 0x07, 0x44, 0xb3, 0xa3, 0x6d, 0x64, 0xd1, 0x16, 0x51, 0xd4, 0x56, - 0xd1, 0x1e, 0xa8, 0x9a, 0x9e, 0x7a, 0xab, 0x0b, 0xb3, 0xe0, 0x26, 0x18, 0x34, 0x1e, 0xd2, 0x4d, - 0x2f, 0x68, 0x12, 0x66, 0x83, 0x15, 0x30, 0xc8, 0x36, 0xd5, 0xb2, 0x9f, 0xa1, 0x95, 0xfa, 0x55, - 0x7a, 0xe9, 0x07, 0x68, 0x0f, 0xed, 0x71, 0x8f, 0x3d, 0x56, 0xc9, 0x17, 0xa9, 0x66, 0x6c, 0xc0, - 0xac, 0x76, 0xb5, 0xb7, 0xf7, 0xe7, 0xf7, 0xde, 0xfb, 0xbd, 0x9f, 0xdf, 0xc8, 0x50, 0x8d, 0xc5, - 0x6a, 0xce, 0x37, 0xed, 0x55, 0xbc, 0x4c, 0x97, 0xb8, 0x74, 0x27, 0xa2, 0xd6, 0xd7, 0x60, 0x8e, - 0x96, 0x61, 0x94, 0xe2, 0x2a, 0x68, 0xaf, 0x1c, 0xad, 0xa9, 0x9d, 0x99, 0x54, 0x7b, 0x25, 0xbd, - 0x8d, 0xa3, 0x67, 0xde, 0x46, 0x7a, 0xaf, 0x9d, 0x52, 0xe6, 0xbd, 0x6e, 0xfd, 0x59, 0x01, 0x8b, - 0xaa, 0x46, 0xf8, 0x19, 0x58, 0x33, 0xc1, 0xa7, 0x22, 0x56, 0x95, 0x95, 0x73, 0xdc, 0xbe, 0x13, - 0x51, 0x3b, 0x4b, 0xb6, 0xfb, 0x2a, 0x43, 0x73, 0x04, 0x6e, 0x43, 0x59, 0x44, 0x69, 0x98, 0x86, - 0x22, 0x71, 0xf4, 0x66, 0xe9, 0x6d, 0x34, 0x91, 0xb9, 0x0d, 0xdd, 0x61, 0xf0, 0x39, 0xd8, 0x49, - 0xc4, 0x57, 0xc9, 0x6c, 0x99, 0x26, 0x4e, 0x49, 0x15, 0x3c, 0x2d, 0x16, 0x04, 0x79, 0x92, 0xee, - 0x61, 0xf8, 0x4b, 0x30, 0xd3, 0xf0, 0xf6, 0x3e, 0x71, 0x0c, 0x85, 0x47, 0x45, 0x3c, 0x0b, 0x6f, - 0xef, 0x69, 0x96, 0xae, 0xff, 0x04, 0x56, 0xc6, 0x0e, 0x23, 0x28, 0x2d, 0xf8, 0x4a, 0xd1, 0xb7, - 0xa9, 0x34, 0x71, 0x1d, 0xca, 0x12, 0x44, 0x79, 0x2a, 0x94, 0x02, 0x1a, 0xdd, 0xf9, 0xb8, 0x05, - 0xd5, 0xed, 0x30, 0x95, 0xcf, 0x34, 0x39, 0x88, 0xd5, 0x39, 0x58, 0xd9, 0x2e, 0xf8, 0x04, 0xf4, - 0x70, 0x9a, 0x6b, 0xaa, 0x87, 0x53, 0x8c, 0xc1, 0x88, 0xf8, 0x22, 0xeb, 0x6a, 0x53, 0x65, 0xe3, - 0x4f, 0xc1, 0x48, 0x05, 0x5f, 0xa8, 0x4e, 0x27, 0xe7, 0xb6, 0x22, 0xcc, 0x04, 0x5f, 0x50, 0x15, - 0xc6, 0x4f, 0xc1, 0x0c, 0x13, 0x7f, 0x75, 0xeb, 0x18, 0x4d, 0xed, 0xac, 0x4c, 0x33, 0xa7, 0xfe, - 0x7b, 0x09, 0xca, 0xdb, 0xf5, 0x65, 0x57, 0xc9, 0x2f, 0x9f, 0xa3, 0x6c, 0xdc, 0x83, 0x9a, 0xd2, - 0x71, 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 0x00, 0xff, 0xff, 0x51, 0xd9, 0x73, 0x74, 0x7a, 0x06, 0x00, 0x00, + // 1015 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xae, 0x13, 0xc7, 0x8d, 0x5f, 0x93, 0x74, 0x3a, 0x5b, 0x2a, 0x2b, 0x40, 0x14, 0xaa, 0x5d, + 0x54, 0xed, 0x21, 0x88, 0x72, 0xe2, 0x86, 0x37, 0x9e, 0x4d, 0x4c, 0x1b, 0x3b, 0x1a, 0x4f, 0xba, + 0x2d, 0x97, 0xc8, 0x6d, 0x67, 0x1b, 0xab, 0x8d, 0x63, 0x62, 0x07, 0x35, 0xfb, 0x0f, 0x10, 0x17, + 0x7e, 0x00, 0x47, 0x7e, 0x0c, 0xc7, 0x15, 0x27, 0x8e, 0xa8, 0x15, 0xbf, 0x80, 0x3f, 0x80, 0x66, + 0x1c, 0x3b, 0xce, 0xb2, 0xb0, 0xb7, 0x79, 0xdf, 0xfb, 0xde, 0x7b, 0x9f, 0xbf, 0x37, 0x93, 0x40, + 0x6d, 0xce, 0xa3, 0x3b, 0x7f, 0xd9, 0x89, 0xe6, 0xb3, 0x64, 0x86, 0xcb, 0x37, 0x3c, 0x3c, 0xfc, + 0x12, 0x2a, 0xc3, 0x59, 0x10, 0x26, 0xb8, 0x06, 0xca, 0xbd, 0xa1, 0xb4, 0x95, 0xa3, 0x0a, 0x55, + 0xee, 0x45, 0xb4, 0x34, 0x4a, 0x69, 0xb4, 0x14, 0xd1, 0x1b, 0xa3, 0x9c, 0x46, 0x6f, 0x0e, 0xff, + 0xae, 0x83, 0x46, 0x65, 0x23, 0xfc, 0x1c, 0xb4, 0x09, 0xf7, 0xaf, 0xf9, 0x5c, 0x56, 0xee, 0x1c, + 0xe3, 0xce, 0x0d, 0x0f, 0x3b, 0x69, 0xb2, 0xd3, 0x97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0x1c, 0xd3, 0x5a, 0xb7, 0x44, 0xff, 0xca, 0x64, 0x35, 0x7b, 0x22, 0xd3, 0xdf, 0xc0, 0x4f, + 0x5d, 0xcf, 0x76, 0x1d, 0x84, 0xf1, 0x13, 0xd8, 0x95, 0x5e, 0x15, 0xc0, 0x27, 0xcf, 0x4f, 0x40, + 0x15, 0x3f, 0x0b, 0xc2, 0x8f, 0x91, 0x23, 0x96, 0xd7, 0x73, 0x88, 0x58, 0x71, 0x1d, 0x74, 0x46, + 0x28, 0x75, 0xa9, 0xed, 0x31, 0xa4, 0x88, 0x2d, 0x75, 0xdd, 0x91, 0xc3, 0x08, 0x1d, 0xaf, 0xe1, + 0x92, 0x34, 0x75, 0x48, 0xba, 0xcc, 0x64, 0x2e, 0x45, 0xe5, 0x17, 0xc6, 0x6f, 0x0f, 0x2d, 0xe5, + 0xed, 0x43, 0x4b, 0xf9, 0xf3, 0xa1, 0xa5, 0xfc, 0xfc, 0xd8, 0xda, 0x7a, 0xfb, 0xd8, 0xda, 0xfa, + 0xe3, 0xb1, 0xb5, 0x75, 0xa9, 0xc9, 0xff, 0xe6, 0xaf, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xe0, + 0x23, 0x23, 0x75, 0xab, 0x07, 0x00, 0x00, } func (m *Point) Marshal() (dAtA []byte, err error) { @@ -1105,6 +1166,34 @@ func (m *Replay_Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Replay_Snapshot_EntityEquipment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Replay_Snapshot_EntityEquipment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Replay_Snapshot_EntityEquipment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Type != 0 { + i = encodeVarintReplay(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *Replay_Snapshot_EntityUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1125,6 +1214,20 @@ func (m *Replay_Snapshot_EntityUpdate) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if len(m.Equipment) > 0 { + for iNdEx := len(m.Equipment) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Equipment[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReplay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + } if m.HasDefuseKit { i-- if m.HasDefuseKit { @@ -1459,6 +1562,18 @@ func (m *Replay_Snapshot) Size() (n int) { return n } +func (m *Replay_Snapshot_EntityEquipment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovReplay(uint64(m.Type)) + } + return n +} + func (m *Replay_Snapshot_EntityUpdate) Size() (n int) { if m == nil { return 0 @@ -1501,6 +1616,12 @@ func (m *Replay_Snapshot_EntityUpdate) Size() (n int) { if m.HasDefuseKit { n += 2 } + if len(m.Equipment) > 0 { + for _, e := range m.Equipment { + l = e.Size() + n += 1 + l + sovReplay(uint64(l)) + } + } return n } @@ -2234,6 +2355,78 @@ func (m *Replay_Snapshot) Unmarshal(dAtA []byte) error { } return nil } +func (m *Replay_Snapshot_EntityEquipment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReplay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EntityEquipment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EntityEquipment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReplay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipReplay(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthReplay + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthReplay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Replay_Snapshot_EntityUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2482,6 +2675,40 @@ func (m *Replay_Snapshot_EntityUpdate) Unmarshal(dAtA []byte) error { } } m.HasDefuseKit = bool(v != 0) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Equipment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReplay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReplay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReplay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Equipment = append(m.Equipment, &Replay_Snapshot_EntityEquipment{}) + if err := m.Equipment[len(m.Equipment)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipReplay(dAtA[iNdEx:]) diff --git a/protobuf/marshal.go b/protobuf/marshal.go index 230bb5b..3535629 100644 --- a/protobuf/marshal.go +++ b/protobuf/marshal.go @@ -84,8 +84,21 @@ func mapToEntityUpdates(entityUpdates []rep.EntityUpdate) []*gen.Replay_Snapshot Team: mapToTeam(u.Team), HasHelmet: u.HasHelmet, HasDefuseKit: u.HasDefuseKit, + Equipment: mapToEquipment(u.Equipment), }) } + + return result +} + +func mapToEquipment(equipment []rep.EntityEquipment) []*gen.Replay_Snapshot_EntityEquipment { + result := make([]*gen.Replay_Snapshot_EntityEquipment, 0) + for _, eq := range equipment { + result = append(result, &gen.Replay_Snapshot_EntityEquipment{ + Type: int32(eq.Type), + }) + } + return result } diff --git a/protobuf/unmarshal.go b/protobuf/unmarshal.go index 6be3a4d..0798b56 100644 --- a/protobuf/unmarshal.go +++ b/protobuf/unmarshal.go @@ -108,6 +108,22 @@ func mapFromEntityUpdates(entityUpdates []*gen.Replay_Snapshot_EntityUpdate) []r Team: mapFromTeam(u.Team), HasHelmet: u.HasHelmet, HasDefuseKit: u.HasDefuseKit, + Equipment: mapFromEquipment(u.Equipment), + } + } + + return result +} + +func mapFromEquipment(equipment []*gen.Replay_Snapshot_EntityEquipment) []rep.EntityEquipment { + if equipment == nil { + return nil + } + + result := make([]rep.EntityEquipment, len(equipment)) + for i, eq := range equipment { + result[i] = rep.EntityEquipment{ + Type: int(eq.Type), } } diff --git a/replay/nondefault/nondefault_replay.go b/replay/nondefault/nondefault_replay.go index 39fdcc1..3de739f 100644 --- a/replay/nondefault/nondefault_replay.go +++ b/replay/nondefault/nondefault_replay.go @@ -47,7 +47,11 @@ func init() { Team: 1, HasDefuseKit: true, HasHelmet: true, - }) + Equipment: []rep.EntityEquipment{ + { + Type: 1, + }, + }}) var snaps []rep.Snapshot snaps = append(snaps, rep.Snapshot{ diff --git a/replay/replay.go b/replay/replay.go index b0340cd..b6ce48b 100644 --- a/replay/replay.go +++ b/replay/replay.go @@ -67,19 +67,24 @@ type Snapshot struct { EntityUpdates []EntityUpdate `json:"entityUpdates" msgpack:"entityUpdates"` } +type EntityEquipment struct { + Type int `json:"type" msgpack:"type"` +} + // EntityUpdate contains changes of player & NPCs attributes type EntityUpdate struct { - EntityID int `json:"entityId" msgpack:"entityId"` - Team int `json:"team,omitempty" msgpack:"team,omitempty"` - Positions []Point `json:"positions,omitempty" msgpack:"positions,omitempty"` // This allows us smoother replay with less overhead compared to higher snapshot rate - AngleX int `json:"angleX,omitempty" msgpack:"angleX,omitempty"` - AngleY int `json:"angleY,omitempty" msgpack:"angleY,omitempty"` - Hp int `json:"hp,omitempty" msgpack:"hp,omitempty"` - Armor int `json:"armor,omitempty" msgpack:"armor,omitempty"` - FlashDuration float32 `json:"flashDuration,omitempty" msgpack:"flashDuration,omitempty"` - IsNpc bool `json:"isNpc,omitempty" msgpack:"isNpc,omitempty"` - HasHelmet bool `json:"hasHelmet,omitempty" msgpack:"hasHelmet,omitempty"` - HasDefuseKit bool `json:"hasDefuseKit,omitempty" msgpack:"hasDefuseKit,omitempty"` + EntityID int `json:"entityId" msgpack:"entityId"` + Team int `json:"team,omitempty" msgpack:"team,omitempty"` + Positions []Point `json:"positions,omitempty" msgpack:"positions,omitempty"` // This allows us smoother replay with less overhead compared to higher snapshot rate + AngleX int `json:"angleX,omitempty" msgpack:"angleX,omitempty"` + AngleY int `json:"angleY,omitempty" msgpack:"angleY,omitempty"` + Hp int `json:"hp,omitempty" msgpack:"hp,omitempty"` + Armor int `json:"armor,omitempty" msgpack:"armor,omitempty"` + FlashDuration float32 `json:"flashDuration,omitempty" msgpack:"flashDuration,omitempty"` + IsNpc bool `json:"isNpc,omitempty" msgpack:"isNpc,omitempty"` + HasHelmet bool `json:"hasHelmet,omitempty" msgpack:"hasHelmet,omitempty"` + HasDefuseKit bool `json:"hasDefuseKit,omitempty" msgpack:"hasDefuseKit,omitempty"` + Equipment []EntityEquipment `json:"equipment,omitempty" msgpack:"equipment,omitempty"` } // Point is a position on the map diff --git a/schema.json b/schema.json index 82a14b2..10bf8be 100644 --- a/schema.json +++ b/schema.json @@ -25,6 +25,18 @@ "additionalProperties": false, "type": "object" }, + "EntityEquipment": { + "required": [ + "type" + ], + "properties": { + "type": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, "EntityUpdate": { "required": [ "entityId" @@ -42,6 +54,13 @@ "entityId": { "type": "integer" }, + "equipment": { + "items": { + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/EntityEquipment" + }, + "type": "array" + }, "flashDuration": { "type": "number" },