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>
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.
- 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.
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);
| ^~~~~~~
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
2358: Allow any update.json size r=heinrich5991 a=def-
just grew over 16 KB and thus updates failed. I still need to setup update5 server and will need to release a last release on update4 to have a seemless upgrade-path.
Update: https://update5.ddnet.tw/update.json is ready, 14.0.1 will still land on update4, then we switch to update5.
Co-authored-by: def <dennis@felsin9.de>
just grew over 16 KB and thus updates failed. I still need to setup
update5 server and will need to release a last release on update4 to
have a seemless upgrade-path.
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>
2279: Only forbid resizing when videorecorder is recording r=heinrich5991 a=def-
2327: List data files in `CMakeLists.txt` r=def- a=heinrich5991
This fixes missing files for people recompiling when we add new data
files.
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2276: Fix segmentation fault when creating sql tables failed r=heinrich5991 a=Zwelf
`GameServer()->OnShutdown(true);` (which would wait on running threads to exit)
wasn't called if an error occured in the server init. Therefore `CServer` was
freed before the init-thread finished executing, causing a use after free from
`CSqlConnector::ms_ppSqlReadServers` pointing to `CServer->m_apSqlReadServers`.
Fixes#2271
Note that the server exits when creating tables failed. Since the tables are created by default, it has to be disabled explicitly (e.g. `add_sqlserver r teeworlds record teeworlds PASSWORD "localhost" 3306 0`) if the servers should start even when the database connection fails.
Co-authored-by: Zwelf <zwelf@strct.cc>
`GameServer()->OnShutdown(true);` (which would wait on running threads to exit)
wasn't called if an error occured in the server init. Therefore `CServer` was
freed before the init-thread finished executing, causing a use after free from
`CSqlConnector::ms_ppSqlReadServers` pointing to `CServer->m_apSqlReadServers`.
2247: Thread safe SQL interaction r=def- a=Zwelf
This PR intends to make the database interaction thread safe and optimizes some SQL queries. This is still a WIP, but since it is a rather big PR I wanted to get feedback early on.
Benefits:
* remove race conditions leading to undefined behavior and potential crashes
* logging game related database results in teehistorian would be possible
Behavior change:
* /top5team prints ranks in reverse order when passing a negative number (like /top5, /top5points)
* Optimize SQL statements for /rank /teamrank /top5 /top5team /points /top5points
* /load without parameters doesn't pass the SQL error to the user (as most other functions)
* Simplify IScore interface
* Add UUID to /save table (update of database schema necessary):
```
ALTER TABLE record_saves ADD SaveID varchar(64);
```
* /save immediately kills team and loads it again if the database insert fails.
still TBD:
* [x] saving (team) score when finishing
* [x] loading team save
* [x] loading initial time and birthday check
* [x] /map and random map votes
* [x] RFC: generate a passphrase (2-3 word) if save-code exists or no save-code is given making /save failures much more rare and save-codes more secure
* [x] clean up code (removing now unused structs, ordering of functions in IScore)
Co-authored-by: Zwelf <zwelf@strct.cc>
2202: Send DDNet version early in the connection process r=Learath2 a=heinrich5991
This gets rid of the problem that we don't know whether we should send
full snapshots to clients because they haven't told us about them being
DDNet yet.
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This gets rid of the problem that we don't know whether we should send
full snapshots to clients because they haven't told us about them being
DDNet yet.
Add libnotify support for linux client
Also unify notification management
Make libnotify mandatory for the client. It is installed on 100% of Arch
Linux systems and on 70% of Debian systems. I'd guess the remaining
Debian systems are servers.
Detect dependent libraries of `libnotify` using `pkg-config`. Remove
library-specific code from the game module. Decrement refcount for
libnotify notification object before leaving the function.
2119: Change last render logic, when inactive r=def- a=Jupeyy
Just a small fix to let the client not try to get high fps, when it "thinks" it didn't render for a long time.
(is still affected by the SDL check "if window has input" at the cl_refresh_rate calculation, so not a 100% fix).
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2069: Move global configuration out of client interface r=heinrich5991 a=ChillerDragon
2076: Allow editing multiple tile layer props r=heinrich5991 a=Learath2
Requested by Ravie on discord
2095: Fix `AntibotDestroy` being called twice r=def- a=heinrich5991
The resource deallocation needs to happen in symmetry with the
allocation, otherwise we get unmatched dealloctions leading to crashes.
Allocations happened in `CAntibot::Init`, but it was not guaranteed that
this was called before the destructor.
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: Learath <learath2@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2070: Fix demo recording with broken maps r=heinrich5991 a=Learath2
Apparently there are maps out there with broken headers advertising the wrong map size. This allows demos to be recorded on those.
Example of such a map is `ctf4_old_d668e9fa_2f472051b26b6bffaa4af8990cf882cafd6364e00e1333b77762cb9911e49464.map`
Hosted on `Allround Network`
Reported by teini94 on discord
Co-authored-by: Learath <learath2@gmail.com>
2071: Add an option to only start a new demo when connect while automatically record demos r=def- a=sirius1242
Origin auto demo recording of ddnet will generate lots of demo files especially when playing in mods which have shorter rounds, such as infclass. I added a new option to open a new demo file only when connect to server (include map changing), this is disabled by default, and can use `cl_auto_demo_on_connect 1` to open. It works only when `cl_auto_demo_record` open.
Co-authored-by: sirius <sirius.ustc@gmail.com>
2061: use pid in file names of temporary files r=heinrich5991 a=def-
to prevent race conditions with multiple clients running when saving maps, config on quit, during upgrade
Co-authored-by: def <dennis@felsin9.de>
2050: Fix race condition. Closes#2004 r=def- a=Learath2
I guess a new state is better then a global variable
Co-authored-by: Learath <learath2@gmail.com>
1981: Fix: background colors being set to white r=def- a=Aerll
After changing either of background colors in ddnet tab in settings and reopening the client, both become white.
Co-authored-by: Aerll <31746984+aerll@users.noreply.github.com>
Saves should not be loadable from one to the other.
Requires:
ALTER TABLE record_race ADD COLUMN DDNet7 BOOL DEFAULT FALSE AFTER GameID;
ALTER TABLE record_teamrace ADD COLUMN DDNet7 BOOL DEFAULT FALSE AFTER GameID;
ALTER TABLE record_saves ADD COLUMN DDNet7 BOOL DEFAULT FALSE AFTER Server;
as reported by valgrind --tool=memcheck:
==376722== Conditional jump or move depends on uninitialised value(s)
==376722== at 0x1CDBDB: int maximum<int>(int, int) (math.h:79)
==376722== by 0x216A46: CPlayer::Tick() (player.cpp:174)
==376722== by 0x1FB308: CGameContext::OnTick() (gamecontext.cpp:658)
==376722== by 0x1C60AF: CServer::Run() (server.cpp:2046)
==376722== by 0x1CB099: main (server.cpp:3040)
==376722==
==376722== Conditional jump or move depends on uninitialised value(s)
==376722== at 0x183F27: int minimum<int>(int, int) (math.h:77)
==376722== by 0x216A65: CPlayer::Tick() (player.cpp:175)
==376722== by 0x1FB308: CGameContext::OnTick() (gamecontext.cpp:658)
==376722== by 0x1C60AF: CServer::Run() (server.cpp:2046)
==376722== by 0x1CB099: main (server.cpp:3040)
Fix by @heinrich5991
from the documentation of objc_msgSend in <objc/message.h>
```
/* Basic Messaging Primitives
*
* On some architectures, use objc_msgSend_stret for some struct return types.
* On some architectures, use objc_msgSend_fpret for some float return types.
* On some architectures, use objc_msgSend_fp2ret for some float return types.
*
* These functions must be cast to an appropriate function pointer type
* before being called.
*/
OBJC_EXPORT void
objc_msgSend(void /* id self, SEL op, ... */ )
OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
OBJC_EXPORT void
objc_msgSendSuper(void /* struct objc_super *super, SEL op, ... */ )
OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
```