3273: Fix spawnpoints calculation r=def- a=Jupeyy
m_aNumSpawnPoints wasn't increased causing no spawn points to be loaded at all.
Also the maximum value it can have should be 64, not 64 - 1, bcs it's the upper limit, not the index.
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3272: Fix browser wrong alignment r=def- a=Jupeyy
Must be a 1 instead of -1, caused at 74515d4b95
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3268: Fix ScaleFontSize with too long strings r=Jupeyy a=def-
Thanks to PopCorn181 for report
![screenshot_2020-11-08_00-03-19](https://user-images.githubusercontent.com/2335377/98453118-d1c1ae00-2155-11eb-97cf-cd5a455c00d3.png)
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3242: Enable most clang-tidy bugprone-*, misc-*, performance-* checks r=Jupeyy a=def-
Fixes#3134
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3254: Warn when connecting to new server with high gametime r=heinrich5991 a=def-
as suggested by HalfNoob on Discord
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3245: Don't access m_aaSpawnPoints out of bounds r=heinrich5991 a=def-
As discovered by ASAN:
```
/home/teeworlds/src/master/src/game/server/gamecontroller.cpp:142:3: runtime error: index 65 out of bounds for type 'vec2 [64]'
#0 0x5de082 in IGameController::OnEntity(int, vector2_base<float>, int, int, int) /home/teeworlds/src/master/src/game/server/gamecontroller.cpp:142:3
#1 0x5c9f43 in CGameContext::OnInit() /home/teeworlds/src/master/src/game/server/gamecontext.cpp:3291:20
#2 0x4ae3aa in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2473:20
#3 0x4c265d in main /home/teeworlds/src/master/src/engine/server/server.cpp:3551:21
#4 0x7f400fedc09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#5 0x451509 in _start (/home/teeworlds/servers/DDNet-Server-ubsan+0x451509)
```
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3260: "Connect to" popup: Don't disconnect on enter (fixes#3259) r=Jupeyy a=def-
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3248: Update translations for 15.2 release r=Jupeyy a=def-
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3247: Initialize pointer in dragger r=Jupeyy a=def-
How did this not blow up all day long for years?!
Found by UBSAN:
/home/teeworlds/src/master/src/game/server/entities/dragger.cpp:32:29: runtime error: member call on address 0x0000013319b8 which does not point to an object of type 'CCharacter'
0x0000013319b8: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x5501de in CDragger::Move() /home/teeworlds/src/master/src/game/server/entities/dragger.cpp:32:29
#1 0x5522c2 in CDragger::Tick() /home/teeworlds/src/master/src/game/server/entities/dragger.cpp:153:3
#2 0x5eb11e in CGameWorld::Tick() /home/teeworlds/src/master/src/game/server/gameworld.cpp:261:11
#3 0x58d660 in CGameContext::OnTick() /home/teeworlds/src/master/src/game/server/gamecontext.cpp:751:10
#4 0x4afefe in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2558:19
#5 0x4c26fd in main /home/teeworlds/src/master/src/engine/server/server.cpp:3551:21
#6 0x7f2c8cc9309a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#7 0x451509 in _start (/home/teeworlds/servers/DDNet-Server-ubsan+0x451509)
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
/media/ddnet/src/game/editor/layer_game.cpp:42:35: warning: qualified name 'm_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile' refers to a member overridden in subclass; did you mean 'CLayerTiles'? [bugprone-parent-virtual-call]
m_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile(x, y, through_cut);
^~~~~~~~~~~~~
CLayerTiles::
/media/ddnet/src/game/editor/layer_game.cpp:42:35: note: FIX-IT applied suggested code changes
As discovered by ASAN:
/home/teeworlds/src/master/src/game/server/gamecontroller.cpp:142:3: runtime error: index 65 out of bounds for type 'vec2 [64]'
#0 0x5de082 in IGameController::OnEntity(int, vector2_base<float>, int, int, int) /home/teeworlds/src/master/src/game/server/gamecontroller.cpp:142:3
#1 0x5c9f43 in CGameContext::OnInit() /home/teeworlds/src/master/src/game/server/gamecontext.cpp:3291:20
#2 0x4ae3aa in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2473:20
#3 0x4c265d in main /home/teeworlds/src/master/src/engine/server/server.cpp:3551:21
#4 0x7f400fedc09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#5 0x451509 in _start (/home/teeworlds/servers/DDNet-Server-ubsan+0x451509)
How did this not blow up all day long for years?!
Found by UBSAN:
/home/teeworlds/src/master/src/game/server/entities/dragger.cpp:32:29: runtime error: member call on address 0x0000013319b8 which does not point to an object of type 'CCharacter'
0x0000013319b8: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x5501de in CDragger::Move() /home/teeworlds/src/master/src/game/server/entities/dragger.cpp:32:29
#1 0x5522c2 in CDragger::Tick() /home/teeworlds/src/master/src/game/server/entities/dragger.cpp:153:3
#2 0x5eb11e in CGameWorld::Tick() /home/teeworlds/src/master/src/game/server/gameworld.cpp:261:11
#3 0x58d660 in CGameContext::OnTick() /home/teeworlds/src/master/src/game/server/gamecontext.cpp:751:10
#4 0x4afefe in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2558:19
#5 0x4c26fd in main /home/teeworlds/src/master/src/engine/server/server.cpp:3551:21
#6 0x7f2c8cc9309a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#7 0x451509 in _start (/home/teeworlds/servers/DDNet-Server-ubsan+0x451509)
3237: Create fallback wordlist in sourcecode (fixes#3206) r=Learath2 a=def-
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3222: Kick-voting someone from team doesn't kill locked team (fixes#3207) r=heinrich5991 a=def-
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3117: Enable further clang-tidy checks to modernize the code r=heinrich5991 a=def-
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
And fix the code:
cmake -GNinja -DWEBSOCKETS=OFF -DMYSQL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVIDEORECORDER=ON -DAUTOUPDATE=OFF -DANTIBOT=OFF -DUPNP=OFF -DPREFER_BUNDLED_LIBS=OFF -DINFORM_UPDATE=OFF -DCMAKE_CXX_CLANG_TIDY="clang-tidy;--fix-errors" -DCMAKE_C_CLANG_TIDY="clang-tidy;--fix-errors" .
ninja -j 1
Manually fixed sizeof(auto) in a few occurences (i.e. server.cpp:1359)
First steps for #3088
Co-authored-by: def <dennis@felsin9.de>
3231: Fix skin index r=def- a=Jupeyy
Beside that this was wrong anyway, i hoped i could atleast get the index from the sorted list insert, but that returns the last index in the list, instead of the new inserted index(just like rn), so just revert what I added in 8d6148b20b
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3228: Add m_PosEnv (of sound sources) as index that must be offset when appending a map r=heinrich5991 a=Patiga
If you append a map to another, all indices of it must be offset. This doesn't happen with the position envelope index of sound sources, meaning it would (if the original maps had at least one envelope) point to the wrong envelope.
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Patiga <dev@patiga.eu>
3220: Fix overlapping of combined binds with modifiers [Fixes#3182] r=heinrich5991 a=Banana090
Just fixes https://github.com/ddnet/ddnet/issues/3182
Works as it used to work, but does not call for binds with no modifier when the same key was used already for modified bind
Co-authored-by: Дядя Женя <spy090@yandex.ru>
3221: Revert "Show halloween skins only on Halloween" r=Jupeyy a=def-
People are clearly unhappy with this event, so let's revert it. On
servers I've set events 0 already.
This reverts commit ae90bdf3f9.
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3204: Much more readable Call Vote menu and code r=def- a=Banana090
I find "Call Vote" menu useless af right now, because it's simply impossible to read it. So when you want to call vote for a map you open website and find the one you want, after that making /map skipping the "Call Vote" menu completely. It's useful for calling for random map btw, but anyway too ugly to look at.
**OLD LOOK**
![callvoteold](https://user-images.githubusercontent.com/39315809/97338602-a48e1980-1892-11eb-8c93-5d8656d3abeb.png)
**NEW LOOK**
![callvotenew](https://user-images.githubusercontent.com/39315809/97339380-9096e780-1893-11eb-8c3c-1f8630096d9f.png)
**NEW LOOK (RconAuted)**
![callvotenewrcon](https://user-images.githubusercontent.com/39315809/97340605-0e0f2780-1895-11eb-898b-3c3b8258cced.png)
Changed nothing, but row and text size + View rect size, because for some reason it was small for preserving space for RCON Auted users. Why?
Also changed the name of rect "Extended" to "RconExtension" to make it more clear what is it for.
Would be cool also to remove all that junk that is not actual votes from DDNet server vote list (finishers, average time) and merge it into one line with map's name.
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Дядя Женя <spy090@yandex.ru>
3195: Use str_truncate more often r=heinrich5991 a=def-
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
3128: Add add_map_votes command for easier local map testing r=heinrich5991 a=def-
No need to tell new players how to manually add a vote or load a map from rcon
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
3124: Remove option to make map sounds external r=def- a=Patiga
![2020-10-17-180507_401x333_scrot](https://user-images.githubusercontent.com/44099679/96347669-8dd21080-10a3-11eb-8b24-abdab7f41020.png)
Right now it is impossible to have a working external sound. External
sounds render unusable the moment the map is saved and given to another
player. For the mapper it seems like everything is working since the
mapper has the sound file. For anyone else it simply won't work. Since
1. there is no use for it and
2. it adds unnecessary complexity and confusion,
I propose removing it entirely.
None of the ddnet maps use external sounds, only 25 maps from the map archive have external sounds
Please have a look over the changed ui code.
Co-authored-by: Patiga <dev@patiga.eu>
3077: UI Elements r=def- a=Jupeyy
Build will fail bcs of clang-format,
i'll update this comment to explain.
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3191: Fix IME state softlock under fcitx and macos + Update DoEditBox logic to be the same as chat r=def- a=TsFreddie
IME state fix closes#3185 and closes#3150
DoEditBox update closes#3186, now cursor behave the same as chat where only one cursor (either the real one or the editing one) will be shown.
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: TsFreddie <tsfreddiewang@gmail.com>
3115: Smooth Camera r=def- a=TsFreddie
closes#3096
Since nobody expressed any opinions, how about we get this in and see some reactions. it is off by default anyway.
Co-authored-by: TsFreddie <tsfreddiewang@gmail.com>
3157: Show option to disable system messages in settings r=Jupeyy a=def-
## Summary
Makes it a bit easier to find, prefer it on a busy server. Also clarified the friend message toggle is for highlighting only.
![screenshot-20201020@182835](https://user-images.githubusercontent.com/2335377/96615964-41d0d700-1302-11eb-910e-4c56f0c8451c.png)
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options [does not apply]
- [x] Written a unit test if it works standalone, system.c especially [does not apply]
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
3122: Fix arithmentic problems r=def- a=Jupeyy
The first three commits are safe
The ones i'll add later will be inside the gamecore, so might alter behaviour.
I'll see which ones are critical, but takes me some time
i fixed most in #3081
3137: Add gfx debug r=def- a=Jupeyy
If someone wants to try, you have to execute the client with a config that contains dbg_gfx 1
If opengl debug is supported it will show "Enabled OpenGL debug mode" in the console
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
/home/teeworlds/src/master/src/game/server/ddracechat.cpp:1108:65: runtime error: signed integer overflow: 99999999 * 50 cannot be represented in type 'int'
3149: Fix memory leak on team finish and read of uninitialized data r=def- a=Zwelf
Fixes#2522, fixes#3144 and fixes second leak from #3134.
Co-authored-by: Zwelf <zwelf@strct.cc>
3139: Use NUM_DUMMYS for dummy array length r=def- a=ChillerDragon
Should make code more readable by explaining that the array is used for dummy. Also makes modders life easier if there is a need to scale up dummy count.
I left out two places that do not include client.h
3be8a592e5/src/game/client/prediction/gameworld.h (L92)3be8a592e5/src/game/gamecore.h (L212)
Moving the enum to protocol.h for example is probably not nice.
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
3129: Editor: Fix selection of None value in auto rules (fixes#3013) r=Jupeyy a=def-
by starting the indexing at 0
3138: Fix out of bounds access in GetSolo r=Jupeyy a=def-
As discovered in #3135
3143: Ignore ddnet-info.json dl failure again r=Jupeyy a=def-
too aggressive, might just be bad internet at the moment
Co-authored-by: def <dennis@felsin9.de>
3116: Show halloween skins only on Halloween r=heinrich5991 a=def-
Making use of the skin downloader.
Skin choice is based on your name, only active on October 31 and November 1 with events 1 in settings
Co-authored-by: def <dennis@felsin9.de>
3108: Make GL 1.5 default r=def- a=Jupeyy
If ppl see white textures its related to
#2125
and you need to revert it, bcs thats not fixable, there is no extension for GL_GENERATE_MIPMAP or smth
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Right now it is impossible to have a working external sound. External
sounds render unusable the moment the map is saved and given to another
player. For the mapper it seems like everything is working since the
mapper has the sound file. For anyone else it simply won't work. Since
1. there is no use for it and 2. it adds unnecessary complexity and
confusion, I propose removing it entirely.
3112: Fix and change text cursor r=def- a=Jupeyy
Pls check if u like the new cusor and if it works now
fixes#3110
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3120: Embed map sounds by default r=heinrich5991 a=Patiga
Not one ddnet map has a external map sound since there are none which would work that way
Co-authored-by: Patiga <dev@patiga.eu>
3100: Fix offline client that is not in menu r=heinrich5991 a=Jupeyy
E.g. popups like "ddnet-info.json" failed will cause weird NaN glitches, bcs the impl relys on ChangePosition to clean movetime and animation start
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3101: Fix hookchains r=heinrich5991 a=Jupeyy
Its already increased by the for loop.
Might have made the hook shorter(for very very long hooks) the past 3 years xd
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
To be friendly to other implementors of the format, the CRC field is now
zeroed out instead of completely gone.
Drop support for v2 and v3 of the ghost format, the ghost files should
have been automatically converted by the client already.
/media/ddnet/src/game/client/animstate.cpp:54:27: warning: The left operand of '*' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
pSeq->m_X += pAdded->m_X * Amount;
^
/media/ddnet/src/game/editor/auto_map.cpp:94:17: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
int RunID = pCurrentConf->m_aRuns.add(NewRun);
^
/media/ddnet/src/engine/server/sql_string_helpers.cpp:74:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
and mark some false positives
/media/ddnet/src/engine/client/backend_sdl.cpp:329:30: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
/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++)
^
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/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/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)
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>
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>
This prevents a confusing situation where /pause and /spec lead to spectating yourself.
This happens if you accidentally pressed spectate_next key when playing.
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>
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.
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
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>
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>
2800: Style-fixed version of #2784 r=def- a=heinrich5991
Thanks to @Jupeyy for the original pull request.
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2738: Don't search the sorted array linearly r=heinrich5991 a=Learath2
Small optimization but it could start mattering with #2733
Co-authored-by: Learath <learath2@gmail.com>
2758: Remove the rudimentary fuzzing since no one uses it anyway r=heinrich5991 a=def-
2769: Update front.png by Soreu r=heinrich5991 a=def-
2772: Dont predict camera position on spectator changed r=heinrich5991 a=BannZay
No reason to predict camera position in case when we just changed spectator.
But tbh I have not found a big reason to predict it at all.
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Andrii <bannzay3@gmail.com>
2747: Fix proof circle position in editor r=heinrich5991 a=def-
As reported by Ravie on Discord. Tee is not drawn exactly in center.
Co-authored-by: def <dennis@felsin9.de>
2742: Add str_utf8_copy that trim broken utf8 sequence at the end. r=heinrich5991 a=TsFreddie
Currently this replaces `str_copy` text input and clipboard paste in chat. Many places may need the same treatments, like steam names.
![image](https://user-images.githubusercontent.com/3797859/92263741-08b8e080-eed5-11ea-84a5-b7f070ded260.png)
Test string:
abcd今天是个好日子心想的事儿都能成今天是个好日子打开了家门咱迎春风今天是个好日子心想的事儿都能成今天是个好日子打开了家门咱迎春风今天是个好日子心想的事儿都能成今天是个好日子打
2745: Update mapres by mind r=heinrich5991 a=def-
Adapted from 0.7 for new renderer. Not sure if this makes sense :D
Co-authored-by: TsFreddie <tsfreddiewang@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2767: Don't lock SQL writes r=Zwelf a=def-
The slow query logs are full of this:
# Time: 200906 21:03:43
# User@Host: teeworlds[teeworlds] @ ger6.ddnet.tw [89.163.212.120]
# Thread_id: 101540 Schema: teeworlds QC_hit: No
# Query_time: 11.012166 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 67
SET timestamp=1599419023;
LOCK TABLES record_teamrace WRITE, record_teamrace AS r WRITE;
Do we really need these lock? See also
https://dev.mysql.com/doc/refman/5.7/en/table-locking.html
> InnoDB tables use row-level locking so that multiple sessions and
> applications can read from and write to the same table simultaneously,
> without making each other wait or producing inconsistent results. For
> this storage engine, avoid using the LOCK TABLES statement, because it
> does not offer any extra protection, but instead reduces concurrency.
Co-authored-by: def <dennis@felsin9.de>
The slow query logs are full of this:
# Time: 200906 21:03:43
# User@Host: teeworlds[teeworlds] @ ger6.ddnet.tw [89.163.212.120]
# Thread_id: 101540 Schema: teeworlds QC_hit: No
# Query_time: 11.012166 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 67
SET timestamp=1599419023;
LOCK TABLES record_teamrace WRITE, record_teamrace AS r WRITE;
Do we really need these lock? See also
https://dev.mysql.com/doc/refman/5.7/en/table-locking.html
> InnoDB tables use row-level locking so that multiple sessions and
> applications can read from and write to the same table simultaneously,
> without making each other wait or producing inconsistent results. For
> this storage engine, avoid using the LOCK TABLES statement, because it
> does not offer any extra protection, but instead reduces concurrency.
2751: More aggressive analysis & check 2.0 gl Functions that were used r=def- a=Jupeyy
If even that fails, I'm out of ideas
Checks all texture shaders, checks all functions used.
2752: Can't detect if paused on KoG, so don't show button r=def- a=def-
Since they're running an old version of DDNet server
2756: Don't deactivate menu when a popup is active r=def- a=Learath2
Deactivating menu while a popup is active causes the menu to never open again.
Reported by Anxton on discord.
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Learath <learath2@gmail.com>
Seems more useful than Spectate and Connect Dummy, both of which are
often mistaken by newcomers.
Make button sizes more consistent
Hide buttons that make no sense
2713: allow empty max ping filter r=heinrich5991 a=BannZay
The inconvenieces I discovered so far:
1. You got to write 999 to "disable" this filter
2. If you try to clear this field and then type 75 then the field will contain 750 because the last zero is bugged at this point
Those are fixed
What I would like to be fixed as well (not sure if I gona do this soon):
1. Update browser servers live without refreshing. You press refresh - you receives all the servers and then you should be able (but currently not) to filter them out without pressing on "Refresh" button again but just by changing the max ping value
Co-authored-by: Andrii <bannzay3@gmail.com>
2674: Add nameplates friend marks r=heinrich5991 a=BannZay
Problem: when I play with a friend in team 0, and there are many players nearby, I cannot distinguish him due to nameplates overlapping. It's getting worse when they are in freeze.
Solution: Mark your teammate as "Friend" and setup "cl_nameplates_friendmark"
Result:
![v2](https://user-images.githubusercontent.com/17499770/91647684-08988b00-ea66-11ea-9407-336437391b4f.png)
Co-authored-by: Andrii <bannzay3@gmail.com>
2710: Fix layers right click on item opens menu for previously selected (left clicked) item r=heinrich5991 a=BannZay
```
Im 'corneumToday at 16:55
when i have a layer selected and rightclick on another one to change its properties, it doesnt switch to that layer. that hasnt always been this way and its throwing me off lately
especially because it still opens the menu for the other layer
```
Co-authored-by: Andrii <bannzay3@gmail.com>
2708: Disabling 3.3 in settings tab should reset to version 3.0 r=def- a=Jupeyy
We don't have a way to query the default config value, except including the config_variables.h, do we?
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2691: Also check for divisibility by 16 of height (fixes#2687) r=heinrich5991 a=def-
2701: Set search field active when opening file dialog in editor r=heinrich5991 a=def-
2702: Remove fallback for Teeworlds' settings.cfg (partially fixes#2698) r=heinrich5991 a=def-
2705: Clarify kill and /kill r=heinrich5991 a=def-
Co-authored-by: def <dennis@felsin9.de>
2667: Fix server port in teehistorian r=def- a=heinrich5991
Official servers weren't affected because they didn't use the default of
`sv_port 0`.
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2653: Fix background map loading r=def- a=Jupeyy
As reported.
Tested all possible contexts, hope this is right now
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2598: Allow specifying an OpenGL version manually r=def- a=Jupeyy
Ofc don't merge, we'll test it first, and if we want merge it, i'd need to enable shader compability for OpenGL 4+, and general support for OpenGL 3.1 and 3.2(bcs i think they already don't allow some older GL commands).
Also i never really read in the OpenGL 1.x specification, i remember that older OpenGL versions required glBegin and stuff like that
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2631: Enable "Switch weapon on pickup" by default r=heinrich5991 a=def-
As voted in Discord, suggested by Lady Saavik
Co-authored-by: def <dennis@felsin9.de>
2637: Send larger distance when zooming r=heinrich5991 a=def-
since sometimes with dyncam it can be just at the border.
As reported by Lady Saavik
Co-authored-by: def <dennis@felsin9.de>
2579: Ship map_convert_07 executable, allow drag'n'drop and ship Gold Mine map (with sixup version) instead of Kobra 4 and Goo! r=def- a=def-
2588: Add instructions about how to kill and pause game r=def- a=def-
Co-authored-by: def <dennis@felsin9.de>
2566: Optimization: Don't calculate with too small fraction r=heinrich5991 a=def-
since it won't add up to anything anyway.
Hopefully doesn't break any physics.
Co-authored-by: def <dennis@felsin9.de>
2465: Sqlite3 support and prepared statements r=heinrich5991 a=Zwelf
This PR changes the abstraction layer of the score backend to thin abstractions over the MySQL and SQLite3 library. It executes all Queries in one worker thread making it easier to use the ddnet thread pool. This doesn't change much, because each the mysql-connection was locked with `m_SqlLock` beforehand, serializing writes and reads respectively.
Behavior change (even though I tried to minimize them):
* `sv_use_sql` is used to determine if mysql server should be added
* `sv_sql_failure_file` is replaced by `sv_sqlite_file`
* `sv_sqlite_file` is either used as a backup server when `sv_use_sql` is enabled or as the primary read+write server when `sv_use_sql` is disabled
* `/load` now escapes the like-string
Since I am not good at designing config file commands, I would appreciate feedback on this part.
WIP:
* [x] rewrite SQL statements to work in both MySQL and SQLite (preferable just ANSI-SQL)
* [x] create tables (`COLLATE BINARY` and encoding info)
* [x] store rank (UPSERT for points)
* [x] load birthday (different function in sqlite for time handling)
* [x] `/mapinfo` (`convert(? using utf8mb4) COLLATE utf8mb4_general_ci`)
* [x] `/map` (`convert(? using utf8mb4) COLLATE utf8mb4_general_ci`)
* [x] store teamrank (`GROUP_CONCAT`)
* [x] `/teamrank` (`GROUP_CONCAT`)
* [x] ~`/top5team` (`GROUP_CONCAT`)~ doesn't contain GROUP_CONCAT
* [x] `/times` (`UNIX_TIMESTAMP`)
* [x] `/load` without any arguments (`UNIX_TIMESTAMP`)
* [x] all commits compiling, making future bisect easier
* [x] write a sqlite_to_mysql script
* [x] write an old_file_server to sqlite script
* [x] gracefully shutdown DbPool
Co-authored-by: Zwelf <zwelf@strct.cc>
2502: Improved dummy switching r=def- a=Fireball-Teeworlds
- Fix a use-after-free when there are no new snapshots for the cl_dummy tee after the switch: #2499 .
- When one of the tees is hooked, cycling through them will no longer show phantom hook for the other tee: https://youtu.be/mxVT4pdyGnU.
- Dummy switch might happen a bit quicker since it doesn't depend on receiving new snapshots.
- Simplified code: m_LastDummy2 is no more.
Co-authored-by: Fireball <fireball.teeworlds@gmail.com>
2501: Show "Free View" for Sixup r=fokkonaut a=Learath2
@fokkonaut is this enough?
bors delegate=fokkonaut
Co-authored-by: Learath <learath2@gmail.com>
2433: Fix votes for sixup r=heinrich5991 a=Learath2
I think this looks sane but I haven't tested it at all for idk how to even test this locally/alone
2505: Fix legacy 64 player serverinfo, don't send duplicate packets (fixes#2495) r=heinrich5991 a=def-
For legacy we sent the first packet once correctly, then the 2nd and 3rd
packet without the marker and token at the start, so they never worked.
For new 64 player serverinfo we sent all packets correctly but the 1st
packet twice.
Introduced in #1955.
2506: Prevent whisper spam from 0.7 (fixes#2504) r=heinrich5991 a=def-
Co-authored-by: Learath <learath2@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
- Fix a use-after-free when there are no new snapshots for the cl_dummy tee after the switch.
- When one of the tees is hooked, cycling through them will no longer show phantom hook for the other tee.
- Dummy switch might happen a bit quicker since it doesn't depend on receiving new snapshots.
- Simplified code: m_LastDummy2 is no more.
Probably related to #2487, was previously fixed and caused stoppers not
to work.
src/game/collision.cpp:902:247: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
src/game/collision.cpp:891:252: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
src/game/collision.cpp:885:251: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
2478: Use (u)int64 from system.h instead of (u)int64_t from cstdint r=heinrich5991 a=def-
src/game/client/prediction/gameworld.h:62:90: error: ‘int64_t’ has not been declared
62 | void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask);
| ^~~~~~~
2480: Send zoom status for dummy too r=heinrich5991 a=def-
Co-authored-by: def <dennis@felsin9.de>
src/game/client/prediction/gameworld.h:62:90: error: ‘int64_t’ has not been declared
62 | void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask);
| ^~~~~~~
2474: Remove IP skins r=heinrich5991 a=def-
2476: Use x instead of y in show distance (fixes#2475) r=heinrich5991 a=def-
Co-authored-by: def <dennis@felsin9.de>
2429: Use a cubic polynomial for smoothing zoom r=def- a=heinrich5991
Supersedes #2420.
Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2446: Fix storing finish on solo server with practice mode enabled r=heinrich5991 a=Zwelf
Fixes#2445
vulnerable versions:
* 506602d472c48821b6e7bb846b86431a113834a1..59a7e1f1873ad58b838cd3470d51b6ba84c02926~
* b99bbccd248437c928b25e32d40deaf98d8ef3ad..4186622d8750f4288be86b9064886a86c665c45d~
Problem was that `OnFinish` is only suited for team0 finishes, where `/practice` can't be enabled. Solo server finishes have to be handled like team finishes in CheckTeamFinished, which checks if `/practice` was enabled.
Co-authored-by: Zwelf <zwelf@strct.cc>
2424: Keep hook when loading r=heinrich5991 a=Zwelf
Solves issue discussed in #2374. Also keeps direction and jump, which is evaluated when player is in /pause. Fire could be deleted, as it does not affect game play in any way.
Co-authored-by: Zwelf <zwelf@strct.cc>
2413: Fix showothers for specchar r=heinrich5991 a=edg-l
Fixes https://github.com/ddnet/ddnet/issues/2410
I also made it use the Alpha on specchars that are on another team.
Co-authored-by: Edgar <git@edgarluque.com>
2401: Client tells server its zoom level (fixes#2087) r=heinrich5991 a=def-
and server adapts the visible distance to it
Co-authored-by: def <dennis@felsin9.de>
2389: Ignore emoticon of spammy players (fixes#2387) r=heinrich5991 a=def-
Controlled with the regular ignore chat button in players menu
Co-authored-by: def <dennis@felsin9.de>
2388: Get rid of the annoying font size warnings r=heinrich5991 a=def-
Since we're not doing anything about them anyway, and I get them
spamming me on every client start.
Co-authored-by: def <dennis@felsin9.de>
2390: Support cl_show_hook_coll_own/other 2 to always show (fixes#2383) r=heinrich5991 a=def-
hook collision, without broadcasting to other players.
Removed cl_show_hook_coll_always in return
Renamed cl_video_showhookcollother to cl_video_show_hook_coll_other for consistency
Co-authored-by: def <dennis@felsin9.de>
hook collision, without broadcasting to other players.
Removed cl_show_hook_coll_always in return
Renamed cl_video_showhookcollother to cl_video_show_hook_coll_other for consistency
2009: Fix min mouse position for follow factor r=heinrich5991 a=Jupeyy
@Learath2 you were the last to change this, would be nice if you could check if this is correct behaviour, i didn't find anything wrong :D
Co-authored-by: jupeyy <jupjopjap@gmail.com>
2379: Fix unused translations r=def- a=3edcxzaq1
Fix so that "Connect Dummy" and "Disconnect Dummy" follows language file
Co-authored-by: sven <sven@rx.lan>
Co-authored-by: 3edcxzaq1 <66034590+3edcxzaq1@users.noreply.github.com>
2374: Restore old /save behavior r=def- a=Zwelf
Fixes#2362, supersedes #2367
I didn't change the /save message. There are already two different: "Use '/load %s' on %s to continue" and "Use '/load %s' to continue".
I think it would be better to add a NetMessage, this could also solve the problem of saving which team members were in the team.
> I guess this can't be used to cheat anything?
Only if an instant rehook is necessary. Might be useful for rehooking an edge hook (but you still have to aim).
Co-authored-by: Zwelf <zwelf@strct.cc>
2356: Make game less dependend on score backend r=heinrich5991 a=Zwelf
Behavior change:
* `sv_save_worse_scores` is respected on file based servers
Mainly a clean up after #2247, but helps #2298 too
Co-authored-by: Zwelf <zwelf@strct.cc>
2335: Make it more clear that this is a sixup translation server r=heinrich5991 a=def-
2336: Set skill level for Sixup (fixes#2334) r=heinrich5991 a=def-
2340: Keeping multiple states consistent is hard (fixes#2315) r=heinrich5991 a=def-
let's go recount every time
2342: Don't forget video recorder fps setting r=heinrich5991 a=def-
after switching to non-videorecorder client
2349: Document which MySQL/MariaDB versions we require (fixes#2343) r=heinrich5991 a=def-
Co-authored-by: def <dennis@felsin9.de>
2338: Ensure that team state is always sent (fix#2315) r=def- a=trml
Noticed that team state wasn't sent to the client in some cases (when SetForceCharacterNewTeam is called directly), which I think this could happen if a team is unlocked between killing and respawning a player. Also added a CheckTeamFinished for that case.
Co-authored-by: trml <trml@users.noreply.github.com>
2301: map_convert_07: Check image width for divisibility by 16 r=heinrich5991 a=def-
As noticed on Sunny Land.
> [5:31 PM] redix: in theory it should be enough if width and height are divisible by 16
Now running this over our maps and fixing them manually.
Co-authored-by: def <dennis@felsin9.de>