Commit graph

6190 commits

Author SHA1 Message Date
bors[bot] 677d92aa32
Merge #2353
2353: Fix /spec rendering r=def- a=edg-l

Fixes https://github.com/ddnet/ddnet/issues/2344

Co-authored-by: Edgar <git@edgarluque.com>
2020-06-24 19:29:29 +00:00
bors[bot] bd2cb5a8bd
Merge #2352
2352: Fix SendChatTarget demo recording r=def- a=Learath2



Co-authored-by: Learath <learath2@gmail.com>
2020-06-24 19:23:23 +00:00
def 3530d0ae32 Set rescue tee immediately after loading (fixes #2248) 2020-06-24 21:19:46 +02:00
Edgar b33180ae77
fix /spec rendering 2020-06-24 19:01:01 +02:00
Learath 581904d849 Fix SendChatTarget demo recording 2020-06-24 19:22:41 +03:00
bors[bot] cbde23aba9
Merge #2305
2305: Version 14.0 r=def- a=def-

Waiting for https://github.com/ddnet/ddnet/pull/2303 https://github.com/ddnet/ddnet/pull/2301 https://github.com/ddnet/ddnet/pull/2296 https://github.com/ddnet/ddnet/pull/2295 https://github.com/ddnet/ddnet/pull/2294 https://github.com/ddnet/ddnet/pull/2280 https://github.com/ddnet/ddnet/pull/2279 https://github.com/ddnet/ddnet/pull/2242 and probably some sixup fixes by Learath2 :)

Co-authored-by: def <dennis@felsin9.de>
2020-06-24 16:20:53 +00:00
Learath e122462ae8 Ugly fix for SendChatTarget(-1...). Closes #2337 2020-06-24 18:54:27 +03:00
Learath b6fb304508 Name change hack for 0.7. Close #2330 2020-06-24 18:14:15 +03:00
bors[bot] 09f60fc919
Merge #2242
2242: Use CSaveTee for rescue (fixes #2241) r=heinrich5991 a=def-

Untested. Edit: Tested, seems to work.

Co-authored-by: def <dennis@felsin9.de>
2020-06-24 14:51:13 +00: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
Learath 3a9fa693f2 Set LastChangeInfo on a Sixup skin change 2020-06-24 16:25:35 +03:00
def 0bb4e4c0cd Version 14.0 2020-06-24 15:17:22 +02:00
def 243be18fb4 Keeping multiple states consistent is hard (fixes #2315)
let's go recount every time
2020-06-24 14:50:32 +02:00
def 5b3b42b771 Make it more clear that this is a sixup translation server 2020-06-24 14:49:23 +02:00
def ff4c2c51ec Don't fail on empty teamtop5 2020-06-24 12:13:18 +02:00
Edgar 24a308c50c fix saying /spec show you as chatting 2020-06-24 11:32:27 +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
bors[bot] 0f0de9b333
Merge #2338
2338: Ensure that team state is always sent (fix #2315) r=def- a=trml

Noticed that team state wasn't sent to the client in some cases (when SetForceCharacterNewTeam is called directly), which I think this could happen if a team is unlocked between killing and respawning a player. Also added a CheckTeamFinished for that case.

Co-authored-by: trml <trml@users.noreply.github.com>
2020-06-24 05:46:25 +00:00
bors[bot] de328c1360
Merge #2301
2301: map_convert_07: Check image width for divisibility by 16 r=heinrich5991 a=def-

As noticed on Sunny Land.

> [5:31 PM] redix: in theory it should be enough if width and height are divisible by 16

Now running this over our maps and fixing them manually.

Co-authored-by: def <dennis@felsin9.de>
2020-06-23 23:30:34 +00:00
trml ca36f4787c Ensure that team state is always sent 2020-06-23 23:57:33 +02:00
Learath 5293f78f22 Translate the emoticon message 2020-06-23 12:25:04 +03:00
bors[bot] 366a0ec80b
Merge #2326
2326: Disable -Wstringop-overflow warning in IntsToStr r=heinrich5991 a=def-

Since it won't write into invalid memory when Num > 0

Co-authored-by: def <dennis@felsin9.de>
2020-06-23 08:55:37 +00: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] e040c281e0
Merge #2325
2325: Fix array as initializer g++ 4.9 error (fixes #2320) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-06-23 08:39:29 +00:00
def 557f23b347 Disable -Wstringop-overflow warning in IntsToStr
Since it won't write into invalid memory when Num > 0
2020-06-23 10:35:41 +02: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 48e8ba69ca Use the CSV write to write save codes 2020-06-23 09:11:59 +02:00
def 85f772ba56 Fix array as initializer g++ 4.9 error (fixes #2320) 2020-06-23 08:02:09 +02:00
def 83c820db09 Fix some naming conventions in videorecorder 2020-06-23 08:00:03 +02:00
Learath ce5aca4759 Check for a null CPlayer::m_pCharacter
Players need not have characters at all times
2020-06-23 01:36:51 +03:00
bors[bot] 11e2f04c21
Merge #2280
2280: Add a slightly longer introduction text r=heinrich5991 a=def-

Since we don't have a tutorial
![Screenshot](https://user-images.githubusercontent.com/2335377/85120864-235bb180-b224-11ea-8bb6-700f7228ee0d.png)

Co-authored-by: def <dennis@felsin9.de>
2020-06-22 20:45:06 +00:00
def 57280fba99 Store saves client-side in ddnet-saves.txt
Only appends saves, just in case you forgot where you saved.

Unfortunately only stores your own name, not your entire team.
2020-06-22 21:12:35 +02:00
bors[bot] a407513630
Merge #2306
2306: Make ctrl-s/ctrl-l etc work everywhere in editor (fixes #2302) r=heinrich5991 a=def-

instead of just in the layers view

Co-authored-by: def <dennis@felsin9.de>
2020-06-22 18:56:01 +00:00
Edgar 933ea7cca3
fix bug, use ddnet character 2020-06-22 19:05:57 +02:00
Edgar 3f476171f1
change to white and use colors 2020-06-22 18:43:49 +02:00
bors[bot] 6384ebf13f
Merge #2321
2321: Use the 0.7 race features better r=def- a=Learath2

Mostly tested, couldn't test the diffs though as I don't have score set up. It looks good to me though.

Co-authored-by: Learath <learath2@gmail.com>
2020-06-22 16:04:18 +00:00
Learath 62d014d999 Forgot we faked ids for vanilla 2020-06-22 19:02:17 +03:00
Learath 287e3e2a45 Use 0.7 finish messages 2020-06-22 18:08:08 +03:00
def 07830c868f Fix whitespace in teeinfo.cpp 2020-06-22 15:06:01 +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
def 79cb7d14eb Don't log preprocess nullptr return 2020-06-22 10:06:55 +02:00
def 9d9d5e26e6 Fix double hook sound in 0.7 2020-06-22 09:27:41 +02:00
bors[bot] 39eae1935b
Merge #2312
2312: Fix crash when player voting random_map leaves and vote passes r=def- a=Zwelf

Closes #2310 

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-06-22 05:47:46 +00:00
Zwelf b96d8673f3 Fix crash when player voting random_map leaves and vote passes
Closes #2310
2020-06-22 00:47:49 +02:00
def b1ff7d3ef2 Handle invalid packets more gracefully 2020-06-22 00:13:16 +02:00
def 9fccd5ecf6 Fix team rank for long map names 2020-06-21 23:47:45 +02:00
Edgar befc4fc1b2
make skin also use alpha 2020-06-21 18:24:51 +02:00
Edgar 78bcc1d8fc
apply alpha to spec nameplates 2020-06-21 18:05:43 +02:00
Edgar f3466e05ba
Show /spec tees with a dashed skin 2020-06-21 17:48:33 +02:00
Learath ea3772ce2a Don't send redundant commands. Remove /team on clientside. 2020-06-21 17:28:02 +03:00
Learath 35acd21933 Use the racetimer in 0.7
Clean up /timer while at it
2020-06-21 17:15:08 +03:00
bors[bot] 80f19b789a
Merge #2294
2294: Make the learn button fit (fixes #2293) r=edg-l a=def-

![screenshot_2020-06-20_14-57-03](https://user-images.githubusercontent.com/2335377/85202386-55454480-b306-11ea-99f5-e37ba6e616b5.png)


Co-authored-by: def <dennis@felsin9.de>
2020-06-21 09:31:51 +00:00
def 6cfc6adc83 Make ctrl-s/ctrl-l etc work everywhere in editor (fixes #2302)
instead of just in the layers view
2020-06-21 01:44:01 +02:00
def c7908524cd Add a slightly longer introduction text
Since we don't have a tutorial
2020-06-21 01:15:01 +02:00
def c99d791f4b Add warning in editor for image widths 2020-06-21 01:14:36 +02:00
bors[bot] 4dd72df777
Merge #2297
2297: Ingame time is in milliseconds on 0.7 r=def- a=Learath2



Co-authored-by: Learath <learath2@gmail.com>
2020-06-20 17:25:02 +00:00
Learath 28905c4659 Disable timeout for 0.7 clients 2020-06-20 19:52:23 +03:00
Learath 865afa613b Ingame time is in milliseconds 2020-06-20 17:31:06 +03:00
def 1610079020 Make the learn button fit (fixes #2293) 2020-06-20 14:57:52 +02:00
bors[bot] 17e77d73bb
Merge #2291
2291: Make PlayerResult messages an union variant r=def- a=Zwelf

and some small style and readability fixes in sql_score.

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-06-20 12:44:59 +00:00
bors[bot] a3ab572fdc
Merge #2290
2290: Restore old message behavior when using /load and /save r=def- a=Zwelf

Only notify the player initiating /load about the error and don't send
'Loading initiated by ...' and 'Saving initiated by ...' messages resulting
in two messages per /load and /save.

Not sure if the old behavior is better or if we want to keep the new with sending two messages per /save and /load.

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-06-20 12:34:28 +00:00
bors[bot] 07f6e71376
Merge #2289
2289: Fix votes called from 0.7 r=def- a=Learath2

Never assume how structures are laid out

Co-authored-by: Learath <learath2@gmail.com>
2020-06-20 12:27:22 +00:00
Zwelf 1e4ccd7cc2 Small style and readability fixes in sql_score 2020-06-20 14:08:38 +02:00
Zwelf 67643e82b0 Make PlayerResult messages an union variant
as it is only used for DIRECT and ALL variants and for no other variants
2020-06-20 14:04:08 +02:00
bors[bot] 4edac3143a
Merge #2281
2281: Add Learn button which opens the ddnet wiki in the browser. r=heinrich5991 a=edg-l

![image](https://user-images.githubusercontent.com/15859336/85147350-05f00d00-b24f-11ea-8b6c-f79dbf605747.png)

## **I didn't test it on windows or mac.**

Co-authored-by: Edgar <git@edgarluque.com>
2020-06-20 12:00:45 +00:00
Edgar 07f0239e01
Add Learn button which opens the ddnet wiki in the browser. 2020-06-20 13:56:02 +02:00
Learath 8d422dfd70 Fix snapping for ninja 2020-06-20 14:24:38 +03:00
Learath b032eddcb4 Fix votes called from 0.7 2020-06-20 14:22:46 +03:00
Zwelf 673f59d99f Restore old message behavior when using /load and /save
Only notify the player initiating /load about the error and don't send
'Loading initiated by ...' and 'Saving initiated by ...' messages resulting
in two messages per /load and /save.
2020-06-20 13:03:25 +02: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
heinrich5991 e294da41ba teehistorian: Track whether clients join via the 0.7 protocol 2020-06-19 22:06:39 +02: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 623ba68c19 Fix an oversight on skin conversion and some UB 2020-06-19 20:28:55 +03:00
Learath ddaea93e60 Implement the new Chat Commands protocol 2020-06-19 20:28:55 +03:00
Learath 1d4ea6c41b Drop clients properly 2020-06-19 20:28:55 +03:00
Learath d794520748 Remove forgotten debug messages 2020-06-19 20:28:55 +03:00
Learath effa964f08 Translate playerflags 2020-06-19 20:28:55 +03:00
Learath df42ce8b16 Send gameinfo correctly 2020-06-19 20:28:55 +03:00
Learath 32fb6718dd Allow joining TEAM_SPECTATOR 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 1514a6df85 Fix NetObj translation, fix sounds 2020-06-19 20:28:55 +03:00
Learath 46a7b6de2c Fix some oob access 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 939b45a0aa Actually remove duplicate message 2020-06-19 20:28:55 +03:00
Learath 465fd570e0 Implement whispers 2020-06-19 20:28:55 +03:00
Learath 25664da121 Remove duplicate message 2020-06-19 20:28:55 +03:00
Learath 974b373ec2 Translate Damage Indicators 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 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
bors[bot] 7d428676e2
Merge #2263
2263: Fix /spec + super bug r=Learath2 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-06-18 22:17:43 +00:00
def e38cd6b6f2 Fix /spec + super crash (fixes #2262)
Thanks to Learath2 for finding a better solution.
2020-06-18 23:54:05 +02:00
def 79ef6c0e84 Use CSaveTee for rescue (fixes #2241) 2020-06-18 23:41:37 +02:00
def 2c7f4c71aa Minor code style fixes in sql_score.cpp 2020-06-18 23:03:53 +02:00
bors[bot] 13237ee12e
Merge #2245 #2266
2245: Stop playing map sound when demo player is paused r=heinrich5991 a=def-

Noticed on Shooting Range map

2266: Reset hook & collision in prediction after kill r=heinrich5991 a=def-

Thanks to Pipou for reporting

Co-authored-by: def <dennis@felsin9.de>
2020-06-18 19:29:41 +00:00
def 7aed6476dc Allow larger map names 2020-06-18 18:29:27 +02:00
def 6fcb8abbd0 Initialize m_SqlRandomMapResult (fixes #2272) 2020-06-18 08:18:33 +02:00
def b3d22204c3 Update credits 2020-06-17 23:23:27 +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
Learath eed3e783e0 Mark unused tunes as such 2020-06-17 13:39:54 +03:00
bors[bot] c4d71c7ef4
Merge #2264
2264: Add Entites off sign to front layer (fixes #2261) r=Learath2 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-06-16 19:31:25 +00:00
Zwelf 9f15acdbee Thread safe random_unfinished_map and modified sql statement 2020-06-15 11:14:15 +02:00
Zwelf afe96ed69c Thread safe random_map 2020-06-15 11:14:15 +02:00
Zwelf 7f4dc2bb4e Thread safe /map 2020-06-15 11:14:15 +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 13c80fdc56 Thread safe saving of score 2020-06-15 11:14:15 +02:00
Zwelf 5dcb6f3b0d Thread save Init 2020-06-15 11:14:15 +02:00
Zwelf c278d8dbc3 Read SaveID from database on /load 2020-06-15 11:14:15 +02:00
Zwelf dbf6ac88f6 Thread save loading of player time and birthday 2020-06-15 11:14:15 +02:00
Zwelf e9242f45f1 Thread safe /load 2020-06-15 11:14:15 +02:00
Zwelf 031ac52320 Thread safe /save 2020-06-15 11:14:15 +02:00
Zwelf f5ebbf59b6 Thread safe /load without paramters 2020-06-15 11:14:15 +02:00
Zwelf 7514e93a8a Optimize /top5points SQL query 2020-06-15 11:14:15 +02:00
Zwelf fa8972deb6 Thread safe /top5points 2020-06-15 11:14:15 +02:00
Zwelf 62f3f40c00 Optimize /points database query 2020-06-15 11:14:15 +02:00
Zwelf 0f3f845a7f Thread safe /points 2020-06-15 11:14:15 +02:00
Zwelf e37cf5f3cb Thread safe /times 2020-06-15 11:14:15 +02:00
Zwelf 8fc81e7eca Reworked PlayerResult to signal finished with use_count == 1
Therefore if the sql thread crashes, the result is deleted automatically
2020-06-15 11:14:15 +02:00
Zwelf 1d7289c8f0 Thread safe /top5team and optimize database query 2020-06-15 11:14:15 +02:00
Zwelf 83fbee5f81 Optimize /teamrank database query 2020-06-15 11:14:15 +02:00
Zwelf a92509a5df Simplify /top5 SQL statement 2020-06-15 11:14:15 +02:00
Zwelf 9cf28354d7 Thread safe /top5 command 2020-06-15 11:14:15 +02:00
Zwelf fd44b1dc5b Reduce boilerplate code needed to start player info requesting thread 2020-06-15 11:14:15 +02:00
Zwelf f18daa949c Thread safe /teamrank 2020-06-15 11:14:15 +02:00
Zwelf e311c39151 Remove unused parameters from IScore interface 2020-06-15 11:14:15 +02:00
Zwelf 68aa157c11 Simplify /rank sql request 2020-06-15 11:14:15 +02:00
Zwelf eda0bab4bb Thread safe /rank 2020-06-15 11:14:15 +02:00
Zwelf 91e286f54d Fix parsing responses from player 2020-06-15 11:14:15 +02:00
Zwelf 76c227a542 Reimplement /mapinfo command 2020-06-15 11:14:15 +02:00
Zwelf 9add354367 Use Template for SqlResult 2020-06-15 11:14:15 +02:00
Zwelf 873f478a82 Rename Debut to Offset 2020-06-15 11:14:15 +02:00
Zwelf 4ee08dcc5c Remove unused arguments from IScore 2020-06-15 11:14:15 +02:00
Zwelf 69cf72dae4 Adjust file based ShowRank, ShowTeamRank, ShowPoints consistent functions to sql 2020-06-15 11:14:15 +02:00
Zwelf 3d25953036 Ordered functions 2020-06-15 11:14:14 +02:00
Zwelf a990acc512 Remove existing CRandomMapResult to simplify IScore interface 2020-06-15 11:12:57 +02:00
Zwelf 3af18f5f60 Create shared pointer on demand 2020-06-15 10:59:59 +02:00
Zwelf 0891a0fd51 Remove some unnecessary header includes 2020-06-15 10:59:59 +02:00
Zwelf 8a22cce031 Start of sql refractor
* Use atomic integer in thread count for thread safety
2020-06-15 10:59:46 +02:00
Zwelf add4fab645 Disallow team join while save command is active 2020-06-15 10:59:46 +02:00
Zwelf 7146eb572b Save error handling clean up 2020-06-15 10:59:46 +02:00