Commit graph

6327 commits

Author SHA1 Message Date
def bd3656f6ad Implement ctrl-u in lineinput to clear 2020-08-17 10:14:24 +02:00
def 7032249b26 Fix leak when loading map in editor (fixes #2573) 2020-08-17 00:09:07 +02:00
def 99d1c4939a Version 14.3.3 2020-08-16 22:46:22 +02:00
plsplsplslol 8abf00b52c move checkpoint to debug 2020-08-15 17:00:02 -07:00
Zwelf 52af88826c Allow switching weak/strong with saving and loading 2020-08-13 16:19:07 +02:00
def 2f4eac2cf3 Optimization: Don't calculate with too small fraction
since it won't add up to anything anyway.

Hopefully doesn't break any physics.
2020-08-13 13:15:59 +02:00
bors[bot] 875bcea1e9
Merge #2571
2571: Add +resetdummy r=def- a=ardadem

Closes #2053

Co-authored-by: Arda Demir <ddmirarda@gmail.com>
2020-08-13 08:48:51 +00:00
Arda Demir 35995322d7 Add +resetdummy 2020-08-13 11:19:13 +03:00
Zwelf f3619c27ee Remove incorrect check when inserting team ranks
Can be reliable reproduced by finishing in this sequence:

1. A, B
2. A, C
3. B, C <- triggers error

Fixes #2568
2020-08-13 09:58:56 +02:00
Zwelf a866c3e9b7 Fix team rank not updating after SQLite update 2020-08-12 10:57:43 +02:00
def 048bb992bb Version 14.3.2 2020-08-11 14:07:16 +02:00
def a8aeaa4cb6 Editor: Fix Left/right arrow keys when editing text
as reported by Silex
2020-08-11 12:21:33 +02:00
def e0c06464d2 Version 14.3.1 2020-08-10 23:43:10 +02:00
Arda Demir fabc194081 Flag afk when player timed-out 2020-08-10 21:59:31 +03:00
Dennis Felsing 77d61973fa
Merge pull request #2545 from def-/pr-version-14.3
Version 14.3
2020-08-10 17:50:29 +02:00
Dennis Felsing 9d4a77130c
Merge pull request #2541 from def-/pr-editor
Arrow key support in editor
2020-08-10 17:50:14 +02:00
def 4ceb4ddb9f Version 14.3 2020-08-10 17:50:05 +02:00
def 285701695b Prevent crash by keeping m_SelectedImage/Sound in correct range 2020-08-10 17:41:58 +02:00
def 29332ea72e Editor: Add ctrl+n for new map, ctrl+a to append map, add hints 2020-08-10 09:28:36 +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
bors[bot] 026ac99895
Merge #2543
2543: Remove unlicensed skins (fixes #2518) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-08-09 23:23:40 +00:00
bors[bot] 3fde3ac496
Merge #2538
2538: Add Client message color option in HUD setting r=Learath2 a=def-

As requested by reo

Co-authored-by: def <dennis@felsin9.de>
2020-08-09 16:58:41 +00:00
Zwelf 5893913922 Clean up includes in sql backend 2020-08-09 17:54:25 +02:00
Zwelf 5b53a05a40 Rename LoadString to FromString to fix windows build 2020-08-09 17:14:11 +02:00
def 20e8bfd12a Try to fix Windows build 2020-08-09 17:14:11 +02: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 1ad43a76dd Editor: Support up/down for images/sounds 2020-08-08 12:22:37 +02:00
def 4c9d03c063 Editor: Left/Right switch between layers/images/sounds 2020-08-08 12:09:15 +02:00
def c66201dd22 Editor: Get rid of some debugging output 2020-08-08 12:09:03 +02:00
def 8174dfa779 Editor: Support up/down keys to switch layers
Also with shift to add layers

As suggested by Lady Saavik
2020-08-08 12:06:17 +02:00
def 02f6e7081a Right click: Don't remove selection of layers 2020-08-08 10:33:18 +02:00
def 20eb5a5d86 Add Client message color option in HUD setting
As requested by reo
2020-08-05 12:39:13 +02:00
Learath 039139b836 Fix more sixup vote issues 2020-08-04 20:14:37 +03:00
Zwelf d71bf5cef1 Use DB write server for /load 2020-08-03 12:58:52 +02:00
Zwelf 3e1324dd0a Add uuid parsing 2020-08-03 12:58:52 +02:00
Zwelf c6b1b08355 Database specific collate utf8 nocase
making and work
2020-08-03 12:58:52 +02:00
Zwelf d16bb5cc08 Make timestamps compatible with SQLite
works for `/mapinfo`, `/load`, `/save`, `/times`
2020-08-03 12:58:52 +02:00
Zwelf 41b5ee9dd8 Make /teamrank compatible with SQLite 2020-08-03 12:58:52 +02:00
Zwelf aee73b99dc Rewrite insert teamrank making code reuse easier 2020-08-03 12:58:52 +02:00
Zwelf c8d710926f Fix missing last line 2020-08-03 12:58:52 +02:00
Zwelf 044edbe42b Make storing teamrank compatible with SQLite 2020-08-03 12:58:52 +02:00
Zwelf a6df9be98e Make getting birthday compatible with SQLite 2020-08-03 12:58:52 +02:00
Zwelf eb4d77f071 Make inserting ranks compatible with SQLite 2020-08-03 12:58:52 +02:00
Zwelf 89ee5944b4 Add missing include 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
def e2fde4d730 Fix utf8 handling in str_truncate (fixes #2533)
and rename to str_utf8_truncate since it's only used for utf8 strings
2020-08-02 18:32:42 +02:00
Fireball 7e610f9944 Fix sixup players not making sounds when hooking others
This also fixes some less noticeable edgecases with ground jump sound: for example, when spectating a tee who is in a solo part.
2020-07-18 19:13:56 +01:00
sirius 2394d49d34 update calling way of TextWidth() 2020-07-16 21:07:41 +08:00
sirius a6181ce8d3 Merge branch 'master' of https://github.com/ddnet/ddnet 2020-07-16 21:07:04 +08:00
Fireball ab9b96ddb2 Backported fix for Text() incorrect parameter type (int -> float)
The original fix was done by @oy for 0.7.4.
2020-07-15 20:49:14 +01:00
Fireball b1c17c3248 Backported fix for TextWidth() parameter mix-up
Fixes #2511 (Stack-buffer-overflows in some UIs).
The original fix was done by @oy for 0.7.4.
2020-07-15 20:48:29 +01:00
trml b354e034fc Fix prediction when chat is enabled 2020-07-15 03:15:35 +02:00
trml d57c8ef463 Fix desync of predicted reload timer 2020-07-15 02:47:51 +02:00
bors[bot] 69593a3191
Merge #2502
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>
2020-07-14 06:31:43 +00:00
sirius ef85308a47 remove aBuf 2020-07-14 10:45:03 +08:00
bors[bot] 3ff0a7fec6
Merge #2498
2498: Limit zooming out further (fixes #2497) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-07-13 21:34:05 +00:00
def 4d34dd365b Limit zooming out further (fixes #2497) 2020-07-13 20:23:49 +02:00
sirius 17bf1a9b38 change identifier style 2020-07-14 00:12:03 +08:00
sirius 9482ffa10a change identifier style 2020-07-13 23:10:00 +08:00
bors[bot] 37a906d972
Merge #2501
2501: Show "Free View" for Sixup r=fokkonaut a=Learath2

@fokkonaut is this enough?

bors delegate=fokkonaut

Co-authored-by: Learath <learath2@gmail.com>
2020-07-13 09:50:48 +00:00
Learath 85a2268b2a Show "Free View" for Sixup 2020-07-13 11:35:03 +03:00
sirius d7646666f0 use array instead of string 2020-07-13 12:41:07 +08:00
bors[bot] 38ea723d94
Merge #2433 #2505 #2506
2433: Fix votes for sixup r=heinrich5991 a=Learath2

I think this looks sane but I haven't tested it at all for idk how to even test this locally/alone

2505: Fix legacy 64 player serverinfo, don't send duplicate packets (fixes #2495) r=heinrich5991 a=def-

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.

2506: Prevent whisper spam from 0.7 (fixes #2504) r=heinrich5991 a=def-



Co-authored-by: Learath <learath2@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2020-07-12 22:58:23 +00:00
def 74197fc027 Prevent whisper spam from 0.7 (fixes #2504) 2020-07-13 00:28:47 +02:00
Fireball 918f321dfb Improved dummy switching
- 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.
2020-07-12 19:14:18 +01:00
Learath dd010364ed Fix double messages 2020-07-12 10:34:36 +03:00
def 8858fc24ec Fix compiler warning in stoppers without changing physics
Probably related to #2487, was previously fixed and caused stoppers not
to work.

src/game/collision.cpp:902:247: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
src/game/collision.cpp:891:252: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
src/game/collision.cpp:885:251: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
2020-07-11 11:38:29 +02:00
def a0e96d58ea Version 14.2 2020-07-10 08:32:12 +02:00
def 3585d83196 Don't request IUpdater interface when built without updater
Fixes warning:

[kernel]: failed to find interface with the name 'updater'
2020-07-10 00:01:02 +02:00
bors[bot] d7a0a914c3
Merge #2460
2460: Don't reset chat on map change (fixes #2451) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-07-09 18:38:40 +00:00
bors[bot] c4d5c8dfa2
Merge #2478 #2480
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>
2020-07-09 18:31:32 +00:00
def f4344dc420 Use (u)int64 from system.h instead of (u)int64_t from cstdint
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);
      |                                                                                          ^~~~~~~
2020-07-09 13:55:28 +02:00
def 6b7e1f54f4 Send zoom status for dummy too 2020-07-09 13:51:37 +02:00
def b2b664bf53 Don't reset chat on map change (fixes #2451) 2020-07-09 13:47:48 +02:00
bors[bot] 5cc6a08c2b
Merge #2471
2471: Don't send zoom level while zooming (fixes #2470) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-07-09 11:24:19 +00:00
bors[bot] ac35b49e90
Merge #2479
2479: Set smaller default area for what distance to show r=heinrich5991 a=def-

as suggested by fokkonaut

Co-authored-by: def <dennis@felsin9.de>
2020-07-09 11:10:38 +00:00
bors[bot] 56ef688489
Merge #2467
2467: Add cl_smooth_zoom_time r=def- a=def-

as requested on Discord by nils & fokkonaut

Co-authored-by: def <dennis@felsin9.de>
2020-07-09 10:35:07 +00:00
def 5e7a45a49b Set smaller default area for what distance to show
as suggested by fokkonaut
2020-07-08 23:16:30 +02:00
bors[bot] 8a3743fa90
Merge #2474 #2476
2474: Remove IP skins r=heinrich5991 a=def-



2476: Use x instead of y in show distance (fixes #2475) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-07-08 20:39:01 +00:00
bors[bot] 70ff2f919d
Merge #2468
2468: Tell why DNSBL isn't allowing to vote (fixes #2466) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2020-07-08 20:30:51 +00:00
Dennis Felsing 05ed51cf86
Update src/game/server/gamecontext.cpp
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-07-08 22:02:36 +02:00
Dennis Felsing 71bd706f2a
Update src/game/server/gamecontext.cpp
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-07-08 22:02:31 +02:00
def 2a35121c84 Use x instead of y in show distance (fixes #2475) 2020-07-08 15:57:00 +02:00
def 2e8faac549 Don't send zoom level while zooming (fixes #2470) 2020-07-08 10:42:28 +02:00
sirius edab0d097d add variable to adjust size of health and armor nameplate 2020-07-08 15:41:44 +08:00
sirius 4a44b90b11 adjust distance between health and armor 2020-07-08 14:32:24 +08:00
sirius 00c4adf05b add function to show health and armor in nameplates (only when client can get the health and armor data) 2020-07-08 13:34:24 +08:00
def 66c7bf8851 Tell why DNSBL isn't allowing to vote (fixes #2466) 2020-07-07 23:12:55 +02:00
def defe2439bd Add cl_smooth_zoom_time
as requested on Discord by nils & fokkonaut
2020-07-07 22:59:20 +02:00
def f9d2c14ff6 Make zoom reset respect cl_default_zoom (fixes #2453) 2020-07-07 18:02:21 +02:00
Learath fb09f8a6c6 "Translate" the vote message 2020-07-07 13:16:53 +03:00
Learath 95d363b42c Fix votes for sixup 2020-07-07 13:14:07 +03:00
bors[bot] 9008c96e80
Merge #2429
2429: Use a cubic polynomial for smoothing zoom r=def- a=heinrich5991

Supersedes #2420.

Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-07-05 21:46:25 +00:00
bors[bot] ac3dde1d98
Merge #2446
2446: Fix storing finish on solo server with practice mode enabled r=heinrich5991 a=Zwelf

Fixes #2445 
vulnerable versions: 
* 506602d472c48821b6e7bb846b86431a113834a1..59a7e1f1873ad58b838cd3470d51b6ba84c02926~
* b99bbccd248437c928b25e32d40deaf98d8ef3ad..4186622d8750f4288be86b9064886a86c665c45d~

Problem was that `OnFinish` is only suited for team0 finishes, where `/practice` can't be enabled. Solo server finishes have to be handled like team finishes in CheckTeamFinished, which checks if `/practice` was enabled.

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-07-02 21:08:20 +00:00
Zwelf d0975f9c4b Fix storing finish on solo server with practice mode enabled 2020-07-02 22:49:30 +02:00
Zwelf 0c0fab5e66 Moved include from teamscore.h to teamscore.cpp 2020-07-02 22:11:43 +02:00
bors[bot] 7266bcad78
Merge #2444
2444: Fix erroneous "unable to find all characters" message r=heinrich5991 a=Zwelf

Fixes #2443 

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-07-02 15:07:55 +00:00
Zwelf 17bb4522fc Fix erroneous "unable to find all characters" message 2020-07-02 16:34:36 +02:00
Zwelf ab9cdc294d Reset all input after rescuing 2020-07-02 16:24:23 +02:00
Zwelf 538de72c94 Don't load movement and pause state when rescuing 2020-07-02 14:06:18 +02:00