ddnet/data
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
..
audio Rename rifle to laser 2019-11-22 15:37:18 +01:00
countryflags Update GL and LY flags 2018-10-22 18:31:13 +02:00
editor Add Entites off sign to front layer (fixes #2261) 2020-06-14 16:01:32 +02:00
fonts add icon font 2018-03-13 21:43:27 +01:00
languages Update brazilian_portuguese.txt 2019-12-18 02:51:47 -03:00
mapres Optimize PNGs 2016-04-27 01:27:57 +02:00
maps Add back Vanilla maps for compatibility 2018-08-07 08:39:08 +02:00
shader don't render all border all the time 2018-08-02 18:26:12 +02:00
skins added skin prefix (#1218) 2018-07-24 17:26:39 +02:00
arrow.png Optimize PNGs 2016-04-27 01:27:57 +02:00
blob.png Merge remote-tracking branch 'timakro/new_hookthrough' 2016-04-27 18:59:51 +02:00
browse_icons.png Replace browse_icons (by MiM) (fixes #1880) 2019-08-04 11:17:18 +02:00
ca-ddnet.pem Turns out we also need Intermediate Certificates... 2017-07-16 22:02:50 +02:00
console.png Optimize PNGs 2016-04-27 01:27:57 +02:00
console_bar.png Optimize PNGs 2016-04-27 01:27:57 +02:00
debug_font.png Optimize PNGs 2016-04-27 01:27:57 +02:00
demo_buttons.png Optimize PNGs 2016-04-27 01:27:57 +02:00
demo_buttons2.png Add toggle keyboard shortcuts button to demo player 2019-10-05 18:06:58 +02:00
emoticons.png Optimize PNGs 2016-04-27 01:27:57 +02:00
file_icons.png Optimize PNGs 2016-04-27 01:27:57 +02:00
game.png Optimize PNGs 2016-04-27 01:27:57 +02:00
gui_buttons.png Optimize PNGs 2016-04-27 01:27:57 +02:00
gui_cursor.png Optimize PNGs 2016-04-27 01:27:57 +02:00
gui_icons.png Optimize PNGs 2016-04-27 01:27:57 +02:00
gui_logo.png Optimize PNGs 2016-04-27 01:27:57 +02:00
particles.png Optimize PNGs 2016-04-27 01:27:57 +02:00
wordlist.txt Generate passphrase for save-code 2020-06-15 11:14:15 +02:00