Commit graph

15981 commits

Author SHA1 Message Date
Robert Müller f5a16c1c77 Fix crash in editor when using up/down keys on empty images list 2022-10-21 20:28:30 +02:00
Robert Müller 4a683e024a Fix crash in editor when using up/down keys on empty sounds list 2022-10-21 20:28:00 +02:00
bors[bot] 8feba4ecf6
Merge #5966
5966: Fix duplicate description of cl_default_zoom_level r=heinrich5991 a=def-

Since #5894 is not landing

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your 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-10-21 11:53:55 +00:00
bors[bot] 1c56ca4096
Merge #5964
5964: Ignore useless pylint options (fixes #5950) r=heinrich5991 a=def-

I think we should disable this warning for unknown warnings so that old pylint versions keep working ok

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your 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-10-21 11:27:18 +00:00
bors[bot] 9c6a187ee9
Merge #5965
5965: Don't print max value when there is none (fixes #5953) r=edg-l a=def-

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## 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: Dennis Felsing <dennis@felsin9.de>
2022-10-21 07:35:19 +00:00
Dennis Felsing eb27b26d8d Also ignore min value 2022-10-21 00:34:44 +02:00
Dennis Felsing f7bc58b056 Fix duplicate description of cl_default_zoom_level
Since #5894 is not landing
2022-10-21 00:12:07 +02:00
Dennis Felsing 26a08360f8 Don't print max value when there is none (fixes #5953) 2022-10-21 00:09:30 +02:00
Dennis Felsing 1020b0a26f Ignore useless pylint options (fixes #5950)
I think we should disable this warning for unknown warnings so that old
pylint versions keep working ok
2022-10-21 00:01:10 +02:00
bors[bot] 6aa5953159
Merge #5963
5963: Avoid using `atoi`, `atof` and `atol` functions, use `str_copy` instead of `snprintf` to copy strings r=def- a=Robyt3



## 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: Robert Müller <robytemueller@gmail.com>
2022-10-20 20:40:02 +00:00
Robert Müller 73fe4e6ed4 Use str_copy instead of snprintf to copy strings 2022-10-20 20:56:58 +02:00
Robert Müller c4cf26ea81 Replace atol usages with str_toint, as type is int anyway
As `atol` does not provide any way to detect errors and can cause undefined behavior on errors, i.e. when the result cannot be represented as a `long`.

The `atol` function was only used in `priv_net_extract` for parsing the port, which is an `int` and not a `long`, so the existing `str_toint` is used instead.

References:

- https://wiki.sei.cmu.edu/confluence/display/c/ERR07-C.+Prefer+functions+that+support+error+checking+over+equivalent+functions+that+don%27t
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/atol.html
2022-10-20 20:54:01 +02:00
Robert Müller 1469e88a79 Replace atof usages with strtod (str_tofloat wrapper)
As `atof` does not provide any way to detect errors and can cause undefined behavior on errors, i.e. when the result cannot be represented as a `float`.

References:

- https://wiki.sei.cmu.edu/confluence/display/c/ERR07-C.+Prefer+functions+that+support+error+checking+over+equivalent+functions+that+don%27t
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/atof.html
2022-10-20 20:30:12 +02:00
Robert Müller 6b043bf3b2 Replace atoi usages with strtol (str_toint wrapper)
As `atoi` does not provide any way to detect errors and can cause undefined behavior on errors, i.e. when the result cannot be represented as an `int`.

References:

- https://wiki.sei.cmu.edu/confluence/display/c/ERR07-C.+Prefer+functions+that+support+error+checking+over+equivalent+functions+that+don%27t
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/atoi.html
2022-10-20 20:30:11 +02:00
bors[bot] 040726ea71
Merge #5962
5962: Update Korean translations by CHaBek r=heinrich5991 a=cwh7435

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your 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: CHaBek <44938972+cwh7435@users.noreply.github.com>
2022-10-20 14:10:55 +00:00
CHaBek 158b721bd4
Update Korean translations by CHaBek 2022-10-20 23:03:01 +09:00
bors[bot] 0de14cbe5c
Merge #5961
5961: Update russian.txt r=heinrich5991 a=lolipodass

added the missing translations

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] 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)
![image](https://user-images.githubusercontent.com/56706038/196875775-12fd4f3d-78a9-42e7-8800-d2c2ac524e4c.png)
![image](https://user-images.githubusercontent.com/56706038/196875846-b45d0089-d3a1-4842-a287-bcaae8ca1dce.png)



Co-authored-by: lolipodass <56706038+lolipodass@users.noreply.github.com>
2022-10-20 10:01:32 +00:00
lolipodass 8a39ef71de
Update russian.txt
added the missing translations
2022-10-20 09:40:16 +03:00
bors[bot] e32710c7d1
Merge #5959
5959: Sort dependencies alphabetically in README.md r=def- a=heinrich5991

## 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-10-19 23:04:44 +00:00
bors[bot] 53080e3e14
Merge #5938
5938: Hex Values in the editor's info feature r=heinrich5991 a=VoxelDoesCode

Add an option when the info button is selected, you can show the hexadecimal values for a tile rather than 1-255. This has some benefits, as it aligns in a perfect grid. Can help with making and test automappers.

![image](https://user-images.githubusercontent.com/95713843/195209286-82dd04d5-f469-4932-bbd7-93ec3fd32f99.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
- [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: VoxelDoesCode <bluheadcat@gmail.com>
2022-10-19 22:47:35 +00:00
heinrich5991 dcd76fd3e1 Add support for Rust code in DDNet
The glue is done using the [cxx crate](https://cxx.rs/) on the Rust
side.

As a proof-of-concept, only a small console command (`rust_version`)
printing the currently used Rust version was added.

You can generate and open the Rust documentation using
`DDNET_TEST_NO_LINK=1 cargo doc --open`.

You can run the Rust tests using `cmake --build <build dir> --target
run_rust_tests`, they're automatically included in the `run_tests`
target as well.

Rust tests don't work on Windows in debug mode on Windows because Rust
cannot currently link with the debug version of the C stdlib on Windows:
https://github.com/rust-lang/rust/issues/39016.

---

The stuff in `src/rust-bridge` is generated using
```
cxxbridge src/engine/shared/rust_version.rs --output src/rust-bridge/engine/shared/rust_version.cpp --output src/rust-bridge/engine/shared/rust_version.h
cxxbridge src/engine/console.rs --output src/rust-bridge/cpp/console.cpp --output src/rust-bridge/cpp/console.h
```
2022-10-19 23:46:06 +02:00
heinrich5991 38a07a2494 Sort dependencies alphabetically in README.md 2022-10-19 22:27:20 +02:00
heinrich5991 1b114b2565 Only pass CXXFLAGS to initial cmake 2022-10-19 22:21:48 +02:00
heinrich5991 be29ef2691 Remove unneeded CFLAGS variable
We don't have C source files anymore.
2022-10-19 22:21:48 +02:00
bors[bot] f977a382f3
Merge #5958
5958: fix skin click ptr r=heinrich5991 a=Jupeyy

Just noticed that the menu button didnt work anymore, bcs we often use the pointer of the config vars or other variables for the pID ptr

and since i moved the m_aName up in the CSkin: pSkin(the ptr) and pSkin->GetName()(ptr to m_aName) returned the same ptr ( another UI element already use pSkin, our UI breaks bcs of that)

such a mess xDD
## 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-10-19 19:24:25 +00:00
Jupeyy b70fc39571 fix skin click ptr 2022-10-19 20:18:43 +02:00
bors[bot] 4050678526
Merge #5954
5954: Use CMake to configure static C stdlib on Windows r=def- a=heinrich5991

Previously warnings were generated because we were passing /MTd-like arguments twice, due to us and CMake 3.15+ adding these arguments: https://cmake.org/cmake/help/v3.25/policy/CMP0091.html.

This requires CMake 3.15 on Windows.

This fixes #5940.

## 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-10-18 20:15:21 +00:00
bors[bot] 401157dfde
Merge #5955
5955: Fix `parse_drmingw.sh` not finding module offset on Linux systems r=heinrich5991 a=Robyt3

The end anchor is removed from the grep RegEx, as it's not necessary and as it doesn't work on Linux systems when the crash log uses Windows line endings.

## 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: Robert Müller <robytemueller@gmail.com>
2022-10-18 19:52:45 +00:00
Robert Müller ec5d5d0fb9 Fix parse_drmingw.sh not finding module offset on Linux systems
The end anchor is removed from the grep RegEx, as it's not necessary and as it doesn't work on Linux systems when the crash log uses Windows line endings.
2022-10-18 18:36:57 +02:00
heinrich5991 845c67afad Use CMake to configure static C stdlib on Windows
Previously warnings were generated because we were passing /MTd-like
arguments twice, due to us and CMake 3.15+ adding these arguments:
https://cmake.org/cmake/help/v3.25/policy/CMP0091.html.

This requires CMake 3.15 on Windows.

This fixes #5940.
2022-10-18 14:53:37 +02:00
bors[bot] e05e47b200
Merge #5951
5951: Fix compilation with VS2022 with exception handling enabled r=heinrich5991 a=Robyt3

By moving the calling convention `APIENTRY`, which expands to `__stdcall`, inside the parenthesis.

```
Severity	Code	Description	Project	File	Line	Suppression State
Error	C2143	syntax error: missing ')' before '('	engine-shared	src\base\system.cpp	4242
Warning	C4229	anachronism used: modifiers on data are ignored	engine-shared	src\base\system.cpp	4242
Error	C2059	syntax error: ')'	engine-shared	src\base\system.cpp	4242
Error	C2059	syntax error: ')'	engine-shared	src\base\system.cpp	4242
Error	C3536	'exception_log_file_path_func': cannot be used before it is initialized	engine-shared	src\base\system.cpp	4246
Error	C2446	'==': no conversion from 'nullptr' to 'int'	engine-shared	src\base\system.cpp	4246
Error	C2064	term does not evaluate to a function taking 1 arguments	engine-shared	src\base\system.cpp	4249
```

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your 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: Robert Müller <robytemueller@gmail.com>
2022-10-16 16:45:19 +00:00
Robert Müller 25e6eed0e8 Fix compilation with VS2022 with exception handling enabled
By moving the calling convention `APIENTRY`, which expands to `__stdcall`, inside the parenthesis.

```
Severity	Code	Description	Project	File	Line	Suppression State
Error	C2143	syntax error: missing ')' before '('	engine-shared	src\base\system.cpp	4242
Warning	C4229	anachronism used: modifiers on data are ignored	engine-shared	src\base\system.cpp	4242
Error	C2059	syntax error: ')'	engine-shared	src\base\system.cpp	4242
Error	C2059	syntax error: ')'	engine-shared	src\base\system.cpp	4242
Error	C3536	'exception_log_file_path_func': cannot be used before it is initialized	engine-shared	src\base\system.cpp	4246
Error	C2446	'==': no conversion from 'nullptr' to 'int'	engine-shared	src\base\system.cpp	4246
Error	C2064	term does not evaluate to a function taking 1 arguments	engine-shared	src\base\system.cpp	4249
```
2022-10-16 18:16:58 +02:00
bors[bot] 24207b741c
Merge #5947
5947: Fix client crash when server does not send gameinfo r=def- a=Robyt3

As reported by `@ChillerDragon` on Discord.

## 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
- [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-10-15 19:20:25 +00:00
bors[bot] 93b99efa8b
Merge #5946
5946: Add tests for too small/large `sha256_str` and `md5_str` buffers, minor refactoring r=def- a=Robyt3



## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [X] 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: Robert Müller <robytemueller@gmail.com>
2022-10-15 18:58:19 +00:00
Robert Müller c78f71b2b9 Fix client crash when server does not send gameinfo 2022-10-15 19:43:26 +02:00
Robert Müller 0a6ad9cf9d Add tests for too small/large sha256_str and md5_str buffers
Rename `Expect` to `ExpectSha256` and `Expect2` to `ExpectMd5` for better readability.

Pass buffer size by template parameter to reduce duplicate source code.
2022-10-15 18:18:18 +02:00
Robert Müller a07c51b637 Use size_t for indices in digest_str 2022-10-15 18:08:41 +02:00
Robert Müller c0b5e8965e Refactor usages of sha256_str
- Pass the actual array size instead of using the constant.
- Use the string length to write sha256 string to file.
2022-10-15 18:06:45 +02:00
bors[bot] 9e4da2244a
Merge #5944
5944: Fix example name in mapbug description r=heinrich5991 a=Zwelf

Fix typo: 6c3d0e999b/src/game/mapbugs_list.h (L3)

## 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: Zwelf <zwelf@strct.cc>
2022-10-14 16:02:40 +00:00
bors[bot] 83ff5762c5
Merge #5945
5945: Update zlib to version 1.2.13 r=heinrich5991 a=Robyt3

Release notes: https://github.com/madler/zlib/releases/tag/v1.2.13

## 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: Robert Müller <robytemueller@gmail.com>
2022-10-14 15:41:48 +00:00
Robert Müller 05eb1db436 Update zlib to version 1.2.13
Release notes: https://github.com/madler/zlib/releases/tag/v1.2.13
2022-10-14 14:53:24 +02:00
bors[bot] 83aeb251ee
Merge #5943
5943: Enable antispoof for vanilla by default r=def- a=heinrich5991

Having it disabled opens up the server for attacks.

## 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-10-13 10:31:21 +00:00
Zwelf 0e0e55eb43 Fix example name in mapbug description 2022-10-13 11:51:18 +02:00
heinrich5991 ea17fc753e Enable antispoof for vanilla by default
Having it disabled opens up the server for attacks.
2022-10-13 09:55:39 +02:00
bors[bot] 6c3d0e999b
Merge #5933 #5941
5933: Inline `Is(GameType)` functions and remove support for legacy 64 player info protocol r=def- a=heinrich5991

## 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)


5941: Get away from vector for skins r=def- a=Jupeyy

most of the time it uses the index just to get the skin, downloaded skins change the index. Now its simply a heap object and downloaded skins load directly. Also the loading might be a bit faster bcs it had a loop lookup .Also O(1) lookup

not 100% tested. also fixes a bug with favorite skins hopefully
## 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>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-10-12 22:08:17 +00:00
bors[bot] bd3b4f2d50
Merge #5942
5942: Support unicode with ExcHndl, use upstream module offsets, handle errors r=def- a=Robyt3

Update Dr. Mingw (ExcHndl) to 0.9.8.

Use the new `ExcHndlSetLogFileNameW` function to set the exception log file name using wide characters, to support paths containing unicode.

It's not necessary to call `ExcHndlInit` explicitly after loading `exchndl.dll`, as the `DllMain` will already initialize the exception handler when the DLL is loaded. Module offsets are supported by upstream ExcHndl now, so we don't need to provide our own version that supplies the module offset to `ExcHndlInit` anymore. Upstream ExcHndl will also resolve the source code lines for addresses automatically, when the executable is build with debug information.

Handle the cases that the exception handling module cannot be loaded and that the `ExcHndlSetLogFileNameW` function cannot be found in the module.

Update `scripts/parse_drmingw.sh`:

- Parse both old and new module offsets.
- Use tabs instead of spaces consistently.
- Reset the ANSI color after printing colored messages.

Closes #5877.

Needs https://github.com/ddnet/ddnet-libs/pull/34.

Example crash logs:

- [crash_debug_old.RTP.txt](https://github.com/ddnet/ddnet/files/9768008/crash_debug_old.RTP.txt)
- [crash_debug_new.RTP.txt](https://github.com/ddnet/ddnet/files/9768011/crash_debug_new.RTP.txt)
- [crash_release_old.RTP.txt](https://github.com/ddnet/ddnet/files/9768010/crash_release_old.RTP.txt)
- [crash_release_new.RTP.txt](https://github.com/ddnet/ddnet/files/9768009/crash_release_new.RTP.txt)

## 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: Robert Müller <robytemueller@gmail.com>
2022-10-12 21:44:43 +00:00
Jupeyy a804c3ca5b Get away from vector for skins
most of the time it uses the index just to get the skin, downloaded skins change the index.
Now its simply a heap object and downloaded skins load directly. Also the loading might be a bit faster bcs it had a loop lookup
Also O(1) lookup
2022-10-12 22:32:36 +02:00
bors[bot] 16c5756e2f
Merge #5937
5937: Initialize the Windows COM library on all threads, ensure Windows DDE conversations are finished in `open_link` r=heinrich5991 a=Robyt3



## 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: Robert Müller <robytemueller@gmail.com>
2022-10-12 19:25:20 +00:00
Robert Müller fb317779fc Support unicode with ExcHndl, use upstream module offsets, handle errors
Update Dr. Mingw (ExcHndl) to 0.9.8.

Use the new `ExcHndlSetLogFileNameW` function to set the exception log file name using wide characters, to support paths containing unicode.

It's not necessary to call `ExcHndlInit` explicitly after loading `exchndl.dll`, as the `DllMain` will already initialize the exception handler when the DLL is loaded.
Module offsets are supported by upstream ExcHndl now, so we don't need to provide our own version that supplies the module offset to `ExcHndlInit` anymore.
Upstream ExcHndl will also resolve the source code lines for addresses automatically, when the executable is build with debug information.

Handle the cases that the exception handling module cannot be loaded and that the `ExcHndlSetLogFileNameW` function cannot be found in the module.

Update `scripts/parse_drmingw.sh`:

- Parse both old and new module offsets.
- Use tabs instead of spaces consistently.
- Reset the ANSI color after printing colored messages.
2022-10-12 21:11:35 +02:00
Robert Müller c68841a733 Ensure Windows DDE conversations are finished in open_link
Use `ShellExecuteExW` instead of `ShellExecuteW` to pass the additional flag `SEE_MASK_NOASYNC`. This should ensure that DDE (Dynamic data exchange) conversations are finished before the function returns, as it would otherwise be necessary to manually pump messages on the calling thread. DDE conversations may be initiated when shell extensions are loaded via `ShellExecute`. Failing to answer the DDE messages will block the calling UI thread and may cause a dead-lock.

The flag `SEE_MASK_FLAG_NO_UI` is used to prevent native error message popups when the link/file cannot be opened.

Additionally, the `ShellExecute` verb is changed from `"open"` to `NULL`, which will cause the default shell handler to be used instead, as the `"open"` verb may not be available for all targets. Though for most targets it will be the default verb anyway.

References:

- https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew
- https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shellexecuteinfow
- https://devblogs.microsoft.com/oldnewthing/20070430-00/?p=27063
- https://learn.microsoft.com/en-us/windows/win32/dataxchg/about-dynamic-data-exchange

Yet another attempt at solving #5744.
2022-10-12 17:18:57 +02:00