Commit graph

40 commits

Author SHA1 Message Date
ChillerDragon 732798444c More detailed snapshot debug dump
The method CSnapShot::DebugDump() used to print just the raw snap items.
Without item names or field names:

```
2024-04-07 09:10:01 I snapshot: data_size=356 num_items=10
2024-04-07 09:10:01 I snapshot:         type=0 id=32767
2024-04-07 09:10:01 I snapshot:                   0  -1824658838        933dea6a
2024-04-07 09:10:01 I snapshot:                   1   -629591830        da7930ea
2024-04-07 09:10:01 I snapshot:                   2  -1450210576        a98f8af0
2024-04-07 09:10:01 I snapshot:                   3    914991429        3689a945
2024-04-07 09:10:01 I snapshot:         type=0 id=32766
2024-04-07 09:10:01 I snapshot:                   0    583701389        22ca938d
2024-04-07 09:10:01 I snapshot:                   1    327171627        13803e2b
2024-04-07 09:10:01 I snapshot:                   2  -1636052395        9e7bd255
2024-04-07 09:10:01 I snapshot:                   3  -1901674991        8ea6be11
2024-04-07 09:10:01 I snapshot:         type=0 id=32765
2024-04-07 09:10:01 I snapshot:                   0   1993229659        76ce455b
2024-04-07 09:10:01 I snapshot:                   1   -102024632        f9eb3a48
2024-04-07 09:10:01 I snapshot:                   2  -1378361269        add7e04b
2024-04-07 09:10:01 I snapshot:                   3  -1810037668        941d045c
2024-04-07 09:10:01 I snapshot:         type=6 id=0
2024-04-07 09:10:01 I snapshot:                   0            0        00000000
2024-04-07 09:10:01 I snapshot:                   1            0        00000000
2024-04-07 09:10:01 I snapshot:                   2            0        00000000
2024-04-07 09:10:01 I snapshot:                   3            0        00000000
2024-04-07 09:10:01 I snapshot:                   4            0        00000000
2024-04-07 09:10:01 I snapshot:                   5            0        00000000
2024-04-07 09:10:01 I snapshot:                   6            0        00000000
2024-04-07 09:10:01 I snapshot:                   7            1        00000001
2024-04-07 09:10:01 I snapshot:         type=32767 id=0
2024-04-07 09:10:01 I snapshot:                   0    247983155        0ec7ec33
2024-04-07 09:10:01 I snapshot:                   1            9        00000009
2024-04-07 09:10:01 I snapshot:                   2           64        00000040
2024-04-07 09:10:01 I snapshot:         type=11 id=0
2024-04-07 09:10:01 I snapshot:                   0  -1008145940        c3e8e9ec
2024-04-07 09:10:01 I snapshot:                   1   -320474428        ece5f2c4
2024-04-07 09:10:01 I snapshot:                   2   -220076049        f2e1e7ef
2024-04-07 09:10:01 I snapshot:                   3   -293568512        ee808000
2024-04-07 09:10:01 I snapshot:                   4  -1330727040        b0aeb780
2024-04-07 09:10:01 I snapshot:                   5  -2139062144        80808080
2024-04-07 09:10:01 I snapshot:                   6  -2139062272        80808000
2024-04-07 09:10:01 I snapshot:                   7           64        00000040
2024-04-07 09:10:01 I snapshot:                   8   -403511835        e7f2e5e5
2024-04-07 09:10:01 I snapshot:                   9   -286001183        eef3f7e1
2024-04-07 09:10:01 I snapshot:                  10   -219905920        f2e48080
2024-04-07 09:10:01 I snapshot:                  11  -2139062144        80808080
2024-04-07 09:10:01 I snapshot:                  12  -2139062144        80808080
2024-04-07 09:10:01 I snapshot:                  13  -2139062272        80808000
2024-04-07 09:10:01 I snapshot:                  14            0        00000000
2024-04-07 09:10:01 I snapshot:                  15      7199301        006dda45
2024-04-07 09:10:01 I snapshot:                  16      2345678        0023cace
2024-04-07 09:10:01 I snapshot:         type=10 id=0
2024-04-07 09:10:01 I snapshot:                   0            1        00000001
2024-04-07 09:10:01 I snapshot:                   1            0        00000000
2024-04-07 09:10:01 I snapshot:                   2            0        00000000
2024-04-07 09:10:01 I snapshot:                   3        -9999        ffffd8f1
2024-04-07 09:10:01 I snapshot:                   4            0        00000000
2024-04-07 09:10:01 I snapshot:         type=32766 id=0
2024-04-07 09:10:01 I snapshot:                   0            1        00000001
2024-04-07 09:10:01 I snapshot:                   1            0        00000000
2024-04-07 09:10:01 I snapshot:         type=9 id=0
2024-04-07 09:10:01 I snapshot:                   0          438        000001b6
2024-04-07 09:10:01 I snapshot:                   1         1968        000007b0
2024-04-07 09:10:01 I snapshot:                   2          913        00000391
2024-04-07 09:10:01 I snapshot:                   3            0        00000000
2024-04-07 09:10:01 I snapshot:                   4            0        00000000
2024-04-07 09:10:01 I snapshot:                   5            0        00000000
2024-04-07 09:10:01 I snapshot:                   6            0        00000000
2024-04-07 09:10:01 I snapshot:                   7            0        00000000
2024-04-07 09:10:01 I snapshot:                   8           -1        ffffffff
2024-04-07 09:10:01 I snapshot:                   9            0        00000000
2024-04-07 09:10:01 I snapshot:                  10            0        00000000
2024-04-07 09:10:01 I snapshot:                  11         1968        000007b0
2024-04-07 09:10:01 I snapshot:                  12          913        00000391
2024-04-07 09:10:01 I snapshot:                  13            0        00000000
2024-04-07 09:10:01 I snapshot:                  14            0        00000000
2024-04-07 09:10:01 I snapshot:                  15            1        00000001
2024-04-07 09:10:01 I snapshot:                  16           10        0000000a
2024-04-07 09:10:01 I snapshot:                  17           10        0000000a
2024-04-07 09:10:01 I snapshot:                  18            0        00000000
2024-04-07 09:10:01 I snapshot:                  19            1        00000001
2024-04-07 09:10:01 I snapshot:                  20            5        00000005
2024-04-07 09:10:01 I snapshot:                  21            0        00000000
2024-04-07 09:10:01 I snapshot:         type=32765 id=0
2024-04-07 09:10:01 I snapshot:                   0        49152        0000c000
2024-04-07 09:10:01 I snapshot:                   1            0        00000000
2024-04-07 09:10:01 I snapshot:                   2            2        00000002
2024-04-07 09:10:01 I snapshot:                   3            0        00000000
2024-04-07 09:10:01 I snapshot:                   4            0        00000000
2024-04-07 09:10:01 I snapshot:                   5            0        00000000
2024-04-07 09:10:01 I snapshot:                   6            0        00000000
2024-04-07 09:10:01 I snapshot:                   7            0        00000000
2024-04-07 09:10:01 I snapshot:                   8            1        00000001
2024-04-07 09:10:01 I snapshot:                   9            0        00000000
```

