/media/ddnet/src/game/editor/auto_map.cpp:433:1: warning: Potential leak of memory pointed to by 'pUpdateLayer' [clang-analyzer-cplusplus.NewDeleteLeaks]
}
^
[81/219] Building CXX object CMakeFiles/game-shared.dir/src/game/collision.cpp.o
/media/ddnet/src/game/collision.cpp:1197:2: warning: Variable 'f' with floating point type 'float' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter]
for(float f = 0; f < d; f++)
^
The actual work will be fixing those or at least
NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) them so we can enable
this. Disable checks that we don't want.
Exclude external directory from clang-tidy.
3089: Fix out of bounds access in snapshot delta handling r=heinrich5991 a=axblk
Same as 293209e722 + c87a7b438f in 0.7
Co-authored-by: Redix <redix@hotmail.de>
3086: Fix 2 leaks in CServerBrowser r=def- a=Learath2
The only leaks reported by ASan that are allocated by us. There is one other by SDL and one by X11.
Co-authored-by: Learath2 <learath2@gmail.com>
3083: Make menu background camera impl more robust r=def- a=Jupeyy
The vanilla code isnt really robust against short distances, hope this fixes almost all edge cases
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3078: Make initial borderless work again r=heinrich5991 a=def-
Mistakenly disabled in https://github.com/ddnet/ddnet/pull/1418
Co-authored-by: def <dennis@felsin9.de>
3068: Fix alignment issues in CCommandBuffer r=def- a=Learath2
Though I prefer this version I also made one keeping the old ugly pointer arithmetic cb61356105
Feel free to take whichever. Supersedes #3061
Co-authored-by: Learath2 <learath2@gmail.com>
3066: Disallow more commands with testing mode r=def- a=heinrich5991
Also show some useful error message
Supersedes #2778.
Co-authored-by: Andrii <bannzay3@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
src/game/teamscore.cpp:27:78: runtime error: index -1 out of bounds for type 'int const[64]'
#0 0xf5b948 in CTeamsCore::CanKeepHook(int, int) const src/game/teamscore.cpp:27
#1 0xf46fe1 in CCharacterCore::Tick(bool) src/game/gamecore.cpp:325
#2 0xaf7366 in CGameClient::DetectStrongHook() src/game/client/gameclient.cpp:2441
#3 0xadd734 in CGameClient::UpdatePrediction() src/game/client/gameclient.cpp:2249
#4 0xad6e17 in CGameClient::OnNewSnapshot() src/game/client/gameclient.cpp:1675
#5 0x522d55 in CClient::Update() src/engine/client/client.cpp:2767
#6 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#7 0x557fda in main src/engine/client/client.cpp:4341
#8 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#9 0x433e29 in _start (build/DDNet+0x433e29)
src/game/teamscore.cpp:34:78: runtime error: index -1 out of bounds for type 'int const[64]'
#0 0xf5be68 in CTeamsCore::CanCollide(int, int) const src/game/teamscore.cpp:34
#1 0xf46458 in CCharacterCore::Tick(bool) src/game/gamecore.cpp:271
#2 0xaf7374 in CGameClient::DetectStrongHook() src/game/client/gameclient.cpp:2442
#3 0xadd734 in CGameClient::UpdatePrediction() src/game/client/gameclient.cpp:2249
#4 0xad6e17 in CGameClient::OnNewSnapshot() src/game/client/gameclient.cpp:1675
#5 0x522d55 in CClient::Update() src/engine/client/client.cpp:2767
#6 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#7 0x557fda in main src/engine/client/client.cpp:4341
#8 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#9 0x433e29 in _start (build/DDNet+0x433e29)
#0 0x9f70dd in CRaceDemo::OnMessage(int, void*) src/game/client/components/race_demo.cpp:134
#1 0xab81af in CGameClient::OnMessage(int, CUnpacker*, bool) src/game/client/gameclient.cpp:823
#2 0x50ff76 in CClient::ProcessServerPacket(CNetChunk*) src/engine/client/client.cpp:2100
#3 0x51bf62 in CClient::PumpNetwork() src/engine/client/client.cpp:2580
#4 0x526b56 in CClient::Update() src/engine/client/client.cpp:2856
#5 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#6 0x557fda in main src/engine/client/client.cpp:4341
#7 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#8 0x433e29 in _start (build/DDNet+0x433e29)
src/game/client/components/ghost.cpp:600:35: runtime error: index -1 out of bounds for type 'CGameClient::CClientData [64]'
#0 0x78201a in CGhost::OnMessage(int, void*) src/game/client/components/ghost.cpp:600
#1 0xab81af in CGameClient::OnMessage(int, CUnpacker*, bool) src/game/client/gameclient.cpp:823
#2 0x50ff76 in CClient::ProcessServerPacket(CNetChunk*) src/engine/client/client.cpp:2100
#3 0x51bf62 in CClient::PumpNetwork() src/engine/client/client.cpp:2580
#4 0x526b56 in CClient::Update() src/engine/client/client.cpp:2856
#5 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#6 0x557fda in main src/engine/client/client.cpp:4341
#7 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#8 0x433e29 in _start (build/DDNet+0x433e29)
Hopefully fixes these by initializing m_Pos:
src/game/collision.cpp:345:10: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55e85a8f0967 in CCollision::IntersectLineTeleHook(vector2_base<float>, vector2_base<float>, vector2_base<float>*, vector2_base<float>*, int*) /media/ddnet/src/game/collision.cpp:345:10
#1 0x55e85a90767b in CCharacterCore::Tick(bool) /media/ddnet/src/game/gamecore.cpp:255:27
#2 0x55e85af8e477 in CCharacter::Tick() /media/ddnet/src/game/client/prediction/entities/character.cpp:562:9
#3 0x55e85afc867f in CGameWorld::Tick() /media/ddnet/src/game/client/prediction/gameworld.cpp:193:10
#4 0x55e85af500b8 in CGameClient::UpdatePrediction() /media/ddnet/src/game/client/gameclient.cpp:2279:16
#5 0x55e85af48b9b in CGameClient::OnNewSnapshot() /media/ddnet/src/game/client/gameclient.cpp:1675:3
#6 0x55e85a9fdf8c in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2767:22
#7 0x55e85aa0cefe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#8 0x55e85aa2eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7feedbc65151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x55e85a77be0d in _start (/media/ddnet/DDNet+0x705e0d)
src/base/math.h:22:40: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55e85a900c2f in round_to_int(float) /media/ddnet/src/base/math.h:22:40
#1 0x55e85a90cac1 in CCharacterCore::Write(CNetObj_CharacterCore*) /media/ddnet/src/game/gamecore.cpp:515:22
#2 0x55e85a90e171 in CCharacterCore::Quantize() /media/ddnet/src/game/gamecore.cpp:574:2
#3 0x55e85af90be9 in CCharacter::TickDefered() /media/ddnet/src/game/client/prediction/entities/character.cpp:580:9
#4 0x55e85afc8a1b in CGameWorld::Tick() /media/ddnet/src/game/client/prediction/gameworld.cpp:201:10
#5 0x55e85af500b8 in CGameClient::UpdatePrediction() /media/ddnet/src/game/client/gameclient.cpp:2279:16
#6 0x55e85af48b9b in CGameClient::OnNewSnapshot() /media/ddnet/src/game/client/gameclient.cpp:1675:3
#7 0x55e85a9fdf8c in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2767:22
#8 0x55e85aa0cefe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#9 0x55e85aa2eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#10 0x7feedbc65151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#11 0x55e85a77be0d in _start (/media/ddnet/DDNet+0x705e0d)
src/engine/client/serverbrowser.cpp:295:88: runtime error: index 64 out of bounds for type 'CServerInfo::CClient [64]'
#0 0x565020e035bd in CServerBrowser::Filter() /media/ddnet/src/engine/client/serverbrowser.cpp:295:128
#1 0x565020e053b3 in CServerBrowser::Sort() /media/ddnet/src/engine/client/serverbrowser.cpp:352:2
#2 0x565020e0c364 in CServerBrowser::Set(NETADDR const&, int, int, CServerInfo const*) /media/ddnet/src/engine/client/serverbrowser.cpp:620:2
#3 0x565020cf9854 in CClient::ProcessServerInfo(int, NETADDR*, void const*, int) /media/ddnet/src/engine/client/client.cpp:1524:20
#4 0x565020cf8132 in CClient::ProcessConnlessPacket(CNetChunk*) /media/ddnet/src/engine/client/client.cpp:1357:4
#5 0x565020d11656 in CClient::PumpNetwork() /media/ddnet/src/engine/client/client.cpp:2575:5
#6 0x565020d1ba21 in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2856:2
#7 0x565020d26efe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#8 0x565020d48b2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7f4311524151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x565020a95e0d in _start (/media/ddnet/DDNet+0x705e0d)
src/game/client/components/players.cpp:197:5: runtime error: index -2 out of bounds for type 'CGameClient::CClientData [64]'
#0 0x56548eec0487 in CPlayers::RenderPlayer(CNetObj_Character const*, CNetObj_Character const*, CTeeRenderInfo const*, int, float) /media/ddnet/src/game/client/components/players.cpp:197:37
#1 0x56548ec97234 in CGhost::OnRender() /media/ddnet/src/game/client/components/ghost.cpp:344:26
#2 0x56548ef92b26 in CGameClient::OnRender() /media/ddnet/src/game/client/gameclient.cpp:676:28
#3 0x56548ea4659e in CClient::Render() /media/ddnet/src/engine/client/client.cpp:1134:16
#4 0x56548ea7b90f in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3285:7
#5 0x56548ea9bb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#6 0x7f7c844f1151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#7 0x56548e7e8e0d in _start (/media/ddnet/DDNet+0x705e0d)
src/game/client/components/menus_ingame.cpp:108:16: runtime error: index -1 out of bounds for type 'CGameClient::CClientData [64]'
#0 0x55733e6a64c4 in CMenus::RenderGame(CUIRect) /media/ddnet/src/game/client/components/menus_ingame.cpp:108:73
#1 0x55733e632ba7 in CMenus::Render() /media/ddnet/src/game/client/components/menus.cpp:1228:6
#2 0x55733e64b141 in CMenus::OnRender() /media/ddnet/src/game/client/components/menus.cpp:2338:2
#3 0x55733e815706 in CGameClient::OnRender() /media/ddnet/src/game/client/gameclient.cpp:676:28
#4 0x55733e2c959e in CClient::Render() /media/ddnet/src/engine/client/client.cpp:1134:16
#5 0x55733e2fe90f in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3285:7
#6 0x55733e31eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#7 0x7f9a2057e151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#8 0x55733e06be0d in _start (/media/ddnet/DDNet+0x705e0d)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/game/client/components/menus_ingame.cpp:108:16 in
src/game/client/components/menus_ingame.cpp:109:14: runtime error: index -1 out of bounds for type 'CGameClient::CClientData [64]'
#0 0x55733e6a699a in CMenus::RenderGame(CUIRect) /media/ddnet/src/game/client/components/menus_ingame.cpp:109:71
#1 0x55733e632ba7 in CMenus::Render() /media/ddnet/src/game/client/components/menus.cpp:1228:6
#2 0x55733e64b141 in CMenus::OnRender() /media/ddnet/src/game/client/components/menus.cpp:2338:2
#3 0x55733e815706 in CGameClient::OnRender() /media/ddnet/src/game/client/gameclient.cpp:676:28
#4 0x55733e2c959e in CClient::Render() /media/ddnet/src/engine/client/client.cpp:1134:16
#5 0x55733e2fe90f in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3285:7
#6 0x55733e31eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#7 0x7f9a2057e151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#8 0x55733e06be0d in _start (/media/ddnet/DDNet+0x705e0d)
src/engine/shared/snapshot.cpp:72:8: runtime error: signed integer overflow: -1297193910 + -1824658838 cannot be represented in type 'int'
#0 0x565165b0687d in CSnapshot::Crc() /media/ddnet/src/engine/shared/snapshot.cpp:72:8
#1 0x565165c4d20b in CClient::ProcessServerPacket(CNetChunk*) /media/ddnet/src/engine/client/client.cpp:1981:49
#2 0x565165c5d960 in CClient::PumpNetwork() /media/ddnet/src/engine/client/client.cpp:2589:6
#3 0x565165c67a71 in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2856:2
#4 0x565165c72f4e in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#5 0x565165c94b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#6 0x7fba5af2c151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#7 0x5651659e1e0d in _start (/media/ddnet/DDNet+0x705e0d)
src/base/system.c:261:15: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
#0 0x565165b348dc in mem_copy /media/ddnet/src/base/system.c:261:2
#1 0x565165aeb27d in CNetBase::SendControlMsg(NETSOCKET, NETADDR*, int, int, void const*, int, int, bool) /media/ddnet/src/engine/shared/network.cpp:313:2
#2 0x565165aeeb4e in CNetConnection::SendControl(int, void const*, int) /media/ddnet/src/engine/shared/network_conn.cpp:169:2
#3 0x565165af08c5 in CNetConnection::Feed(CNetPacketConstruct*, NETADDR*, int) /media/ddnet/src/engine/shared/network_conn.cpp:367:6
#4 0x565165aec7d2 in CNetClient::Recv(CNetChunk*) /media/ddnet/src/engine/shared/network_client.cpp:94:174
#5 0x565165c5d5ea in CClient::PumpNetwork() /media/ddnet/src/engine/client/client.cpp:2571:24
#6 0x565165c67a71 in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2856:2
#7 0x565165c72f4e in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#8 0x565165c94b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7fba5af2c151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x5651659e1e0d in _start (/media/ddnet/DDNet+0x705e0d)
src/base/system.c:261:15: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
#0 0x5651235308dc in mem_copy /media/ddnet/src/base/system.c:261:2
#1 0x56512375218d in CServerBrowser::Add(NETADDR const&) /media/ddnet/src/engine/client/serverbrowser.cpp:503:3
#2 0x565123752f6a in CServerBrowser::Set(NETADDR const&, int, int, CServerInfo const*) /media/ddnet/src/engine/client/serverbrowser.cpp:548:13
#3 0x5651237564cb in CServerBrowser::Refresh(int) /media/ddnet/src/engine/client/serverbrowser.cpp:705:6
#4 0x5651239a32f8 in CMenus::Render() /media/ddnet/src/game/client/components/menus.cpp:1164:21
#5 0x5651239bd331 in CMenus::OnRender() /media/ddnet/src/game/client/components/menus.cpp:2338:2
#6 0x565123b878f6 in CGameClient::OnRender() /media/ddnet/src/game/client/gameclient.cpp:676:28
#7 0x56512363b5ee in CClient::Render() /media/ddnet/src/engine/client/client.cpp:1134:16
#8 0x56512367095f in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3285:7
#9 0x565123690b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#10 0x7fa8487e8151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#11 0x5651233dde0d in _start (/media/ddnet/DDNet+0x705e0d)
src/game/client/components/skins.cpp:142:14: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55b6bd0f49e1 in CSkins::LoadSkin(char const*, char const*, int, int*) /media/ddnet/src/game/client/components/skins.cpp:142:14
#1 0x55b6bd0f0942 in CSkins::SkinScan(char const*, int, int, void*) /media/ddnet/src/game/client/components/skins.cpp:55:16
#2 0x55b6bcb33928 in fs_listdir /media/ddnet/src/base/system.c:2033:6
#3 0x55b6bcb04024 in CStorage::ListDirectory(int, char const*, int (*)(char const*, int, int, void*), void*) /media/ddnet/src/engine/shared/storage.cpp:316:5
#4 0x55b6bd0f9e2f in CSkins::Refresh() /media/ddnet/src/game/client/components/skins.cpp:222:13
#5 0x55b6bd0f6e33 in CSkins::OnInit() /media/ddnet/src/game/client/components/skins.cpp:194:2
#6 0x55b6bd14c63f in CGameClient::OnInit() /media/ddnet/src/game/client/gameclient.cpp:322:28
#7 0x55b6bcc5f9f8 in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3089:16
#8 0x55b6bcc84b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7f1144ded151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x55b6bc9d1e0d in _start (/media/ddnet/DDNet+0x705e0d)
3053: Optimize uuid lookup r=heinrich5991 a=Jupeyy
Already wrote that patch when i noticed its not about this, maybe we can use it, else nvm
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3048: Add GUI & Game sound volume sliders r=heinrich5991 a=def-
As requested by Pipou
3063: increase buffer size for name_ban messages r=heinrich5991 a=12pm
otherwise reason can be cut off
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: 12pm <30786226+12pm@users.noreply.github.com>
3047: Fix ui_page/ui_settings_page ranges r=Learath2 a=def-
For ui_page makes no difference since we limited in code
For ui_settings_page assets page is now remembered
Co-authored-by: def <dennis@felsin9.de>
2987: Modulize skins, particles, emoticons and game r=def- a=Jupeyy
fixes#2203
Puh, something i always wanted todo.
Need to error read, bcs alot of copy paste.
Modulizes all images, so that all images are mipmap indepedent, without texeloffset problems
I also added the ninja bar analyzer for #2921
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3018: Editor: Improve usability of server settings r=Jupeyy a=def-
- Add Mod button
- Show Del button only when it makes sense
- Update command input text when clicking on an existing command
- Make command clearable
As requested by Cøke
Co-authored-by: def <dennis@felsin9.de>
3022: Text alignment r=def- a=Jupeyy
i think the round borders create a bit of optical illusion, e.g. the "V" in edtior is only 1 pixel of, but looks like its completly left xd
i checked at few resolutions with gimp and only saw around 1 pixel margin of error, but go ahead and test yourself :D
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3038: Use std::sort instead of bubble_sort r=def- a=Jupeyy
Noticed, that its really slow, when you have alot of auto demos
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3033: Reset m_ServerCapabilities on Disconnect r=Jupeyy a=def-
Reported by builder17 that on Vanilla server timeout code can get sent
Co-authored-by: def <dennis@felsin9.de>
3020: Fix all Multiplication type alerts by CodeQL r=heinrich5991 a=def-
> Multiplication result converted to larger type
> A multiplication result that is converted to a larger type can be a
> sign that the result can overflow the type converted from.
Example: https://github.com/ddnet/ddnet/security/code-scanning/17?query=ref%3Arefs%2Fheads%2Fmaster
Co-authored-by: def <dennis@felsin9.de>
3005: Use rest instead of string in some commands r=heinrich5991 a=def-
where it makes sense, means you don't need to quote strings for those
Co-authored-by: def <dennis@felsin9.de>
3010: Use hours in score hud and record r=Learath2 a=def-
3014: Scale auto mapper text size (partially fixes#3013) r=Learath2 a=def-
Co-authored-by: def <dennis@felsin9.de>
3021: only load + save auto mappers for tile layers, not physics layers r=def- a=Patiga
If I'm not mistaken, loading a map without auto mappers, then saving would've caused uninitialized values to be written to the auto mappers of physics layers.
Co-authored-by: patiga <dev@patiga.eu>
2980: Fix laser prediction for non ddrace mods r=def- a=Jupeyy
Correct me, if this is wrong, but only ddrace based mods cannot shot laser through itself.
Tested on vanilla, ictf and fng(with antiping on and prediction on)
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
- Add Mod button
- Show Del button only when it makes sense
- Update command input text when clicking on an existing command
- Make command clearable
As requested by Cøke
2999: Add Serbian Cyrillic translation r=def- a=cobisimo
This is adding Serbian Cyrillic translation and contain complete translation with latest strings.
by Veljko Radovanovic (VekiPro)
3001: Use skin pointer directly r=def- a=Jupeyy
Can't tell if setting the hot item in gui invalidly can potentially break stuff, also a skin refresh button would make this useless anyway
3003: Update brazilian_portuguese.txt r=def- a=rffontenelle
Co-authored-by: Nikola Radovanovic <nikola.r@toptal.com>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2997: Make menu background animations smoother r=def- a=Fireball-Teeworlds
time_get_microseconds() can potentially return big numbers (on my system it seems to be equal to uptime) and at some point float's precision is no longer enough for every 1/60th of a second.
I'm replacing it with LocalTime() - it's also available in the menu and it's counted from the start of the game.
I've tested menu and in-game animations.
Co-authored-by: Fireball <fireball.teeworlds@gmail.com>
2982: Update french translation r=Jupeyy a=def-
by SunnyPistache & Pipou
2985: No country flag for Traditional Chinese r=Jupeyy a=def-
2996: Make types/countries fit ingame (fixes#2989) r=Jupeyy a=def-
Co-authored-by: def <dennis@felsin9.de>
time_get_microseconds() count starts from 1970-01-01 and float's precision is not enough for every 1/60 of a second.
I'm replacing it with LocalTime() - it's also available in the menu and it's counted from the start of the game.
I've tested menu and in-game animations.
2893: Determine binary dir independently of data dir (fixes#2891) r=heinrich5991 a=def-
@Learath2 Could you check if this can be extended to also find the DDNet-Server executable on Mac?
2972: Add explicit button for current map as BG r=heinrich5991 a=def-
2974: Fix autoformatting wrt. generated files r=def- a=heinrich5991
Fix#2962.
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2948: Show File button in demo player r=heinrich5991 a=def-
to easily get the file instead of having to search for it in the file browser again. Complements #2946
2956: Add Background music volume slider r=heinrich5991 a=def-
as requested by hussainx3
2965: Clean up some data r=heinrich5991 a=def-
Co-authored-by: def <dennis@felsin9.de>
2958: AntiPing limit is unintuitive, remove from settings r=heinrich5991 a=def-
2961: Fix hash in formatting-revs.txt r=heinrich5991 a=def-
2963: Handle PNG read errors (fixes#2959) r=heinrich5991 a=def-
and print a more telling error message
I'll check all our existing maps for failures now:
```
$ find . -iname '*.map' | while read i; do echo $i; map_extract $i > /dev/null; find . -iname '*.png' | while read j; do dilate $j; rm -- $j; done; done
```
For skins Soreu and the skin DB team is already taking care. (but I checked and the ones in Skin DB now can all be loaded without error)
Co-authored-by: def <dennis@felsin9.de>
2942: Update swedish translations (by cur.ie) r=heinrich5991 a=def-
2943: Need to send info when updating skin in text field r=heinrich5991 a=def-
As reported by abcqwerty on Discord
Co-authored-by: def <dennis@felsin9.de>
2922: Don't show wrong decisecs in game time in HUD r=heinrich5991 a=def-
I think .me' reported this to me 7 years ago and I've been noticing that they're wrong since then. Time to remove I guess, they don't seem useful anyway.
Co-authored-by: def <dennis@felsin9.de>
2973: initialize physics layer pointer, layer item version (partially fixes#2971) r=def- a=Patiga
Note that the zlib compression still makes it non-deterministic across different machines/versions
Co-authored-by: patiga <patigatus21@gmail.com>
2932: Don't change SpectatorID when not spectating r=def- a=Fireball-Teeworlds
This prevents a confusing situation where /pause and /spec lead to spectating yourself: https://youtu.be/9MzvDoXtMLc (looks as if /pause is broken unless you notice that you are spectating yourself).
This could've happened when you pressed spectate_next button while playing and SpectatorID got changed to yourself. I think it doesn't make sense to allow changing SpectatorID when playing at all.
I've also tried to simplify the code: the number of `for` loops in the updated code goes down from 10 to 3.
Things tested with this change:
1. Cycling through players when spectating (works)
2. Changing SpectatorID when not spectating (no longer possible)
3. Spectating yourself (still possible with "spectate N" command but no longer happens accidentally because of 2)
4. "spectate_closest" command (works)
5. Replaying demos where player goes into spectators (works)
Co-authored-by: Fireball <fireball.teeworlds@gmail.com>
and print a more telling error message
I'll check all our existing maps for failures now:
$ find . -iname '*.map' | while read i; do echo $i; map_extract $i > /dev/null; find . -iname '*.png' | while read j; do dilate $j; rm -- $j; done; done
For skins Soreu and the skin DB team is already taking care.
This prevents a confusing situation where /pause and /spec lead to spectating yourself.
This happens if you accidentally pressed spectate_next key when playing.
2933: Handle rcon cmd completion properly with dummy r=heinrich5991 a=def-
Only active player received them, reconnecting dummy a few times lead to
duplicate entries in tab completion. Now only main player is considered
for the completion.
as reported by Betz@lel-$h@l0m on Discord
Co-authored-by: def <dennis@felsin9.de>
2889: Allow specifying texture LOD BIAS r=def- a=Jupeyy
For Ravie, and others that want the old renderer opengl 3.3 feeling back xd
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Only active player received them, reconnecting dummy a few times lead to
duplicate entries in tab completion. Now only main player is considered
for the completion.
as reported by Betz@lel-$h@l0m on Discord
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:
$ python scripts/fix_style.py
2917: Create ALLOW_X_SKINS game info flag r=heinrich5991 a=def-
To allow server to set any x_ prefixed skin and client won't filter it
out. As requested by Pure_luck for his mod to show players as tanks,
walls, etc. Won't be enabled on DDNet-Servers, thus such skins can be
added where a server modification wants to fine-control what skins are
allowed and can enforce such skins.
Co-authored-by: def <dennis@felsin9.de>
2923: Don't str_copy into string itself r=Learath2 a=def-
when reconnecting after server was full:
[2020-09-25 15:39:34][client]: offline error='This server is full'
Source and destination overlap in strncpy(0xd3328e2, 0xd3328e2, 255)
at 0x483DFDC: strncpy (vg_replace_strmem.c:550)
by 0x249180: str_copy (system.c:2328)
by 0x27E1F5: CClient::Connect(char const*, char const*) (client.cpp:707)
by 0x287864: CClient::Update() (client.cpp:2914)
by 0x28891B: CClient::Run() (client.cpp:3216)
by 0x28EDEC: main (client.cpp:4309)
2924: Fix Score/Time alignment r=def- a=Learath2
![screenshot_2020-09-25_16-52-30](https://user-images.githubusercontent.com/490500/94275676-e81dfc80-ff4f-11ea-9f21-dbf5d1cf73a9.png)
Also adds hours to the time
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Learath <learath2@gmail.com>
when reconnecting after server was full:
[2020-09-25 15:39:34][client]: offline error='This server is full'
Source and destination overlap in strncpy(0xd3328e2, 0xd3328e2, 255)
at 0x483DFDC: strncpy (vg_replace_strmem.c:550)
by 0x249180: str_copy (system.c:2328)
by 0x27E1F5: CClient::Connect(char const*, char const*) (client.cpp:707)
by 0x287864: CClient::Update() (client.cpp:2914)
by 0x28891B: CClient::Run() (client.cpp:3216)
by 0x28EDEC: main (client.cpp:4309)
To allow server to set any x_ prefixed skin and client won't filter it
out. As requested by Pure_luck for his mod to show players as tanks,
walls, etc. Won't be enabled on DDNet-Servers, thus such skins can be
added where a server modification wants to fine-control what skins are
allowed and can enforce such skins.
2918: Allow specifying -DGAME_RELEASE_VERSION r=Learath2 a=def-
to be used for nightlies and release candidates to be able to tell them from regular releases more easily. For example:
CPPFLAGS="-DGAME_RELEASE_VERSION=\\\"15.0.5-rc1\\\"" cmake .
Co-authored-by: def <dennis@felsin9.de>
2915: HTTP: Set final m_State after running completion function r=Jupeyy a=def-
Ensures that we don't delete a file that is being used by ingame map downloader already.
As reported by Jupeyy in #2901
Co-authored-by: def <dennis@felsin9.de>
to be used for nightlies and release candidates to be able to tell them
from regular releases more easily. For example:
CPPFLAGS="-DGAME_RELEASE_VERSION=\\\"15.0.5-rc1\\\"" cmake .
2894: Add new renderer(as streamed vertices) for editor r=def- a=Jupeyy
Does not improve performance in editor!
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2909: Set IME Window Position & Prevent Input from fighting with IME r=def- a=TsFreddie
Mainly solves the backspace problem where you were able to delete from chat and ime comps at the same time.
Also set the position of composition window
Need some testing from other languages' users.
Need https://github.com/ddnet/ddnet-libs/pull/14 to work on windows
Co-authored-by: TsFreddie <tsfreddiewang@gmail.com>
2902: Don't rely on snapshot for ddnet gametype r=heinrich5991 a=Jupeyy
@fokkonaut you need to test again if you mod works.
This time i also did the test for masked entites(but not for non masked ones).
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2898: Inform players that they are in team already r=heinrich5991 a=def-
2901: Remove failed downloaded files immediately r=heinrich5991 a=def-
Especially skins were only deleted after they were requested again
2908: Don't log skin downloading progress r=heinrich5991 a=def-
since it's not really interesting for most players, as long as things work fine
Co-authored-by: def <dennis@felsin9.de>
2907: properly set sound envelope offsets for sound sources r=def- a=Patiga
before, `m_SoundEnvOffset` was always set to the same value as `m_PosEnvOffset`, due to wrong behavior in the ui.
Co-authored-by: patiga <patigatus21@gmail.com>
2906: Use fixed point conversion consistently r=def- a=Learath2
This fixes the issue with the Tex UV coords being complete garbage
Co-authored-by: Learath <learath2@gmail.com>
2874: Add unmasked entities for all mods r=def- a=Jupeyy
Fixes switch tile for unmasked ddnet
And ddnet mods send that they are a race and ddrace mod appearently?
Not very intuitive that ddnet is a superset of them, bcs tiles changed.
Waiting for a review from @fokkonaut
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
fixes graphics bug when new skins are added, skins array is reallocated
and we accessed freed memory
Thanks to Jupeyy & Learath2 for also looking into this
- Increase size of Name and Clan in adding friend fields
- Smaller Search and Exclude fields
- No more duplicate Search - Search - Search text
- Smaller Connect and Refresh buttons
2865: Fix localizing demo list r=Jupeyy a=def-
You can't store the result of Localize in a static, it will be removed
by switching to another language.
Thanks to Jupeyy for report
Co-authored-by: def <dennis@felsin9.de>
As suggested by BannZay on Discord. We scale down when we notice that
no responses arrive. The idea is that player's internet has become
faster than when DDNet started, so increasing the default is ok.
2820: Server: Only recv new packets when we know they are waiting r=Jupeyy a=def-
Reduces the number of syscalls
Co-authored-by: def <dennis@felsin9.de>
2733: Implement on-demand skin downloader, remove Lappi's non-free skins (fixes#1166, fixes#2547) r=Learath2 a=def-
Seems to work on first try, I'm somewhat surprised :D
Future ideas:
- I haven't checked how the performance impact is of a new skin joining,
might want to move the loading to a separate thread?
- Use the skins from download directory instead of redownloading? Might
want to compare modified time.
- Make all skins load on demand only to save some memory?
Co-authored-by: def <dennis@felsin9.de>
2837: Don't allow zero/empty images(bcs malloc(0) and other things) r=def- a=Jupeyy
Would be nicer, if the map loader would check the map for such things, but since the backend works with the image data and assumes its valid, this prevents crashes.
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Seems to work on first try, I'm somewhat surprised :D
Future ideas (not for this change):
- I haven't checked how the performance impact is of a new skin joining,
might want to move the loading to a separate thread?
- Use the skins from download directory instead of redownloading? Might
want to compare modified time.
- Make all skins load on demand only to save some memory?
2814: Remove saving to other servers r=Learath2 a=def-
sv_sql_valid_servernames is no longer required
2818: Load fonts from memory (fixes#2810) r=Learath2 a=def-
Missing: Freeing the memory again. But not so important since we keep
the same fonts until end of process anyway in our case.
@QingGo Could you give this a try from the Github build artifacts? If not, I can provide you a nightly build.
Co-authored-by: def <dennis@felsin9.de>
2816: Implement context for translations (largely taken from Teeworlds) r=Learath2 a=def-
Missing: scripts/languages doesn't work yet, but the context can be
added manually, see german.txt for an example.
Co-authored-by: def <dennis@felsin9.de>
2828: Use resize instead of rescale r=def- a=Jupeyy
rescale doesn't clamp, and looks worse, might be slightly faster tho.
So i also renamed the config vars that might cause resizing and/or are not very useful
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2819: Fix compilation on MinGW Windows r=Learath2 a=def-
graphics.h:197:36: error: ‘uint8_t’ has not been declared
Co-authored-by: def <dennis@felsin9.de>
2815: Renamed tile names. r=def- a=gerdoe-jr
I didn't get why some tiles' names end with `END/START` and another with `DISABLE/ENABLE`, so, I just replaced all `END/START` with `DISABLE/ENABLE`.
Also, I renamed `TILE_BONUS` and `TILE_PENALTY`, because you need to check the variables' declarations/references for understanding their purposes.
Co-authored-by: Vlad <gerdoexx@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Missing: Freeing the memory again. But not so important since we keep
the same fonts until end of process anyway in our case.
@QingGo Could you give this a try from the Github build artifacts?