Commit graph

2986 commits

Author SHA1 Message Date
bors[bot] ec472a9d0a
Merge #2298
2298: Log save/load in teehistorian r=heinrich5991 a=Zwelf

Including tests

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-06-26 12:45:08 +00:00
Zwelf d8aab366fc Log save/load in teehistorian 2020-06-26 00:01:12 +02:00
bors[bot] 38b95f6c33
Merge #2358
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>
2020-06-25 11:46:34 +00:00
Zwelf a8abc3937b Make game less dependend on score backend 2020-06-25 12:36:01 +02:00
def cf77b567f8 Allow any update.json size
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.
2020-06-25 00:11:00 +02:00
bors[bot] 1750bb09f7
Merge #2335 #2336 #2340 #2342 #2349
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>
2020-06-24 14:37:53 +00:00
def ef61793854 Don't forget video recorder fps setting
after switching to non-videorecorder client
2020-06-24 14:50:25 +02:00
def 5b3b42b771 Make it more clear that this is a sixup translation server 2020-06-24 14:49:23 +02:00
def a8a2b41f3a Set skill level for Sixup (fixes #2334) 2020-06-23 22:47:29 +02:00
Learath f327e5bc42 Log join type 2020-06-23 18:30:57 +03:00
bors[bot] 160a7b71fb
Merge #2279 #2327
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>
2020-06-23 08:48:05 +00:00
bors[bot] 1652d73a5e
Merge #2322
2322: Use proper CSV writing for save codes r=def- a=heinrich5991

Supersedes #2296.

Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-06-23 07:25:20 +00:00
heinrich5991 0db5c51ed9 Add a simple CSV writer for Python's "excel" csv dialect 2020-06-23 09:11:59 +02:00
bors[bot] b720737e5c
Merge #2314
2314: Fix uninitialized warning on SBufferContainerInfo r=def- a=edg-l



Co-authored-by: Edgar <git@edgarluque.com>
2020-06-23 06:05:35 +00:00
def 83c820db09 Fix some naming conventions in videorecorder 2020-06-23 08:00:03 +02:00
def 252cda2d49 Use str_comp instead of strcmp
error: ‘strcmp’ was not declared in this scope
2020-06-22 14:47:49 +02:00
Edgar a03a22b8e5
Fix uninitialized warning on SBufferContainerInfo 2020-06-22 11:23:52 +02:00
Learath 28905c4659 Disable timeout for 0.7 clients 2020-06-20 19:52:23 +03:00
bors[bot] 4a810091b1
Merge #2284
2284: Remove sv_spectator_votes r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-06-20 10:46:03 +00:00
def c53528b92f Allow spectators to start votes 2020-06-20 11:20:54 +02:00
Learath 6db72b2388 Times are no longer negative in 0.7 2020-06-20 11:59:46 +03:00
Learath 91c44f1808 Sixup needs it's own maps 2020-06-20 01:00:45 +03:00
bors[bot] 5b4227fbba
Merge #2283
2283: teehistorian: Track whether clients join via the 0.7 protocol r=Learath2 a=heinrich5991



Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-06-19 20:31:40 +00:00
heinrich5991 e294da41ba teehistorian: Track whether clients join via the 0.7 protocol 2020-06-19 22:06:39 +02:00
Learath da68923ac3 Implement a switch for 0.7 compatibility 2020-06-19 22:08:41 +03:00
Learath 75e96aa5d3 Get rid of more magic constants, adapt to 0.7 2020-06-19 21:48:48 +03:00
Learath d200ef0bb0 Remove ugly hack 2020-06-19 21:42:19 +03:00
Learath 444bd93437 Fix recvmmsg again... 2020-06-19 20:28:55 +03:00
Learath aeb7ea2971 Don't forget that the client is Sixup 2020-06-19 20:28:55 +03:00
Learath 70ecf785bb Compatible version filter 2020-06-19 20:28:55 +03:00
Learath d794520748 Remove forgotten debug messages 2020-06-19 20:28:55 +03:00
Learath 32fb6718dd Allow joining TEAM_SPECTATOR 2020-06-19 20:28:55 +03:00
Learath 9f71478099 Get Rcon working 2020-06-19 20:28:55 +03:00
Learath 2f760e3e40 Forgot to drop port 2020-06-19 20:28:55 +03:00
Learath 88ca573682 Serverinfo and Register support for 0.7
Co-authored-by: Tim Schumacher <tim@timakro.de>
2020-06-19 20:28:55 +03:00
Learath 4067e711ef More template magic. Cleans up 'send-to-all-sixup' 2020-06-19 20:28:55 +03:00
Learath 9e2434c65d Better skin colors. Better game message translation 2020-06-19 20:28:55 +03:00
Learath 9dc1a0357a Get /spec working 2020-06-19 20:28:55 +03:00
Learath e81c718180 Rework netobjs, fix chat 2020-06-19 20:28:55 +03:00
Learath eff28c658a Fix server messages 2020-06-19 20:28:55 +03:00
Learath 40247f6b43 Fix chat 2020-06-19 20:28:55 +03:00
Learath f9cc634683 Fix recvmmsg issue 2020-06-19 20:28:54 +03:00
Learath 03070d0567 Fix many issues 2020-06-19 20:28:52 +03:00
Learath 807c92f1a4 Generate the 0.7 protocol 2020-06-19 20:27:15 +03:00
Learath f7e9df7abf Move the rest of the translation to CServer 2020-06-19 20:27:15 +03:00
Learath b0e5a37fa9 Do message translation differently 2020-06-19 20:27:15 +03:00
Learath 5000b248bb Fix things 2020-06-19 20:27:15 +03:00
Tim Schumacher 442148a194 Begin work on 0.7 support 2020-06-19 20:27:15 +03:00
Learath e9ba23b53a Migrate to 0.6.5 flags 2020-06-19 20:27:15 +03:00
def e36dc36b15 Fix demos header (fixes #2278)
Initially broken in 7aed6476dc
2020-06-19 10:42:19 +02:00
def 47e6c7cce2 Only forbid resizing when videorecorder is recording 2020-06-19 08:19:40 +02:00
bors[bot] 6f8f606e05
Merge #2276
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>
2020-06-18 19:23:00 +00:00
Zwelf f5ac6eea56 Fix segmentation fault when creating sql tables failed
`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`.
2020-06-18 21:11:36 +02:00
def 7aed6476dc Allow larger map names 2020-06-18 18:29:27 +02:00
def 882185e299 Make SaveID DEFAULT NULL 2020-06-18 10:32:58 +02:00
bors[bot] 98b448ebcc
Merge #2247
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>
2020-06-17 19:35:45 +00:00
Zwelf f1b2ff086c Clean up thread safe SQL refactor 2020-06-17 21:15:07 +02:00
Zwelf ea31171873 Generate passphrase for save-code
* when none is given
* if the given save-code already exist
* if the database connection fails therefore it can't be checked if the save-code already exists

Using the short word list from eff:
https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases
2020-06-15 11:14:15 +02:00
Zwelf 528ca377ed Thread safe saving of team score 2020-06-15 11:14:15 +02:00
Zwelf 62d56ca8e8 Make database init with create tables synchronous
Note: database init without creating tables behaves the same
2020-06-15 11:14:15 +02:00
Zwelf 031ac52320 Thread safe /save 2020-06-15 11:14:15 +02:00
Zwelf 4152a1995e Add missing dependeny to sql string helper 2020-06-15 11:14:15 +02:00
12pm 01092a30c1 add sv_tele_others_auth_level 2020-06-14 19:21:12 +03:00
Learath 345798f9e1 Don't miss dummy disconnects. Fix #2257 2020-06-11 13:33:08 +03:00
bors[bot] 92fc95d742
Merge #2202
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>
2020-05-27 17:49:31 +00:00
heinrich5991 f339fea748
Merge pull request #2139 from edg-l/pr_add_upnp
Add UPnP support
2020-05-24 22:23:20 +02:00
Edgar 3569e174f2
refactor upnp code 2020-05-24 11:36:43 +02:00
heinrich5991 0d7872c79e Send DDNet version early in the connection process
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.
2020-05-22 17:58:41 +02:00
Zwelf cd015c5e37 Fix storing incomplete game uuid on /save
Previously the formatted game uuid was cut off after 15 bytes.
Therefore only 52 out of 128 bit of the uuid were stored.

introduced in 69fd7f1767
2020-05-20 22:18:14 +02:00
Learath 850e4e84e4 Reserve bytes for the type and token 2020-05-18 21:13:15 +03:00
Learath 788fc8bb5f Update can happen when the gameserver doesn't exist 2020-05-18 16:17:06 +03:00
Learath 1426392ae7 Don't Destroy if we didn't Init 2020-05-16 23:10:42 +03:00
bors[bot] 3c573cfd2f
Merge #2181
2181: Some antibot fixes r=Learath2 a=heinrich5991



Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-05-16 08:06:53 +00:00
bors[bot] 8c2ae65059
Merge #2177
2177: Extend antibot interface r=def- a=Learath2

Supersedes #2167 

Co-authored-by: Learath <learath2@gmail.com>
2020-05-16 06:07:55 +00:00
heinrich5991 afe2fc930e Fix ITIS, IDONTKNOW not being system messages 2020-05-16 00:41:03 +02:00
heinrich5991 457c4db964 Some antibot fixes 2020-05-16 00:39:17 +02:00
Learath eacc56059b Keep ticks going 2020-05-15 19:29:34 +03:00
Learath 5e02bb5a23 Extend antibot interface
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-05-13 23:39:40 +03:00
trml 99baf219d0 Revert "Remove the dummy prediction"
This reverts commit 681f30950c.
2020-04-18 22:16:25 +02:00
Arda Demir 8648b1a7dc Don't push notification when active 2020-04-15 00:37:58 +03:00
Arda Demir b7d452d2a0
Libnotify support for linux client (#2099)
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.
2020-04-14 17:53:53 +02:00
Ryozuki ea7f3f0a62
prevent endless loop 2020-04-14 12:51:48 +02:00
Ryozuki b647c1e978
Add UPnP support 2020-04-14 12:11:50 +02:00
Ryozuki 588f8a833f
Fix snapshot storage leak 2020-04-11 13:38:02 +02:00
Ryozuki 5f565a5eb5
check for WavpackCloseFile 2020-04-11 13:17:21 +02:00
Ryozuki 7d51a0992a
fix memory leak on sound decoding 2020-04-11 13:17:21 +02:00
Ryozuki 09b79701af
don't check, use dbg_assert 2020-04-11 13:17:20 +02:00
Ryozuki cde63e2f48
Fix TexEx UB 2020-04-11 13:17:20 +02:00
Ryozuki c6731c7e83
Fix uninitialized m_LastProgramID 2020-04-11 13:17:19 +02:00
def dde88bbd77 Fix division by 0 (fixes #2131)
Caused by https://github.com/ddnet/ddnet/pull/2119/
2020-04-10 20:54:05 +02:00
Ryozuki 0da0dddf15 drop glu dependency 2020-04-08 18:19:12 +02:00
def 6fd7ded869 Whitespace 2020-04-07 22:57:07 +02:00
Learath 388d792205 Add an option for highdpi 2020-04-07 23:47:15 +03:00
bors[bot] 65673ab402
Merge #2119
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>
2020-04-07 15:27:29 +00:00
def f7e8b10bff Make gfx_resizable default to 0
because of common graphics issues. As suggested by Jupstar
2020-04-06 12:04:53 +02:00
Jupeyy 888223a529 Change last render logic, when inactive 2020-04-06 03:18:30 +02:00
def a8c3d192d1 Add cl_unpredicted_shadow -1 value (fixes #2100)
to disasble unpredicted shadow even in debug mode
2020-03-31 18:00:20 +02:00
Learath 61e5667624 Streamline platform client 2020-03-28 02:20:16 +03:00
sirius 3c085b53ed fix bug that demo can't play when demo pause and use start_video 2020-03-26 18:25:50 +08:00
bors[bot] 6e78deb0c4
Merge #2069 #2076 #2095
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>
2020-03-23 17:04:15 +00:00