Now there is also `CNetObjHandler::DebugDumpSnapshot(const CSnapshot *pSnap)`
which prints the name of the snap item and also the names of all fields:

```
2024-04-07 09:21:42 I snapshot: data_size=356 num_items=10
2024-04-07 09:21:42 I snapshot:         EX/UUID type=0 id=32767 size=16
2024-04-07 09:21:42 I snapshot:                   0  -1824658838        933dea6a
2024-04-07 09:21:42 I snapshot:                   1   -629591830        da7930ea
2024-04-07 09:21:42 I snapshot:                   2  -1450210576        a98f8af0
2024-04-07 09:21:42 I snapshot:                   3    914991429        3689a945
2024-04-07 09:21:42 I snapshot:         EX/UUID type=0 id=32766 size=16
2024-04-07 09:21:42 I snapshot:                   0    583701389        22ca938d
2024-04-07 09:21:42 I snapshot:                   1    327171627        13803e2b
2024-04-07 09:21:42 I snapshot:                   2  -1636052395        9e7bd255
2024-04-07 09:21:42 I snapshot:                   3  -1901674991        8ea6be11
2024-04-07 09:21:42 I snapshot:         EX/UUID type=0 id=32765 size=16
2024-04-07 09:21:42 I snapshot:                   0   1993229659        76ce455b
2024-04-07 09:21:42 I snapshot:                   1   -102024632        f9eb3a48
2024-04-07 09:21:42 I snapshot:                   2  -1378361269        add7e04b
2024-04-07 09:21:42 I snapshot:                   3  -1810037668        941d045c
2024-04-07 09:21:42 I snapshot:         GameInfo type=6 id=0 size=32
2024-04-07 09:21:42 I snapshot:                   0            0        00000000        m_GameFlags=0 (min=0 max=256)
2024-04-07 09:21:42 I snapshot:                   1            0        00000000        m_GameStateFlags=0 (min=0 max=256)
2024-04-07 09:21:42 I snapshot:                   2            0        00000000        m_RoundStartTick=0 (NetTick)
2024-04-07 09:21:42 I snapshot:                   3            0        00000000        m_WarmupTimer=0 (min=min_int(-2147483648) max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:                   4            0        00000000        m_ScoreLimit=0 (min=0 max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:                   5            0        00000000        m_TimeLimit=0 (min=0 max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:                   6            0        00000000        m_RoundNum=0 (min=0 max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:                   7            1        00000001        m_RoundCurrent=1 (min=0 max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:         (out of range) type=32767 id=0 size=12
2024-04-07 09:21:42 I snapshot:                   0    247983155        0ec7ec33
2024-04-07 09:21:42 I snapshot:                   1            9        00000009
2024-04-07 09:21:42 I snapshot:                   2           64        00000040
2024-04-07 09:21:42 I snapshot:         ClientInfo type=11 id=0 size=68
2024-04-07 09:21:42 I snapshot:                   0  -1008145940        c3e8e9ec        m_Name0=-1008145940     IntsToStr: Chil
2024-04-07 09:21:42 I snapshot:                   1   -320474428        ece5f2c4        m_Name1=-320474428      IntsToStr: lerD
2024-04-07 09:21:42 I snapshot:                   2   -220076049        f2e1e7ef        m_Name2=-220076049      IntsToStr: rago
2024-04-07 09:21:42 I snapshot:                   3   -293568512        ee808000        m_Name3=-293568512      IntsToStr: n
2024-04-07 09:21:42 I snapshot:                   4  -1330727040        b0aeb780        m_Clan0=-1330727040     IntsToStr: 0.7
2024-04-07 09:21:42 I snapshot:                   5  -2139062144        80808080        m_Clan1=-2139062144     IntsToStr:
2024-04-07 09:21:42 I snapshot:                   6  -2139062272        80808000        m_Clan2=-2139062272     IntsToStr:
2024-04-07 09:21:42 I snapshot:                   7           64        00000040        m_Country=64
2024-04-07 09:21:42 I snapshot:                   8   -403511835        e7f2e5e5        m_Skin0=-403511835      IntsToStr: gree
2024-04-07 09:21:42 I snapshot:                   9   -286001183        eef3f7e1        m_Skin1=-286001183      IntsToStr: nswa
2024-04-07 09:21:42 I snapshot:                  10   -219905920        f2e48080        m_Skin2=-219905920      IntsToStr: rd
2024-04-07 09:21:42 I snapshot:                  11  -2139062144        80808080        m_Skin3=-2139062144     IntsToStr:
2024-04-07 09:21:42 I snapshot:                  12  -2139062144        80808080        m_Skin4=-2139062144     IntsToStr:
2024-04-07 09:21:42 I snapshot:                  13  -2139062272        80808000        m_Skin5=-2139062272     IntsToStr:
2024-04-07 09:21:42 I snapshot:                  14            0        00000000        m_UseCustomColor=0 (min=0 max=1)
2024-04-07 09:21:42 I snapshot:                  15      7199301        006dda45        m_ColorBody=7199301
2024-04-07 09:21:42 I snapshot:                  16      2345678        0023cace        m_ColorFeet=2345678
2024-04-07 09:21:42 I snapshot:         PlayerInfo type=10 id=0 size=20
2024-04-07 09:21:42 I snapshot:                   0            1        00000001        m_Local=1 (min=0 max=1)
2024-04-07 09:21:42 I snapshot:                   1            0        00000000        m_ClientId=0 (min=0 max=MAX_CLIENTS-1(63))
2024-04-07 09:21:42 I snapshot:                   2            0        00000000        m_Team=0 (min=TEAM_SPECTATORS(-1) max=TEAM_BLUE(1))
2024-04-07 09:21:42 I snapshot:                   3        -9999        ffffd8f1        m_Score=-9999
2024-04-07 09:21:42 I snapshot:                   4            0        00000000        m_Latency=0
2024-04-07 09:21:42 I snapshot:         (out of range) type=32766 id=0 size=8
2024-04-07 09:21:42 I snapshot:                   0            1        00000001
2024-04-07 09:21:42 I snapshot:                   1            0        00000000
2024-04-07 09:21:42 I snapshot:         Character type=9 id=0 size=88
2024-04-07 09:21:42 I snapshot:                   0          176        000000b0        m_Tick=176
2024-04-07 09:21:42 I snapshot:                   1         1968        000007b0        m_X=1968
2024-04-07 09:21:42 I snapshot:                   2          913        00000391        m_Y=913
2024-04-07 09:21:42 I snapshot:                   3            0        00000000        m_VelX=0
2024-04-07 09:21:42 I snapshot:                   4            0        00000000        m_VelY=0
2024-04-07 09:21:42 I snapshot:                   5            0        00000000        m_Angle=0
2024-04-07 09:21:42 I snapshot:                   6            0        00000000        m_Direction=0 (min=-1 max=1)
2024-04-07 09:21:42 I snapshot:                   7            0        00000000        m_Jumped=0 (min=0 max=3)
2024-04-07 09:21:42 I snapshot:                   8           -1        ffffffff        m_HookedPlayer=-1 (min=-1 max=MAX_CLIENTS-1(63))
2024-04-07 09:21:42 I snapshot:                   9            0        00000000        m_HookState=0 (min=-1 max=5)
2024-04-07 09:21:42 I snapshot:                  10            0        00000000        m_HookTick=0 (NetTick)
2024-04-07 09:21:42 I snapshot:                  11         1968        000007b0        m_HookX=1968
2024-04-07 09:21:42 I snapshot:                  12          913        00000391        m_HookY=913
2024-04-07 09:21:42 I snapshot:                  13            0        00000000        m_HookDx=0
2024-04-07 09:21:42 I snapshot:                  14            0        00000000        m_HookDy=0
2024-04-07 09:21:42 I snapshot:                  15            1        00000001        m_PlayerFlags=1 (min=0 max=256)
2024-04-07 09:21:42 I snapshot:                  16           10        0000000a        m_Health=10 (min=0 max=10)
2024-04-07 09:21:42 I snapshot:                  17           10        0000000a        m_Armor=10 (min=0 max=10)
2024-04-07 09:21:42 I snapshot:                  18            0        00000000        m_AmmoCount=0 (min=0 max=10)
2024-04-07 09:21:42 I snapshot:                  19            1        00000001        m_Weapon=1 (min=0 max=NUM_WEAPONS-1(5))
2024-04-07 09:21:42 I snapshot:                  20            5        00000005        m_Emote=5 (min=0 max=6)
2024-04-07 09:21:42 I snapshot:                  21            0        00000000        m_AttackTick=0 (min=0 max=max_int(2147483647))
2024-04-07 09:21:42 I snapshot:         (out of range) type=32765 id=0 size=40
2024-04-07 09:21:42 I snapshot:                   0        49152        0000c000
2024-04-07 09:21:42 I snapshot:                   1            0        00000000
2024-04-07 09:21:42 I snapshot:                   2            2        00000002
2024-04-07 09:21:42 I snapshot:                   3            0        00000000
2024-04-07 09:21:42 I snapshot:                   4            0        00000000
2024-04-07 09:21:42 I snapshot:                   5            0        00000000
2024-04-07 09:21:42 I snapshot:                   6            0        00000000
2024-04-07 09:21:42 I snapshot:                   7            0        00000000
2024-04-07 09:21:42 I snapshot:                   8            1        00000001
2024-04-07 09:21:42 I snapshot:                   9            0        00000000
```
2024-09-07 15:28:25 +08:00
ChillerDragon 0b6bb8287a Use enum for teams (Closed #8306) 2024-05-05 11:38:29 +08:00
heinrich5991 d3123a479b Refactor code around inherited net objects, add it to 0.7 code 2024-01-06 22:46:57 +01:00
heinrich5991 be53d83019 Remove #include <system.h> from one more header 2023-12-12 00:44:46 +01:00
Alexander Akulich 26b4a41c03 Extract 'six' content data structs to their own file 2023-10-06 18:14:15 +03:00
Dennis Felsing 9f8e97fbeb Run flynt -a 2022-07-27 09:37:24 +02:00
def 7379a64004 [WIP] Require Python 3.6 (f-strings) and fix pylints
So far only done scripts directory, will do the rest if this is
considered good
2022-07-27 09:37:24 +02:00
c0d3d3v eea0615ba2
refactor compile.py 2022-06-27 01:11:21 +02:00
c0d3d3v 917e9f1e96
remove unused python code 2022-06-27 01:11:21 +02:00
c0d3d3v 59436b5e6d
Add default values to extended Net Objects 2022-06-27 01:11:19 +02:00
c0d3d3v f819afed6c
Print also extended NetObj and NetMsg Names
Show External NetObjects in Snapshot stats
2022-06-27 01:10:37 +02:00
c0d3d3v 4729fa9467
Match PACKER_BUFFER_SIZE when using SecureUnpackMsg 2022-06-27 01:10:37 +02:00
Robert Müller 0a4b1b9a7b Organize generated protocol includes 2022-06-17 17:39:24 +02:00
Redix 5efa50ca28 Validate variables of the snap-item base class 2022-02-19 20:08:05 +01:00
Alexander Akulich 2790270abf Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
def 13a8dfa307 Add pylint
and fix occurences
2020-12-09 10:40:28 +01:00
def 343e30f7a6 Fix protocol.h/protocol7.h to compile on their own (fixes #2962 in another way) 2020-10-02 19:28:08 +02:00
Magnus Auvinen 6a6a5f00c9 more typesafty in the graphics. introduced the IGraphics::CTextureHandle
Edited by @ChillerDragon to fit in ddnet
(cherry picked from commit cb95e8dfe8)
2019-11-22 18:08:37 +01:00
yangfl a1db76cdef Remove extra semicolons 2018-11-18 14:27:48 +08:00
heinrich5991 4660e0a680 Add support for extra map items in datafiles
This works by utilizing the good old UUIDs – this way we can make sure
that we don't clash with other people extending the map format.
2018-10-08 23:05:56 +02:00
heinrich5991 6fd9bc3d3e Remove the unused import of the deprecated imp module 2018-08-15 14:43:56 +02:00
heinrich5991 9761e9606a Make most user input teehistoric
Exclude private stuff like chat messages and votes.
2017-09-20 02:23:28 +02:00
heinrich5991 555e8fe889 Fix unpacking of net events
The UUID objects accidently made it into the lists of object sizes.
2017-05-27 15:51:29 +02:00
heinrich5991 5ae37e6c72 Add protocol extension with UUIDs
This system can easily be extended by independent authors without
collisions, something the old system with plain increasing integers did
not allow.

Do this by utilizing the previously unused message code `NETMSG_NULL`
which has a value of 0.

This works for engine and game messages, snapshot items and events.
2017-05-25 00:52:43 +02:00
necropotame 4cfe96801b Send the race time using warmup timer 2017-02-28 07:31:24 +01:00
Choupom 603071ee92 fixed data struct names 2011-06-02 17:42:30 +02:00
oy 06115dd49d added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
oy 9c6843946c added Python 2.5 - Python 3.2 support by Sworddragon 2011-01-29 18:55:21 +01:00
oy 3c1eee2a12 reverted Python 3 support fixes to keep compatibility with 2.5 2011-01-20 01:28:17 +01:00
oy 232aafa891 added Python 3 support fixes by Sworddragon 2011-01-17 15:48:57 +01:00
oy e71263d686 fixed last commit 2011-01-06 12:41:24 +01:00
Sworddragon 4ff61fcdaa Made compiling process Python 3 compatible 2011-01-06 12:27:50 +01:00
Magnus Auvinen 72c06a2589 copied refactor to trunk 2010-05-29 07:25:38 +00:00
Magnus Auvinen 5e3f740220 improved the error reporting of the network unpacker 2008-12-19 11:25:14 +00:00
Magnus Auvinen b322643f17 missed some files 2008-08-27 15:51:09 +00:00
Magnus Auvinen 16912026db added cl_layershot. fixed some bugs in the network 2008-08-17 07:05:16 +00:00
Magnus Auvinen a13b94f9e0 minor update 2008-07-08 09:07:21 +00:00
Magnus Auvinen 3705064b10 renamed .h to .hpp in game because they are c++ headers 2008-06-12 12:09:34 +00:00
Magnus Auvinen f6c67c29cd large commit with loads of clean up. more is comming 2008-06-12 10:51:48 +00:00
Magnus Auvinen ac18c6a3bd more stuff :) 2008-04-27 05:59:38 +00:00