Commit graph

2950 commits

Author SHA1 Message Date
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
bors[bot] 048ca9fe0a
Merge #2070
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>
2020-03-23 16:58:01 +00:00
bors[bot] bf821fe391
Merge #2071
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>
2020-03-23 16:38:17 +00:00
Learath 6919ed3041 Use updated stub, switch around versions 2020-03-23 15:46:57 +01:00
Learath 060d60f2ea Output library versions 2020-03-23 15:46:57 +01:00
def 2319151fb4 Disable currently broken sv_vanilla_antispoof 2020-02-27 22:53:56 +01:00
sirius 72fd0f9a21 forget to check CONF_VIDEORECORDER defined or not for video rendering pause 2020-02-27 20:32:42 +08:00
sirius b5c931279f add option to pause video rendering when demo playing pause 2020-02-27 18:50:18 +08:00
def 127372b03d Fix timeout protection (fixes #2067)
CNetMsg_Cl_Say should not be a system message
2020-02-22 09:55:17 +01:00
sirius 50b980ea16 add an option to only start a new demo when connect while automatically record demos 2020-02-21 17:01:31 +08:00
Learath c52bbb6c02 Fix demo recording with broken maps 2020-02-19 15:38:58 +03:00
ChillerDragon 9e0f6d2ce0 Move global configuration out of client interface 2020-02-19 11:24:58 +01:00
bors[bot] 43ecec1f2f
Merge #2061
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>
2020-02-13 00:03:23 +00:00
def 31ae4c4d5a use pid in file names of temporary files
to prevent race conditions with multiple clients running when saving
maps, config on quit, during upgrade
2020-02-12 23:14:30 +01:00
def 00b74d2acb Don't overcomplicate Success = false 2020-02-12 22:45:09 +01:00
bors[bot] 72fcf9caa8
Merge #2050
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>
2020-01-26 15:49:30 +00:00
Learath cc8dea393d Address feedback 2020-01-25 21:05:33 +01:00
Dennis Felsing 50d848ec43
Merge pull request #1928 from sirius1242/demo_render2
Demo to video converter function.
2020-01-25 21:01:08 +01:00
Learath 40dc9692aa Fix race condition. Closes #2004 2020-01-25 17:48:32 +01:00
bors[bot] 7a3ebd5948
Merge #2041
2041: Strip spaces in browser (server name) r=heinrich5991 a=ChillerDragon

before:
![image](https://user-images.githubusercontent.com/20344300/72688976-b45f1d00-3b0c-11ea-8920-5328c6d721f7.png)
after:
![image](https://user-images.githubusercontent.com/20344300/72688970-9db8c600-3b0c-11ea-8636-330218d75ca1.png)


Co-authored-by: KillaBilla <robomastermail@googlemail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-01-25 12:45:36 +00:00
bors[bot] 749929431a
Merge #2040
2040: fixed faulty message id r=heinrich5991 a=ChillerDragon

(cherry picked from commit 9023796d27)

Co-authored-by: oy <Tom_Adams@web.de>
2020-01-25 12:40:14 +00:00
sirius 97064a1b09 Keep trying to solve fluency issues 2020-01-25 19:14:45 +08:00
def 8779be6bd8 Looks like my comment was wrong... 2020-01-25 07:37:28 +01:00
12pm ec42291756 Allow filtering by name in status
Easier to find players when the server is full
2020-01-24 14:44:54 +01:00
ChillerDragon 610976eddd Fix max snapshot size 2020-01-22 13:44:05 +01:00
ChillerDragon ee825f42e9 Add snap check for dummy 2020-01-21 22:20:09 +01:00
oy 49168da784 fixed typo
(cherry picked from commit 3deb58d409)
2020-01-21 22:17:20 +01:00
oy ef3bce204c added some checks to snap handling
(cherry picked from commit a09d498bc9)
2020-01-21 22:16:28 +01:00
KillaBilla ba1abac52f remove leading and trailing space from server name and forbit the use of multiple spaces
(cherry picked from commit a9cc1e8de2)
2020-01-19 22:28:19 +01:00
oy 1b4131a7fd fixed faulty message id
(cherry picked from commit 9023796d27)
2020-01-19 21:30:12 +01:00
sirius d6dc811674 seems fluent problem solved, and fix a error when compile by msvs 2020-01-12 16:57:40 +08:00
sirius 483885b6b1 try to solve the problem that video not fluent caused by previous commits 2020-01-08 14:25:06 +08:00
sirius d45b66938d make latter to wait when write_frame collision between audio and video 2020-01-07 11:32:56 +08:00
sirius 3baba93ed2 fix the problem of audio when video fps is low 2020-01-06 11:57:24 +08:00
sirius 779afcb771 crf and preset can be set by variables 2020-01-05 11:18:51 +08:00
sirius 0be4629cc1 forget to deal with pError 2020-01-04 17:44:12 +08:00
sirius 3967ddba00 replace same operations by call Demoplay_Play() when rendering video by render button 2020-01-04 17:08:00 +08:00