diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-11-07 16:09:44 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-16 21:39:37 +0300 |
| commit | a77cf8169b42a4394e62f7a381ca546b27d0f723 (patch) | |
| tree | 2dd8d4f51c5841b806e9b5ed6fe9054bce06e2e0 /classes/netsvc | |
| parent | changed github username + other stuff that i don't remember (diff) | |
| download | sdp.go-a77cf8169b42a4394e62f7a381ca546b27d0f723.tar.gz sdp.go-a77cf8169b42a4394e62f7a381ca546b27d0f723.tar.bz2 sdp.go-a77cf8169b42a4394e62f7a381ca546b27d0f723.zip | |
starting fresh for the third time
Diffstat (limited to 'classes/netsvc')
| -rw-r--r-- | classes/netsvc/netsvc.go | 32 | ||||
| -rw-r--r-- | classes/netsvc/types.go | 106 |
2 files changed, 0 insertions, 138 deletions
diff --git a/classes/netsvc/netsvc.go b/classes/netsvc/netsvc.go deleted file mode 100644 index a454310..0000000 --- a/classes/netsvc/netsvc.go +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | package netsvc | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "bytes" | ||
| 5 | "fmt" | ||
| 6 | |||
| 7 | "github.com/pektezol/bitreader" | ||
| 8 | "github.com/pektezol/demoparser/utils" | ||
| 9 | ) | ||
| 10 | |||
| 11 | const NET_TICK_SCALEUP = 10000 | ||
| 12 | |||
| 13 | func ParseNetSvcMessage(file []byte) { | ||
| 14 | reader := bitreader.Reader(bytes.NewReader(file), true) | ||
| 15 | bitsRead := 0 | ||
| 16 | for { | ||
| 17 | messageType, err := reader.ReadBits(6) | ||
| 18 | if err != nil { // No remaining bits left | ||
| 19 | break | ||
| 20 | } | ||
| 21 | switch messageType { | ||
| 22 | case 16: | ||
| 23 | var svcprint SvcPrint | ||
| 24 | svcprint.Message = utils.ReadStringFromSlice(file) | ||
| 25 | fmt.Println(svcprint) | ||
| 26 | bitsRead += len(svcprint.Message) * 8 | ||
| 27 | default: | ||
| 28 | //fmt.Println("default") | ||
| 29 | break | ||
| 30 | } | ||
| 31 | } | ||
| 32 | } | ||
diff --git a/classes/netsvc/types.go b/classes/netsvc/types.go deleted file mode 100644 index 2a52f96..0000000 --- a/classes/netsvc/types.go +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | package netsvc | ||
| 2 | |||
| 3 | type NetDisconnect struct { | ||
| 4 | Text string | ||
| 5 | } | ||
| 6 | |||
| 7 | type NetFile struct { | ||
| 8 | TransferId int32 | ||
| 9 | FileName string | ||
| 10 | FileRequested bool | ||
| 11 | } | ||
| 12 | |||
| 13 | type NetSplitScreenUser struct { | ||
| 14 | Unknown bool | ||
| 15 | } | ||
| 16 | |||
| 17 | type NetTick struct { | ||
| 18 | Tick int32 | ||
| 19 | HostFrameTime int16 | ||
| 20 | HostFrameTimeStdDeviation int16 | ||
| 21 | } | ||
| 22 | |||
| 23 | type NetStringCmd struct { | ||
| 24 | Command string | ||
| 25 | } | ||
| 26 | |||
| 27 | type ConVar struct { | ||
| 28 | Name string | ||
| 29 | Value string | ||
| 30 | } | ||
| 31 | |||
| 32 | type NetSetConVar struct { | ||
| 33 | Length int8 | ||
| 34 | ConVars []ConVar | ||
| 35 | } | ||
| 36 | |||
| 37 | type NetSignonStateOE struct { | ||
| 38 | SignonState int8 | ||
| 39 | SpawnCount int32 | ||
| 40 | } | ||
| 41 | |||
| 42 | type NetSignonStateNE struct { | ||
| 43 | NetSignonStateOE | ||
| 44 | NumServerPlayers int32 | ||
| 45 | IdsLength int32 | ||
| 46 | PlayerNetworkIds []byte | ||
| 47 | MapNameLength int32 | ||
| 48 | MapName string | ||
| 49 | } | ||
| 50 | |||
| 51 | type SvcServerInfo struct { | ||
| 52 | Protocol int8 | ||
| 53 | ServerCount int32 | ||
| 54 | IsHltv bool | ||
| 55 | IsDedicated bool | ||
| 56 | ClientCrc int32 | ||
| 57 | MaxClasses int16 | ||
| 58 | MapCrc int32 | ||
| 59 | PlayerSlot int8 | ||
| 60 | MaxClients int8 | ||
| 61 | Unk int32 // NE | ||
| 62 | TickInterval float32 | ||
| 63 | COs byte | ||
| 64 | GameDir string | ||
| 65 | MapName string | ||
| 66 | SkyName string | ||
| 67 | HostName string | ||
| 68 | } | ||
| 69 | |||
| 70 | type SvcSendTable struct { | ||
| 71 | NeedsDecoder bool | ||
| 72 | Length int8 | ||
| 73 | Props int // ? | ||
| 74 | } | ||
| 75 | |||
| 76 | type ServerClass struct { | ||
| 77 | ClassId int8 | ||
| 78 | ClassName string | ||
| 79 | DataTableName string | ||
| 80 | } | ||
| 81 | |||
| 82 | type SvcClassInfo struct { | ||
| 83 | Length int16 | ||
| 84 | CreateOnClient bool | ||
| 85 | ServerClasses []ServerClass | ||
| 86 | } | ||
| 87 | |||
| 88 | type SvcSetPause struct { | ||
| 89 | Paused bool | ||
| 90 | } | ||
| 91 | |||
| 92 | type SvcCreateStringTable struct { | ||
| 93 | Name string | ||
| 94 | MaxEntries int16 | ||
| 95 | NumEntries int8 | ||
| 96 | Length int32 | ||
| 97 | UserDataFixedSize bool | ||
| 98 | UserDataSize int32 | ||
| 99 | UserDataSizeBits int8 | ||
| 100 | Flags int8 | ||
| 101 | StringData int // ? | ||
| 102 | } | ||
| 103 | |||
| 104 | type SvcPrint struct { | ||
| 105 | Message string | ||
| 106 | } | ||