Commit graph

289 commits

Author SHA1 Message Date
def 0a9eb72d52 Fix bundling SQLite3 on Mac
Verified locally
2020-08-10 18:35:04 +02:00
bors[bot] b06bea7c04
Merge #2465
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>
2020-08-09 23:30:08 +00:00
def 7be7160d9b Remove unlicensed skins (fixes #2518)
and mention skin licenses (fixes #2544)

Still missing: Which skin is by btd?
2020-08-09 15:07:08 +02:00
def 802c97a79d Remove IP skin
Apparently that's a pokemon, definitely can't use that one
2020-08-08 13:10:59 +02:00
Zwelf 0fa13f6bf9 Fix include directories for SQLite by heinrich5991 2020-08-03 16:07:36 +02:00
Zwelf a9c0912408 Sort cmake output alphabetical 2020-08-03 12:58:52 +02:00
Zwelf 452017a58b Move format string to CREATE TABLE into own file 2020-08-03 12:58:52 +02:00
Zwelf 2c5f892205 Apply suggestions from code review 2020-08-03 12:58:52 +02:00
Zwelf b898f8c7c2 Remove unused MySQL interface 2020-08-03 12:58:52 +02:00
Zwelf 7c31a15c93 Add SQLite interface 2020-08-03 12:58:52 +02:00
Zwelf 2eb3d23ef4 Rewrite score using the new interface
delete file_score for now as it will be replaced by a sqlite backend
2020-08-03 12:58:52 +02:00
Zwelf 295ce95d64 Roughly define database pool interface 2020-08-03 12:58:52 +02:00
Zwelf d59cdf47b5 Define new database interface 2020-08-03 12:58:52 +02:00
def d9c89d4e44 Remove IP skins 2020-07-08 22:04:54 +02:00
heinrich5991 9ed54440cb Add some tests for the bezier stuff 2020-07-02 11:07:30 +02:00
heinrich5991 cdd715fd53 Add smoothing of camera zoom using a cubic polynomial 2020-07-01 00:19:17 +02:00
bors[bot] bf09d18cc7
Merge #2331
2331: Enable rpath on Linux for shipping SDL2 shared lib r=heinrich5991 a=def-

I guess we should have a way to say when we want to build against the
static sdl2? Or we just ship SDL2 for the ddnet.tw releases as well. I'd
be fine with the latter, but it adds a few MB probably.

Co-authored-by: def <dennis@felsin9.de>
2020-06-25 11:52:49 +00:00
Zwelf a8abc3937b Make game less dependend on score backend 2020-06-25 12:36:01 +02:00
def 64d63bc123 Enable rpath on Linux for shipping SDL2 shared lib 2020-06-25 12:13:29 +02:00
def f51a443998 Merge remote-tracking branch 'edg-l/pr_show_spec'
Update x_spec with the more minimal version by HiRavie
Fix CMakeLists.txt
2020-06-24 09:55:59 +02:00
heinrich5991 10ab14d5eb List data files in CMakeLists.txt
This fixes missing files for people recompiling when we add new data
files.
2020-06-23 10:29:32 +02:00
heinrich5991 0db5c51ed9 Add a simple CSV writer for Python's "excel" csv dialect 2020-06-23 09:11:59 +02:00
heinrich5991 6f3a7a60ea Fix git_revision.cpp updating for out-of-tree builds 2020-06-20 11:08:59 +02:00
Learath ef89e9a300 Get CMake version requirement down again 2020-06-19 20:28:55 +03:00
Learath 03070d0567 Fix many issues 2020-06-19 20:28:52 +03:00
def ef4cad9f4d Fix Python 2020-06-19 20:27:15 +03:00
Learath 807c92f1a4 Generate the 0.7 protocol 2020-06-19 20:27:15 +03:00
heinrich5991 7f14b4b2bb Add glibc's PRNG
Based on a description on https://www.mscs.dal.ca/~selinger/random/
(retrieved 2020-05-25).
2020-05-25 15:19:25 +02: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
Learath 5e02bb5a23 Extend antibot interface
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-05-13 23:39:40 +03:00
def c9dfcb2b11 Fix Mac OS X notifications linking 2020-04-30 21:30:21 +02:00
Learath 09fad44b87 Strip rpath before adding the correct one 2020-04-30 15:04:51 +02:00
Learath 17d1bccf2b Some osx cleanup 2020-04-30 15:04:51 +02: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 b647c1e978
Add UPnP support 2020-04-14 12:11:50 +02:00
Ryozuki e2a85345e4
Rename antibot -> ddnet-antibot and install it on cmake 2020-04-12 17:13:47 +02:00
Ryozuki 5f565a5eb5
check for WavpackCloseFile 2020-04-11 13:17:21 +02:00
Dennis Felsing 2965b8578a
Merge pull request #2124 from def-/pr-macosx-10.7
Rebuild Mac OSX libs with -mmacosx-version-min=10.7 (previously 10.9)
2020-04-10 20:28:58 +02:00
Ryozuki 0da0dddf15 drop glu dependency 2020-04-08 18:19:12 +02:00
def a127e6d5aa Rebuild Mac OSX libs with -mmacosx-version-min=10.7 (previously 10.9) 2020-04-08 12:07:33 +02:00
def 18aec44a99 New try for hidapi SDL2 rpath 2020-04-08 09:17:15 +02:00
def ae330bbe25 Try to fix SDL2 hidapi rpath on MacOSX
Following SDL 2.0.12 update
2020-04-08 07:37:00 +02:00
bors[bot] 0c51c0daf5
Merge #2117
2117: Don't emit the CMake rpath warning for CMake >= 3.14 r=def- a=heinrich5991

Fixes #2114.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-04-07 10:50:51 +00:00
heinrich5991 cac164cc71 Don't emit the CMake rpath warning for CMake >= 3.14
Fixes #2114.
2020-04-07 12:01:18 +02:00
def fd86c907a6 Fix ffmpeg package name (fixes #2115) 2020-04-07 09:00:19 +02:00
def 564e7577f7 Try to fix freetype mac warning 2020-04-06 12:48:58 +02:00
Learath 61e5667624 Streamline platform client 2020-03-28 02:20:16 +03:00
heinrich5991 bda3adabcc Use relative rpath, force relative rpath for older CMake versions
This allows you to copy around the built binaries together with the
binaries.
2020-03-14 01:48:45 +01:00
heinrich5991 a3163c5b9c Add support for dynamically loading an antibot module
Support for this feature is turned off by default. This feature allows
to integrate with noby's anticheat feature.
2020-03-11 01:58:50 +01:00