Commit graph

11905 commits

Author SHA1 Message Date
Learath f91a3069c3 Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
Dennis Felsing fece84c892 Add Voxel to contributors 2022-09-16 13:14:41 +02:00
Dennis Felsing 3e93f3ac8a Version 16.4 2022-09-16 13:07:36 +02:00
VoxelDoesCode fb15a7c2a4 Running and AFK anim. states 2022-09-16 12:30:05 +02:00
bors[bot] 68e2f51280
Merge #5756
5756: Editor: added a goto button r=heinrich5991 a=archimede67

<!-- What is the motivation for the changes of this pull request -->

This feature was also suggested by Pulsar. It adds a button to go to a specified coordinate point by inputting x and y coordinates through a popup window:

![image](https://user-images.githubusercontent.com/13364635/185762103-48a9fbaf-282e-45d8-86a4-bf5eedf620b0.png)

The two number inputs are constrained between 0 and the width/height of the map (minus 1). When clicking "Go", it focuses the camera at the center of the tile at these coordinates.

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Corantin H <archi0670@gmail.com>
2022-09-16 01:17:56 +00:00
bors[bot] e5fc394494
Merge #5835
5835: Update translations via script, new German translations r=heinrich5991 a=def-

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-09-16 00:58:44 +00:00
Dennis Felsing ef174a58a8 Fix TSA warnings in Clang 15 (fixes #5548)
src/engine/client/serverbrowser_http.cpp:147:1: warning: mutex 'ls.m_Lock' is still held at the end of function [-Wthread-safety-analysis]
}
^
2022-09-15 23:31:09 +02:00
Dennis Felsing 31cf68c65d Fix mismatched bound warning in map_replace_area and map_create_pixelart
src/tools/map_replace_area.cpp:644:38: warning: argument 'aLine' of type 'const float[2]' with mismatched bound [-Warray-parameter]
bool GetLineIntersection(const float aLine[2], const float Point)
                                     ^
src/tools/map_replace_area.cpp:55:37: note: previously declared as 'const float[]' here
bool GetLineIntersection(const float[], float);
                                    ^
2022-09-15 23:23:04 +02:00
Corantin H e52e443988 Editor: used max int value for goto min and max coordinates 2022-09-15 20:54:20 +02:00
Dennis Felsing 9a2835c9dd Update translations via script, new German translations
New English text for marking the beginning/end of a cut
2022-09-15 14:38:08 +02:00
bors[bot] 55703c971c
Merge #5829
5829: Add HTTPS map download URL field for game servers r=def- a=heinrich5991

This allows every game server to provide its own HTTPS server for map
downloads. Since the ingame protocol for downloading map data is very
inefficient, this is desirable. Previously, only servers hosted by DDNet
could benefit from this.

Security concerns:
- Attackers can find out whether a given HTTPS GET request matches a
  known answer.

  This isn't deemed to be problematic as no cookies for authentication
  are sent and only the whole response can be matched.

- Sending requests to honeypot URLs to get people in legal trouble.

  This seems to be already possible with HTML image embeds, so it can't
  be that bad™.

- Downloading huge files, filling up a player's disk. The players might
  cancel when seeing huge files.

  There's a generous limit of 1 GiB per map file.

- Downloading huge files transparently compressed with gzip. See above.

Fixes #5812.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-09-15 08:54:46 +00:00
bors[bot] ed2b0f40b9
Merge #5639
5639: Add different laser colors for different types r=def- a=VoxelDoesCode

Since we're doing a push to assist newer players, I think it would be a good idea to differentiate the different types of lasers, so that non-moving laser entities aren't confused with doors (I'm aware the blinking is a sign, but it's very subtle). This also includes a new color for Shotgun's laser, which would be a nice touch for both customization and clarity. 

![image](https://user-images.githubusercontent.com/95713843/179640279-06bb52a0-9070-48ca-b39f-013034f9c16e.png)
![image](https://user-images.githubusercontent.com/95713843/179640326-bcfad3a9-6209-4514-8850-98c5146e28b8.png)

If this were to be implemented though, it would require a server update, because the server actually needs to send the DDNetLaser to clients with a high enough client version (It's set to 17000 currently). As of right now it's a solid concept.

Huge thanks to Fokkonaut for finalizing this concept!

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: VoxelDoesCode <bluheadcat@gmail.com>
Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
2022-09-15 07:14:11 +00:00
bors[bot] da0dca25c3
Merge #5823
5823: Editor: Added reload button for image and sound popups r=heinrich5991 a=sctt

Automatically reloads the image from mapres folder based on its current name, that's just a quicker "replace" which is convenient while experimenting on image contents, some mappers asked for this.

![Screenshot from 2022-09-10 11-57-58](https://user-images.githubusercontent.com/3328841/189479587-620c812c-0df2-4ba2-94a0-83eca8e42c81.png)

note: image lookup is currently limited to the mapres root folder, no directory recursion has been implemented, this is an improvement that might be added in the future (even though in my understanding, organizing mapres into subfolders is not a very common practice, not even the "search" feature considers that).

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: “sctt” <“sctt@sctt.it”>
2022-09-15 06:54:50 +00:00
“sctt” 73d883d16b Editor image reload: renamed reload into readd 2022-09-15 08:46:31 +02:00
heinrich5991 716e8cd7f4 Add HTTPS map download URL field for game servers
This allows every game server to provide its own HTTPS server for map
downloads. Since the ingame protocol for downloading map data is very
inefficient, this is desirable. Previously, only servers hosted by DDNet
could benefit from this.

Security concerns:
- Attackers can find out whether a given HTTPS GET request matches a
  known answer.

  This isn't deemed to be problematic as no cookies for authentication
  are sent and only the whole response can be matched.

- Sending requests to honeypot URLs to get people in legal trouble.

  This seems to be already possible with HTML image embeds, so it can't
  be that bad™.

- Downloading huge files, filling up a player's disk. The players might
  cancel when seeing huge files.

  There's a generous limit of 1 GiB per map file.

- Downloading huge files transparently compressed with gzip. See above.

Fixes #5812.
2022-09-15 02:08:35 +02:00
heinrich5991 0bf941e6c9 Add MaxResponseSize to limit HTTP response sizes 2022-09-15 02:08:35 +02:00
heinrich5991 cb2614ff5c Treat manual aborts the same way as errors for map downloads 2022-09-15 02:08:34 +02:00
heinrich5991 9f1dd0d3c4 Disallow HTTP (without S) requests by default
Add a non-saved config variable `http_allow_insecure` to re-enable HTTP
support; this is mostly useful for testing stuff.

Disallowing HTTP by default allows fewer insecure data to be sent and
received by the DDNet client.
2022-09-15 01:29:13 +02:00
fokkonaut 5deeb299fa Add DDNetLaser to have more info about a laser shot 2022-09-15 01:01:32 +02:00
VoxelDoesCode 03b90f4f3d Added new cl colors and tweaked the settings menu
Merging of DoLaserPreview and static int fix

Replace if else statement with switch function

Adjusted RenderDropDown header to match

static int cbuttoncontainer fix, potential bugs
2022-09-15 01:01:04 +02:00
heinrich5991 9b4371f18f Change log format
Remove square brackets to reduce the amount of space used.

Add log level indicator. The position between timestamp and system was
chosen because it is at a fixed position (unlike after the system) but
the log still remains naively sortable (which wouldn't happen if we were
to place it in front of the timestamp.

Before:
```
[2022-04-29 15:25:37][engine]: running on unix-linux-amd64
[2022-04-29 15:25:37][engine]: arch is little endian
[2022-04-29 15:25:37][storage]: added path '$USERDIR' ('/path/to/home/.teeworlds')
[2022-04-29 15:25:37][storage]: added path '$DATADIR' ('data')
[2022-04-29 15:25:37][storage]: added path '$CURRENTDIR' ('/path/to/ddnet')
[2022-04-29 15:25:37][host_lookup]: host='localhost' port=0 1
[2022-04-29 15:25:37][host_lookup]: host='localhost' port=0 2
[2022-04-29 15:25:37][console]: executing 'autoexec_server.cfg'
```

After:
```
2022-04-29 15:25:37 I engine: running on unix-linux-amd64
2022-04-29 15:25:37 I engine: arch is little endian
2022-04-29 15:25:37 I storage: added path '$USERDIR' ('/path/to/home/.teeworlds')
2022-04-29 15:25:37 I storage: added path '$DATADIR' ('data')
2022-04-29 15:25:37 I storage: added path '$CURRENTDIR' ('/path/to/ddnet')
2022-04-29 15:25:37 I host_lookup: host='localhost' port=0 1
2022-04-29 15:25:37 I host_lookup: host='localhost' port=0 2
2022-04-29 15:25:37 I console: executing 'autoexec_server.cfg'
```
2022-09-14 19:37:55 +02:00
bors[bot] b48ac7d5f4
Merge #5833
5833: Improve message on failed load r=heinrich5991 a=def-


![Screenshot 2022-09-13 at 20 31 20](https://user-images.githubusercontent.com/2335377/189982324-91639abd-6f5b-4248-85f9-5e03443e6182.png)

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-09-13 21:39:39 +00:00
Dennis Felsing 51c0bb1f43 Improve message on failed load 2022-09-13 20:30:30 +02:00
Dennis Felsing b26dd29a23 Use bindaddr for curl too (fixes #5831) 2022-09-13 19:45:17 +02:00
Dennis Felsing a67e30647e Add sv_sql_bindaddr (fixes #5830) 2022-09-13 17:09:53 +02:00
bors[bot] cef096ecd7
Merge #5820
5820: Editor: Added "Order" button in quads popup r=heinrich5991 a=sctt

Main purpose is to control quads z index, but i like how this can be used to reveal how many quads a layer has just by placing a new one.
Furthermore, it provides a way to reference quads, that's needed to make custom cli tools work on user selected quads.

![Screenshot from 2022-09-09 19-04-21](https://user-images.githubusercontent.com/3328841/189411505-558ca601-e753-48b2-a6c3-d9f293795951.png)

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: “sctt” <“sctt@sctt.it”>
2022-09-11 22:44:13 +00:00
bors[bot] 766d9f66cc
Merge #5822
5822: Move skin info after the settings (settings can cause reload -> skin … r=heinrich5991 a=Jupeyy

…is invalid)
Also added an assert now, we dont want to render invalid textures ever since its always a logic bug

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-09-11 22:29:22 +00:00
heinrich5991 94446f65bd Ignore server info with control characters
This simply treats server info as invalid if it contains control
characters in any string.

Fixes #5826.
2022-09-11 23:42:05 +02:00
heinrich5991 acb0ce8a1e Unify string test naming 2022-09-11 23:40:32 +02:00
heinrich5991 911835f940 Add str_has_cc to check for control characters in strings 2022-09-11 23:39:16 +02:00
“sctt” 79fa29d8b8 editor: added order button in quads popup 2022-09-10 18:04:38 +02:00
Jupeyy f59f79e02f Move skin info after the settings (settings can cause reload -> skin is invalid) 2022-09-10 15:03:59 +02:00
“sctt” 39223dfd8a editor: added reload button for image and sound popups 2022-09-10 12:23:00 +02:00
Robert Müller 19a0544364 Fix editor layer image selection not working 2022-09-08 15:30:22 +02:00
Robert Müller 9a76ebdcb6 Save and restore FPU control word when calling ShellExecute
ShellExecute may load additional DLLs in the current context, which might change the FPU control word.

Another potential fix for #5744.

Sources:
- https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6457572
- https://web.archive.org/web/20070730055602/http://tolstoy.newcastle.edu.au/R/devel/06/02/4262.html
- http://www.delphigroups.info/2/d3/420953-2.html (only available in Google Cache for me)
- f4d80957e8/src/windows/native/sun/windows/awt_Desktop.cpp (L46-L49)
2022-09-05 22:18:39 +02:00
Robert Müller ff471b4d17 Minor refactoring: homogenise code structure of selection popups 2022-09-04 23:00:51 +02:00
Robert Müller 833f690c59 Refactor editor sound selection popup using CScrollRegion
Decrease popup size by remove the unused empty space designated for "previewing" sounds.
2022-09-04 22:59:33 +02:00
Robert Müller cef984294c Fix minimum/maximum values of editor properties
The Order-property maximum value was too large, so it was temporarily (only visually) possible to go beyond the maximum.

The minimum/maximum values for the Color-property were incorrect and redundant, as `PROPTYPE_COLOR` is used for RGBA color properties and not for envelope IDs.
2022-09-04 13:06:15 +02:00
Robert Müller 2e8d203ed4 Fix editor value selector not allowing minimal value change
For example, when the scale is 1, changing the value by exactly 1 was not possible.
2022-09-04 13:02:31 +02:00
Robert Müller 3fd87df844 Fix mouse staying locked when activating text mode in editor 2022-09-04 12:58:39 +02:00
bors[bot] ecce22322e
Merge #5805
5805: Refactor editor server settings and automapper config lists using `CScrollRegion` r=def- a=Robyt3

- Refactor editor automapper config list using `CScrollRegion`. Also fix some other minor issues with this list.
  - Fix the currently selected item not being highlighted after opening the dialog.
  - Remove static limit of 255 automapper rules, after which the editor previously caused out-of-bounds accesses, by using the address of the automapper config name as button ID.
  - Before:  ![automapper old](https://user-images.githubusercontent.com/23437060/188277300-bd634c13-fb66-4348-abf4-9481e8fcaa3a.png)
  - After: ![automapper new](https://user-images.githubusercontent.com/23437060/188277303-0cb94442-f35d-4c1e-bd81-7f56052cede6.png)
- Refactor editor server settings list using `CScrollRegion`.
  - Before:  ![server_settings old](https://user-images.githubusercontent.com/23437060/188277264-8a0d16b5-838c-4bd1-b94c-f11091c68ccf.png)
  - After: ![server_settings new](https://user-images.githubusercontent.com/23437060/188277269-1fabf5a5-9daf-4ffe-893d-1f1690ba597f.png)



## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [X] Considered possible null pointers and out of bounds array indexing
- [X] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-09-03 21:34:32 +00:00
def c95a605fd7 Version 16.3.2 2022-09-03 23:15:55 +02:00
heinrich5991 5028423a0a Fix close messages not being shown when connecting
Previously, close messages were entirely ignored during the connection
process, this meant that ban messages weren't shown to players. Instead,
they'd see the standard "no answer from server yet" message.

Fixes #5792.
2022-09-03 20:25:22 +02:00
Robert Müller 977f1a8245 Refactor editor server settings list using CScrollRegion 2022-09-03 17:13:26 +02:00
Robert Müller 130275a7b2 Refactor editor automapper config list using CScrollRegion
- Fix the currently selected item not being highlighted after opening the dialog.
- Remove static limit of 255 automapper rules, after which the editor previously caused out-of-bounds accesses, by using the address of the automapper config name as button ID.
2022-09-03 16:41:31 +02:00
Robert Müller 1c23a17ee4 Fix hotkeys (scroll regions) not working in editor 2022-09-02 23:16:37 +02:00
bors[bot] cc7fbe275c
Merge #5798
5798: Remove all references to memset r=def- a=heinrich5991

`memset` only worked with `CServer::CClient::STATE_EMPTY` by chance
because it is defined as 0.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-09-02 12:57:54 +00:00
heinrich5991 887b24d8f5 Remove all references to memset
`memset` only worked with `CServer::CClient::STATE_EMPTY` by chance
because it is defined as 0.
2022-09-02 14:32:39 +02:00
bors[bot] cbb61814df
Merge #5722
5722: First send message to team, then kill team (fixes #5721) r=heinrich5991 a=def-

![Screenshot 2022-08-10 at 15 54 13](https://user-images.githubusercontent.com/2335377/183919209-a5fb95e6-d578-4376-9fb6-a72d0381001c.png)

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-09-02 11:14:42 +00:00
Robert Müller e7c3ce186f Port CUI::ConsumeHotkey from upstream
Move hotkey/input handling from `CMenus` to `CUI`.

Using the `ConsumeHotkey` method ensures that each hotkey is only handled once.

By also handling the mouse scroll wheel as hotkeys, this fixes the scroll keys activating scroll regions while the controls binder is active.
2022-08-31 21:43:57 +02:00