Commit graph

10589 commits

Author SHA1 Message Date
def d479cac089 Rename IsSwitch to GetSwitchType 2021-12-19 12:10:03 +01:00
def 17287de243 Make /rescue handle switch freeze too 2021-12-19 12:10:00 +01:00
def acf199835d Support GUI/Cmd key and use it as equivalent to ctrl in default shortcuts
like ctrl-f / cmd-f

On macOS all these system shortcuts are done with cmd while on Windows
ctrl is used. Support both now

Added support for cmd key as modifier for binds
2021-12-18 12:23:20 +01:00
def 374c5ac64d Implement unmuteid, make it clearer that unmute uses ID from mutes
not player id
2021-12-18 11:28:54 +01:00
def 97f8e29a60 Minor cleanup 2021-12-18 11:20:22 +01:00
def 35d5854e28 Consider initial chat delays as normal mutes (fixes # 4460) 2021-12-18 11:20:16 +01:00
def ea7e39c2f0 Alternative fix for cut off names (fixes #4463)
https://github.com/ddnet/ddnet/pull/4465 might have more side effects
2021-12-18 10:34:20 +01:00
bors[bot] 5ec6f0994d
Merge #4410
4410: Fix leak in CLayerTiles::BrushGrab (fixes #4409) r=Learath2 a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-12-17 23:38:19 +00:00
def b445a8aeaf Fix mouse selection after changing window size (on macOS) 2021-12-18 00:12:23 +01:00
heinrich5991 cdbf8ff2d2 Skip the UTF-8 BOM on all read text files
Fixes #4462.
2021-12-17 22:07:01 +01:00
heinrich5991 49c861372a Add a flag to skip a UTF-8 BOM when opening files for reading
https://en.wikipedia.org/w/index.php?title=Byte_order_mark&oldid=1059783325#UTF-8

This allows to read text files created by Windows users transparently,
even if they contain a UTF-8 BOM.
2021-12-17 22:07:01 +01:00
def ef5d3b77a9 Support cl_video_show_direction 2
Currently to show your own key presses when recording you need
cl_video_showdirection 1 and cl_show_direction 2 which is kind of
unintuitive.

Also changed the name to be consistent with cl_show_direction
2021-12-17 10:10:03 +01:00
bors[bot] 625ce302dd
Merge #4443
4443: Swap projectile owners when using /swap r=Learath2 a=def-

Thanks to Soapy Sandwich for responsibly disclosing this issue.
https://user-images.githubusercontent.com/2335377/145693247-c5c1ab2e-6353-4a4a-afab-c73f2d7eebc1.mp4
/swap is currently disabled until this is merged.

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-12-16 12:39:00 +00:00
bors[bot] 1d88aef9fe
Merge #4456
4456: Pull some more refactoring from the upstream r=def- a=Kaffeine

The main motivation is making it easier to take (and push) patches to/from `teeworlds`

## 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 if it works standalone, system.c especially
- [ ] 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)

I'm not that familiar with the code. Please let me know if this commit make sense or not:
56900d7644

IIUC two other commits from https://github.com/teeworlds/teeworlds/pull/2594 are not relevant for DDNet (because we're reducing the CPU load differently).

Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
Co-authored-by: Robert Müller <robert.mueller@student.uni-siegen.de>
2021-12-15 07:51:42 +00:00
Robert Müller 843d021f82 add IServer::ChangeMap to fix change_map command
(cherry picked from commit 97d907304c56f643a9ed99e60c35052f950b27fb)
2021-12-15 03:36:25 +03:00
Robert Müller 019f8b665f set m_MapReload instead of polling sv_map, use bool, remove dead code
(cherry picked from commit dc56ab6d93e60f1a4bf26196a76b9e12df65529c)
2021-12-15 03:36:25 +03:00
Alexander Akulich d46e4a14c1 CServer: Port to Config() upstream API 2021-12-15 03:36:25 +03:00
Alexander Akulich 4d346456c5 CServer: Add a const CConfig getter for const Server instance 2021-12-15 03:36:25 +03:00
Alexander Akulich 0b24888f61 CServer: Init m_pConfig variable with the global instance for now
The case is lie. The variable was not initialized.
2021-12-15 03:36:25 +03:00
Alexander Akulich 9d3594205d Console: Add Config() getter as in other classes 2021-12-15 03:36:19 +03:00
Alexander Akulich 145816b046 IServer: Change GetMapName() type to const char *
Partially follow upstream 77daedc814
2021-12-15 03:04:03 +03:00
def ddf04c1ff2 Improve interfaces by exposing SwapClients in CEntities 2021-12-14 10:35:00 +01:00
heinrich5991 3185c75bda Don't clear client version on map change
Also still record client version on map changes into teehistorian.

Fixes #4445.

Thanks to @Kaffeine for noticing.
2021-12-14 06:50:30 +01:00
heinrich5991 4fab7d7500 Remove unused variable m_SupportsMapSha256 2021-12-14 06:49:40 +01:00
def 9496d2697a Disable gfx_asyncrender_old on macOS (fixes #4435) 2021-12-13 19:14:21 +01:00
def ac094b5378 Fix text selection cursor position (fixes #4444)
after moving window to a screen with different dimensions than the
initial one
2021-12-13 19:12:37 +01:00
Robert Müller 8ec50f800b increase scrollbar handle size for small scrollbars 2021-12-13 17:48:17 +01:00
def 7d8a142768 Disable gfx_asyncrender_old on macOS (fixes #4435) 2021-12-13 12:30:30 +01:00
def e83a7ff96f Fix unsafe usage of CLaser casts
Since CDraggers are also stores as entities of ENTTYPE_LASER:

/media/ddnet/src/game/server/teams.cpp:898:23: runtime error: downcast of address 0x61600003db80 which does not point to an object of type 'CLaser'
0x61600003db80: note: object is of type 'CDragger'
 00 00 00 00  d0 24 3c b2 75 55 00 00  00 00 00 00 00 00 00 00  80 d8 03 00 60 61 00 00  f8 c1 04 5a
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CDragger'
2021-12-12 00:35:33 +01:00
def 1d22f6b518 Swap laser owners when using /swap
Since they are implemented independently from projectiles (pistol, grenade)
2021-12-12 00:35:12 +01:00
def 84b1b6f92e Swap projectile owners when using /swap
Thanks to Soapy Sandwich for responsibly disclosing this issue.

/swap is currently disabled until this is merged.
2021-12-11 23:18:38 +01:00
def 9965007fa0 Center timer in HUD (fixes #4438) 2021-12-10 18:27:32 +01:00
bors[bot] d862207a73
Merge #4405
4405: Try to use unique_ptr in tests so we can't forget to delete r=heinrich5991 a=def-

Why is the PingCache test failing now???

<!-- 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-12-10 02:53:55 +00:00
Robert Müller 0ff313b130 adopt vanilla scrollbar colors and code style 2021-12-09 22:57:21 +01:00
Alexander Akulich d832800ebc Server: Implement a 'reason' argument for Console Shutdown
(cherry picked from the upstream commit teeworlds / 6899778b348cce800665e3e320f88a6688168a14)
2021-12-08 20:43:59 +03:00
Alexander Akulich 57e16f3f7b CEntity: Make NetworkClipped() const 2021-12-08 20:35:03 +03:00
Alexander Akulich cad00f7ce1 Add a config var to toggle colors enablement for the console output 2021-12-08 20:35:03 +03:00
Alexander Akulich fa977bbdce Fix UUID messages unpack on demo playing 2021-12-08 18:50:41 +03:00
Zwelf 3db7fca215 Don't shutdown server when there are outstanding sql queries to be executed 2021-12-08 10:09:39 +01:00
Zwelf ac0c935aa1 Skip read requests during shutdown 2021-12-07 13:50:57 +01:00
bors[bot] a46cc81040
Merge #4421 #4423
4421: Swap: Don't spam-protect retrying with local messages only r=heinrich5991 a=def-

As suggested by 冷落:
> I have a advice./swap need wait 30s,and often someone will say /swap
> within 30 seconds,but kept saying it would be muted

<!-- 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 if it works standalone, system.c especially
- [ ] 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)


4423: Fix command line arguments with unicode on windows (without changing existing code) r=heinrich5991 a=Robyt3

#4380 plus the proposed changes. Closes #4369.

## 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
2021-12-06 19:17:35 +00:00
Robert Müller f20443b694 fix command line arguments with unicode on windows
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-06 19:48:25 +01:00
def 16c748c6b1 Swap: Don't spam-protect retrying with local messages only
As suggested by 冷落:
> I have a advice./swap need wait 30s,and often someone will say /swap
> within 30 seconds,but kept saying it would be muted
2021-12-05 23:11:17 +01:00
Robert Müller a61c45550d rename Init method and move implementation 2021-12-03 20:26:27 +01:00
Robert Müller 2fe5464938 remove delegate functions in CMenus, fix variable names 2021-12-03 20:26:26 +01:00
Robert Müller f334b52d94 use UIEx() consistently 2021-12-03 20:26:26 +01:00
Robert Müller af82a20374 move ms_FontmodHeight to CUI 2021-12-03 20:26:25 +01:00
Robert Müller 8887a3137c move DoClearableEditBox to CUIEx 2021-12-03 20:26:23 +01:00
Robert Müller d948a1e41f fix variable name 2021-12-03 20:26:21 +01:00
Robert Müller 4bdddb7e3a pass correct number of utf8 characters to Manipulate 2021-12-03 20:26:17 +01:00
bors[bot] 2524905d74
Merge #4413
4413: Fix some more undefined behavior with super (fixes #4412) r=edg-l a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-12-01 12:43:22 +00:00
def 13044e093c Fix some more undefined behavior with super (fixes #4412) 2021-11-29 17:12:50 +01:00
Robert Müller 083c29f191 fix initialization of CUIEx::m_MouseSlow 2021-11-29 15:43:16 +01:00
def a45829f16d Fix leak in CLayerTiles::BrushGrab (fixes #4409) 2021-11-29 14:29:24 +01:00
def 4ac5ca1449 Try to use unique_ptr in tests so we can't forget to delete 2021-11-29 00:40:10 +01:00
bors[bot] e7fafc5a4f
Merge #4404
4404: test/serverbrowser: delete pConsole r=heinrich5991 a=def-

==235823==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 65632 byte(s) in 1 object(s) allocated from:
    #0 0x563636cc2fc9 in malloc (/media/ddnet/testrunner+0x37afc9)
    #1 0x563636e0fd89 in CHeap::NewChunk() /media/ddnet/src/engine/shared/memheap.cpp:14:17
    #2 0x563636e10aee in CHeap::Reset() /media/ddnet/src/engine/shared/memheap.cpp:63:2
    #3 0x563636d954a5 in CConsole::CExecutionQueue::Reset() /media/ddnet/src/engine/shared/console.h:188:12
    #4 0x563636d4a272 in CConsole::CConsole(int) /media/ddnet/src/engine/shared/console.cpp:937:19
    #5 0x563636d88a98 in CreateConsole(int) /media/ddnet/src/engine/shared/console.cpp:1230:59
    #6 0x563636fbe915 in ServerBrowser_PingCache_Test::TestBody() /media/ddnet/src/test/serverbrowser.cpp:13:23
    #7 0x7f0a2f87fe26 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/usr/lib/libgtest.so.1.11.0+0x54e26)

<!-- 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-28 14:53:22 +00:00
def 87a089c4aa test/serverbrowser: delete pConsole
==235823==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 65632 byte(s) in 1 object(s) allocated from:
    #0 0x563636cc2fc9 in malloc (/media/ddnet/testrunner+0x37afc9)
    #1 0x563636e0fd89 in CHeap::NewChunk() /media/ddnet/src/engine/shared/memheap.cpp:14:17
    #2 0x563636e10aee in CHeap::Reset() /media/ddnet/src/engine/shared/memheap.cpp:63:2
    #3 0x563636d954a5 in CConsole::CExecutionQueue::Reset() /media/ddnet/src/engine/shared/console.h:188:12
    #4 0x563636d4a272 in CConsole::CConsole(int) /media/ddnet/src/engine/shared/console.cpp:937:19
    #5 0x563636d88a98 in CreateConsole(int) /media/ddnet/src/engine/shared/console.cpp:1230:59
    #6 0x563636fbe915 in ServerBrowser_PingCache_Test::TestBody() /media/ddnet/src/test/serverbrowser.cpp:13:23
    #7 0x7f0a2f87fe26 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/usr/lib/libgtest.so.1.11.0+0x54e26)
2021-11-28 15:51:31 +01:00
bors[bot] d02ffefa17
Merge #4403
4403: Remove redundant *count >= max_count check r=def- a=Robyt3

`count` and `max_count` don't change after the check in the while loop.

## 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 if it works standalone, system.c especially
- [ ] 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 <robert.mueller@uni-siegen.de>
2021-11-28 10:06:15 +00:00
Robert Müller 06a1d28a7f remove redundant *count >= max_count check 2021-11-28 11:00:49 +01:00
bors[bot] ca558f406d
Merge #4398
4398: Synchronize with upstream and refactor UI scrollbars r=def- a=Robyt3

- Change appearance of all scrollbars to be consistent with upstream.
  - Change the large knob design that was used in some places to the flat design everywhere (except for color pickers).
  - Add consistent margins around scrollbars.
- Implementing clicking on scrollbar rails to instantly change the value.
- Consolidate UI scrollbar functions from menus and editor in `CUIEx`.
- Various minor refactorings.

## Screenshots

### Before

![br_old](https://user-images.githubusercontent.com/23437060/143658193-d9ea0d31-fa92-466e-9f54-099893caf567.png)
![settings_old](https://user-images.githubusercontent.com/23437060/143658198-1cd3ad52-4680-492c-b244-2699cb5b1c84.png)
![color_old](https://user-images.githubusercontent.com/23437060/143658194-3029dac5-eb29-4fed-a7ed-139f9a00803f.png)
![ed_file_old](https://user-images.githubusercontent.com/23437060/143658195-db00a54d-04ae-41cc-b78c-8a04303486d6.png)
![ed_img_old](https://user-images.githubusercontent.com/23437060/143658196-7f83feb6-8e92-4321-a600-d5ea18f117ad.png)

### After

![br_new](https://user-images.githubusercontent.com/23437060/143658211-1cf8bc58-1bc5-49ef-9946-afa75651c53e.png)
![setting_new](https://user-images.githubusercontent.com/23437060/143658210-00fa3b82-66a3-407a-a5d2-4a736f6b6643.png)
![color_new](https://user-images.githubusercontent.com/23437060/143658212-fca3ef8a-1e67-40f0-983a-3ad83b313ee5.png)
![ed_file_new](https://user-images.githubusercontent.com/23437060/143658214-d93fd473-56d6-48f0-81bb-3dea37618922.png)
![ed_img_new](https://user-images.githubusercontent.com/23437060/143658207-7118887a-4046-4779-8c19-6aba64c8c4ad.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 if it works standalone, system.c especially
- [ ] 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 <robert.mueller@uni-siegen.de>
2021-11-28 09:56:44 +00:00
bors[bot] 33be69f0ac
Merge #4402
4402: Fix stack-buffer-overflow in Whisper (fixes #4400) 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-28 01:36:18 +00:00
def da7dfda47e Disable connection reuse in curl (fixes #4342)
Thanks to @godwhoa for report and testing the workaround!
2021-11-28 01:56:08 +01:00
def 5be5f1032a Fix stack-buffer-overflow in Whisper (fixes #4400) 2021-11-27 20:58:06 +01:00
Robert Müller 053981ee4c refactor UI scrollbars 2021-11-26 23:03:45 +01:00
bors[bot] 5c46efc892
Merge #4391
4391: Remove ping filter (fixes #4365) r=edg-l a=def-

We had lots of cases of people having ping filter activated. Ping is now
too unreliable to actually filter by it. It can show an old super high
value and then you never see the location again.
![screenshot-20211124@160502](https://user-images.githubusercontent.com/2335377/143262874-0cb93dba-9539-4d0d-8400-399dffd3509b.png)

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-11-26 08:21:18 +00:00
bors[bot] c74b0c8536
Merge #4389
4389: Sanitize owner data in client (fixes #4388) r=edg-l a=def-

and don't access out of scope on owner < 0

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-11-26 06:55:48 +00:00
bors[bot] d549c2a0f3
Merge #4396
4396: /swap fix: swap started/finished information r=edg-l a=def-

Thanks to 冷落 for report

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

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-11-26 06:45:28 +00:00
bors[bot] 5c5469ba0a
Merge #4395
4395: Update str_utf8_stats documentation, minor refactoring r=heinrich5991 a=Robyt3

This removes the check for the null-terminator from the while loop, as this is also checked in `str_utf8_forward`, which returns an unchanged size in this case. The comparison `new_size != *size` was previously redundant for that reason.

Update comments and add some empty lines for consistency.

`@heinrich5991` 

## 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 if it works standalone, system.c especially
- [ ] 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 <robert.mueller@uni-siegen.de>
2021-11-26 02:39:09 +00:00
def c6a637948a Version 15.7 2021-11-25 23:51:05 +01:00
def 8dce8d0a8c /swap fix: swap started/finished information
Thanks to 冷落 for report
2021-11-25 23:48:29 +01:00
Robert Müller 7578386538 add empty lines to method documentation 2021-11-25 20:01:29 +01:00
Robert Müller 2ada540988 update str_utf8_stats documentation 2021-11-25 19:54:50 +01:00
Robert Müller 0253b6e25c refactor str_utf8_stats 2021-11-25 19:54:32 +01:00
Robert Müller d747edd1cf replace DeleteUntilCursor and DeleteFromCursor with SetRange 2021-11-25 00:05:04 +01:00
Robert Müller dcdea25284 remove unused CLineInput::CCallback 2021-11-25 00:05:04 +01:00
Robert Müller c5ca424675 add CLineInput::Insert 2021-11-25 00:04:59 +01:00
Robert Müller 85236edcde rename CLineInput::Add to Append and refactor 2021-11-25 00:03:44 +01:00
Robert Müller 35a3d8c604 add CLineInput::SetRange 2021-11-25 00:00:20 +01:00
Robert Müller fa8f540108 use str_utf8_stats in CLineInput::Manipulate 2021-11-24 23:39:34 +01:00
Robert Müller 5cf356229b refactor CLineInput::Clear 2021-11-24 23:31:40 +01:00
Robert Müller 350042975b use str_utf8_stats in CLineInput::Set 2021-11-24 23:29:09 +01:00
Robert Müller 84ecbdb9d0 add str_utf8_stats to base system 2021-11-24 23:24:46 +01:00
def 7464785013 Remove ping filter (fixes #4365)
We had lots of cases of people having ping filter activated. Ping is now
too unreliable to actually filter by it. It can show an old super high
value and then you never see the location again.
2021-11-24 16:04:04 +01:00
def a817a2e60f Sanitize owner data in client (fixes #4388)
and don't access out of scope on owner < 0
2021-11-24 15:41:27 +01:00
bors[bot] 2376de500d
Merge #4381 #4382 #4387
4381: Fix enter behavior when creating new folder in editor r=edg-l a=def-

As reported by louis:

> pressing enter while creating a new folder in the editor (while using
> "save as") does not create the folder but instead enters the selected
> folder in the background

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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)


4382: Fix save typing when server settings are open in editor r=edg-l a=def-

As reported by louis:

> while saving a mapname while having the "Server Settings" tab open,
> pressing "m" while typing the mapname will unfocus the cursor from the
> mapname field onto the server settings field

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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)


4387: Don't access switchers out of bounds (fixes #4386) r=edg-l a=def-

It's possible that a map was saved with a different amount of switchers
than it has at the moment. Happened on Jao Shooter. I'll check with
mapper if they changed the number of switchers.

<!-- 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-24 11:57:19 +00:00
def 2e34f45c50 Don't access switchers out of bounds (fixes #4386)
It's possible that a map was saved with a different amount of switchers
than it has at the moment. Happened on Jao Shooter. I'll check with
mapper if they changed the number of switchers.
2021-11-23 19:01:52 +01:00
def 82ffd1b05b Enable sv_swap, more reasonable default for timeout 2021-11-23 16:58:06 +01:00
def 36a6b39031 Fix save typing when server settings are open in editor
As reported by louis:

> while saving a mapname while having the "Server Settings" tab open,
> pressing "m" while typing the mapname will unfocus the cursor from the
> mapname field onto the server settings field
2021-11-22 18:26:14 +01:00
def b4b9016cf4 Fix enter behavior when creating new folder in editor
As reported by louis:

> pressing enter while creating a new folder in the editor (while using
> "save as") does not create the folder but instead enters the selected
> folder in the background
2021-11-22 18:12:32 +01:00
Robert Müller e37ff4db65 remove unused fs_getmtime in favor of fs_file_time 2021-11-21 11:14:18 +01:00
Robert Müller 4bb5dbc84a do fs_is_dir smarter 2021-11-21 11:14:11 +01:00
Robert Müller b96fc7479e use str_format, improve code format 2021-11-21 10:41:57 +01:00
Robert Müller e1df7669f0 fix incorrect/inconsistent buffer sizes 2021-11-21 10:34:11 +01:00
Robert Müller c9dfbb6f45 fix unicode winsock error messages 2021-11-20 16:37:03 +01:00
bors[bot] c10b9252ca
Merge #4371
4371: No wasd moving when dialog is open (fixes #4370) r=heinrich5991 a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-20 13:52:32 +00:00
Robert Müller 00606d1e2a fix open_link with unicode on windows 2021-11-20 13:36:05 +01:00
Robert Müller 30c65dedad add UNICODE defines on windows, misc. unicode fixes 2021-11-20 12:39:52 +01:00
def bd1a2a655f No wasd moving when dialog is open (fixes #4370) 2021-11-20 10:42:28 +01:00
bors[bot] 6df701a34a
Merge #4366
4366: Add sql BindInt64 r=def- a=ChillerDragon

Comes in handy for my downstream

Follow up to https://github.com/ddnet/ddnet/pull/4334

Tested with sqlite3

## 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 if it works standalone, system.c especially
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
2021-11-19 12:40:05 +00:00
ChillerDragon 097f718190 Add sql BindInt64 2021-11-19 12:29:24 +01:00
def 26797274ba Remove duplicate name in credits 2021-11-19 10:38:36 +01:00
trml aba2c66507 Clip network first in CDragger 2021-11-19 00:42:00 +01:00
bors[bot] 5997a387d9
Merge #4358
4358: Disallow dummy option (closes #4305, #4316) r=heinrich5991 a=fokkonaut

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
2021-11-17 20:02:27 +00:00
fokkonaut b3c8eb7d2b Add forgotten allowdummy flag 2021-11-17 21:00:37 +01:00
fokkonaut 3d2df7cfc9 Disallow dummy option (closes #4305, #4316) 2021-11-17 20:35:39 +01:00
bors[bot] c5764b5ad1
Merge #4357
4357: Fix serverinfo json parser to work with system libjsonparser (fixes #4202) r=heinrich5991 a=def-

Debian, Ubuntu, Fedora are using libjsonparser without our own changes,
thus we were doing garbage.

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-17 19:27:53 +00:00
def e9ffcc3c50 Fix serverinfo json parser to work with system libjsonparser (fixes #4202)
Debian, Ubuntu, Fedora are using libjsonparser without our own changes,
thus we were doing garbage.
2021-11-17 18:26:16 +01:00
bors[bot] 5f17c5360a
Merge #4283
4283: Hopefully crash less with ASAN r=heinrich5991 a=Learath2

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] 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: Learath <learath2@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2021-11-17 13:50:48 +00:00
def fb23d4637b Add contributors 2021-11-16 18:54:07 +01:00
bors[bot] 7e9f1cc85e
Merge #4306
4306: Small optimization of EntityEx snapping r=def- a=trml

This drops sending entityex to old client versions, and for stationary pickups not in switch layer (since they don't benefit from entity ex for prediction).

It also slightly changes how m_StartTick is snapped for CLight and CGun when EntityEx is present (always sets it to 0, which could reduce network traffic slightly). However, this might cause misprediction (or invisible lights/guns) for clients who have already changed their version to 15.6, so can omit this part if wanted.

## 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 if it works standalone, system.c especially
- [ ] 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: trml <trml@users.noreply.github.com>
2021-11-16 08:07:52 +00:00
bors[bot] 8c49d20cb6
Merge #4315
4315: Use W, A, S, D to navigate in editor r=def- a=ChillerDragon

Sorah requested it 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 if it works standalone, system.c especially
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
2021-11-16 07:56:22 +00:00
def f5eaf393da Increase console backlog size from 64 KB to 1 MB
Can't even list all bot bans currently
2021-11-15 23:26:19 +01:00
bors[bot] cdfc521132
Merge #4340 #4350
4340: Add functions for packing/unpacking int/unsigned using char arrays r=heinrich5991 a=Robyt3

Add `uint_to_bytes_be` and `bytes_be_to_uint` functions from upstream and use them where applicable to reduce duplicate code.

## 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 if it works standalone, system.c especially
- [ ] 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)


4350: Fix map_extract r=heinrich5991 a=def-

Reported by cheeser0613

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [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: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: def <dennis@felsin9.de>
2021-11-15 19:33:45 +00:00
bors[bot] 0e64a6ccc9
Merge #4330
4330: Try crc for maps if sha256 isn't available (fixes #4327) r=heinrich5991 a=def-

Happens with demos cut from KoG

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-15 19:22:46 +00:00
def fef86aa26e Pass demo file when splicing (fixes #4327) 2021-11-15 15:00:31 +01:00
Robert Müller c4e2dc5c5f make opening files for reading on windows case insensitive 2021-11-13 23:16:20 +01:00
def 2b50a1e712 Fix map_extract
Reported by cheeser0613
2021-11-13 21:07:03 +01:00
Robert Müller dd3ef1577e fix steam names being cut off inside utf8 codepoints 2021-11-13 16:20:44 +01:00
Robert Müller 12699aa3e4 add functions for packing/unpacking int/unsigned using char arrays 2021-11-09 22:19:32 +01:00
bors[bot] 0443a3ef65
Merge #4341
4341: Make laser doors show correctly when spectating other players r=def- a=trml

Makes the server send the switch state of other players while spectating others, otherwise the switch state of your own player (including when spectating in freeview).

Also changed the client a little to both handle situations where the server only sends one SWITCHSTATE netobject (then it just uses that team) or all (then it chooses the team that maintains the above behavior). I'm not sure if the latter would really be useful (but since the netobject contains a team it would be possible to do so).

## 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 if it works standalone, system.c especially
- [ ] 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: trml <trml@users.noreply.github.com>
2021-11-09 08:40:52 +00:00
trml 57387b5965 Fix switch state when spectating other players 2021-11-08 23:51:28 +01:00
bors[bot] 9bd3bc8480
Merge #4334
4334: Add GetInt64 r=def- a=ChillerDragon

Comes in handy for my downstream

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-11-08 16:33:25 +00:00
def 114acb4887 Version 15.6.2 2021-11-08 17:08:52 +01:00
bors[bot] 455ee32754
Merge #4337
4337: Fix DbgDummy check being at the wrong place r=def- a=heinrich5991

Fixes #4325.

## 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 if it works standalone, system.c especially
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-11-08 15:11:43 +00:00
bors[bot] 959e65d82f
Merge #4326
4326: Fix spacing in HUD settings for 5:4 resolution r=heinrich5991 a=def-

Before:
![screenshot-20211107@112309](https://user-images.githubusercontent.com/2335377/140641210-4e1ba689-4e67-4b1d-a3fc-330dd5cc6218.png)
Now:
![screenshot-20211107@112758](https://user-images.githubusercontent.com/2335377/140641264-84b9b16e-a889-40c2-8b72-87ccce3acf8f.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 if it works standalone, system.c especially
- [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: def <dennis@felsin9.de>
2021-11-07 23:49:21 +00:00
heinrich5991 210b3d1fb2 Make control flow not depend on preprocessor macros 2021-11-08 00:33:35 +01:00
ChillerDragon de2f820c90 DbgDummy check belongs to check ingame not to sql 2021-11-08 00:33:35 +01:00
bors[bot] ac3d9d0c9a
Merge #4335
4335: Escape skin name when downloading (fixes #4333) r=Jupeyy a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-07 18:03:57 +00:00
def ce10e29351 Escape skin name when downloading (fixes #4333) 2021-11-07 17:01:50 +01:00
ChillerDragon 9f89a1296a Add GetInt64 2021-11-07 16:55:32 +01:00
def 5acf6e77da Fix spacing in HUD settings for 5:4 resolution 2021-11-07 11:39:22 +01:00
trml 8db53f2a03 Fix sort comparator 2021-11-07 11:00:48 +01:00
bors[bot] 15319a3e50
Merge #4321
4321: Improve performance of `SnapFindItem` for extended item types r=Jupeyy a=heinrich5991

Look up the internal type of the searched-for UUID type once, and then
just do integer comparisons to find the item.

CC #4300

<!-- 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 if it works standalone, system.c especially
- [ ] 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>
2021-11-07 02:05:49 +00:00
bors[bot] cc96d90ecb
Merge #4312
4312: Don't access out of bounds in linereader (fixes #4308) r=heinrich5991 a=def-

If someone wants to look more closely, maybe there is a better fix

<!-- 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-07 01:29:53 +00:00
def 030163b1d9 Don't access out of bounds in linereader (fixes #4308) 2021-11-07 01:10:34 +01:00
bors[bot] 66fdc39f9c
Merge #4313
4313: Use uint64_t for network stats (fixes #4309) r=heinrich5991 a=def-

Doesn't overflow so quickly, if it overflows has deterministic behavior
at least.

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-07 00:06:52 +00:00
heinrich5991 b5c09b9c10 Improve performance of SnapFindItem for extended item types
Look up the internal type of the searched-for UUID type once, and then
just do integer comparisons to find the item.

CC #4300
2021-11-07 01:02:20 +01:00
bors[bot] 70607b4094
Merge #4311
4311: Fix crash in CDragger (fixes #4307) r=Jupeyy 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-06 23:54:09 +00:00
Jupeyy d0b634216c Don't set cursor on empty text 2021-11-06 23:34:44 +01:00
def 724fbffaf0 Use uint64_t for network stats (fixes #4309)
Doesn't overflow so quickly, if it overflows has deterministic behavior
at least.
2021-11-06 23:32:54 +01:00
def e13987bdd3 Fix crash in CDragger (fixes #4307) 2021-11-06 20:07:12 +01:00
bors[bot] e1a07e9294
Merge #4300
4300: Don't call uuid lookup, if the expected type isn't an uuid extended type anyway r=heinrich5991 a=Jupeyy



Most performance loss currently comes from the simple fact that lookupuuid is slow.
This addresses the problem by making sure its only called for net messages, that are extended anyway

`@trml` or `@heinrich5991` can you check if that makes sense without breaking something?

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-11-06 18:34:44 +00:00
Jupeyy d4dd3e6969 Use delete[] for m_pSwitchers 2021-11-06 18:12:07 +01:00
ChillerDragon b5d09ddb6e Use W, A, S, D to navigate in editor 2021-11-06 16:48:25 +01:00
def 146d1d0173 Version 15.6.1 2021-11-06 13:13:51 +01:00
trml ae8ccdf97a Don't send entityex to old clients or for stationary pickups 2021-11-06 12:13:42 +01:00
bors[bot] 8ecb3646ac
Merge #4304
4304: Support unicode filenames on windows with pnglite (fixes #4301) r=Jupeyy a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-05 17:05:01 +00:00
def ef5e2ecd93 Support unicode filenames on windows with pnglite (fixes #4301) 2021-11-05 18:02:34 +01:00
def 4ddb553355 Fix snd_chat and snd_team_chat (fixes #4302) 2021-11-05 17:00:39 +01:00
bors[bot] e73d1ef286
Merge #4295
4295: Remove upper resolution bound r=edg-l a=Jupeyy

fixes #4291
## 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 if it works standalone, system.c especially
- [ ] 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>
2021-11-05 06:52:45 +00:00
Robert Müller 385481462e fix fs_chdir with unicode on windows 2021-11-04 21:35:46 +01:00
Robert Müller 83d8e2bf7f fix fs_getcwd with unicode on windows 2021-11-04 21:22:17 +01:00
Robert Müller 3df3feb024 fix fs_makedir and fs_storage_path with unicode on windows 2021-11-04 21:20:36 +01:00
Jupeyy 8eefc0a656 Don't call uuid lookup, if the expected type isn't an uuid extended type anyway 2021-11-04 20:50:05 +01:00
Jupeyy 9f9427e8e9 Remove upper resolution bound 2021-11-04 16:46:40 +01:00
bors[bot] 9cb30a8c66
Merge #4287
4287: sv_plasma_per_sec 0 => disable firing r=Jupeyy 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-04 13:45:23 +00:00
def 1bb21e1635 Version 15.6 2021-11-04 14:28:32 +01:00
fokkonaut ae6bb9763d Fix characters disappearing (fixes #4285) 2021-11-04 14:15:24 +01:00
def c96f67ce72 maybe_unused with older compilers 2021-11-04 10:59:25 +01:00
def 5b5afe2b4a GET_SIZE -> MACRO_ALLOC_GET_SIZE 2021-11-04 10:50:39 +01:00
def 5413041104 sv_plasma_per_sec 0 => disable firing 2021-11-03 17:21:51 +01:00
Learath 2c7a8bcb73 Pad to 8b boundary 2021-11-03 16:10:40 +01:00
bors[bot] 82c7b20001
Merge #4286
4286: Don't divide by 0 with sv_plasma_per_sec r=edg-l a=def-

Thread 1 "DDNet-Server" received signal SIGFPE, Arithmetic exception.
0x000055555560d65f in CGun::Tick (this=0x55555583b440) at /media/ddnet/src/game/server/entities/gun.cpp:109
109		if(m_LastFire + Server()->TickSpeed() / g_Config.m_SvPlasmaPerSec <= Server()->Tick())

<!-- 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-03 14:16:27 +00:00
def 469e6ba1af Quick fix quick fix 2021-11-03 15:13:47 +01:00
def a541894d59 Don't divide by 0 with sv_plasma_per_sec
Thread 1 "DDNet-Server" received signal SIGFPE, Arithmetic exception.
0x000055555560d65f in CGun::Tick (this=0x55555583b440) at /media/ddnet/src/game/server/entities/gun.cpp:109
109		if(m_LastFire + Server()->TickSpeed() / g_Config.m_SvPlasmaPerSec <= Server()->Tick())
2021-11-03 14:57:31 +01:00
def 63c4617b9e Quick fix: entity id != player id 2021-11-03 09:15:48 +01:00
def 45827bce80 Simplify 2021-11-03 01:06:15 +01:00
bors[bot] fd6b26fb5c
Merge #4284
4284: Reset selection, if gui element was changed outside of DoEditBox r=def- a=Jupeyy

Changing ui element by hot keys was not visible to DoEditBox, and thus didn't act like selection params were resetted

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-11-02 23:51:09 +00:00
Learath 066467f742 Ugly but more portable 2021-11-03 00:51:03 +01:00
Jupeyy 6a98fd163b Reset selection, if gui element was changed outside of DoEditBox 2021-11-03 00:46:36 +01:00
Learath 216bf45030 Hopefully crash less with ASAN 2021-11-03 00:25:02 +01:00
bors[bot] 259155cb27
Merge #4282
4282: Fix heap-use-after-free in OnMessage (fixes #4279) 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-02 23:10:11 +00:00
def e410315772 Fix heap-use-after-free in OnMessage (fixes #4279) 2021-11-03 00:08:58 +01:00
bors[bot] 97f227b605
Merge #4281
4281: CVariableInt: Limit to 31 bits to fit into int (fixes #4280) 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-11-02 22:42:21 +00:00
def b3984affc4 CVariableInt: Limit to 31 bits to fit into int (fixes #4280) 2021-11-02 23:37:26 +01:00
def 65655975bc Try to fix CDragger's heap-use-after-free (fixes #4277) 2021-11-02 17:09:25 +01:00
Jupeyy 9a0f16b55b Add exception id to TeamKill 2021-11-01 16:49:14 +01:00
bors[bot] 76b519b856
Merge #4270
4270: Try to catch #4240 in action r=def- a=Learath2

<!-- What is the motivation for the changes of this pull request -->
This allocates characters dynamically so hopefully asan will point out the use-after-free.

## 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 if it works standalone, system.c especially
- [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: Learath <learath2@gmail.com>
2021-11-01 15:16:08 +00:00
def bc180060a5 Update events description (fixes #4269) 2021-10-31 23:31:15 +01:00
Learath ee10debfe5 Try to catch #4240 in action 2021-10-31 16:18:00 +01:00
Jupeyy cc87d49c9b Reset text color after kill messages are created 2021-10-29 00:11:21 +02:00
Jupeyy 5da25cd935 Make some variables atomic, that are read from the main thread 2021-10-28 13:53:26 +02:00
Jupeyy 141ce9e088 Protect various variables for the sound class 2021-10-28 13:53:26 +02:00
Jupeyy 86319303e8 Put buffer under the mutex 2021-10-28 13:53:26 +02:00
bors[bot] 06a155a40d
Merge #4258
4258: Fix data race in backend_sdl r=def- a=Jupeyy


## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-28 09:34:23 +00:00
def e1f131b068 Allow zooming any distance in editor
as requested by Knuski
2021-10-28 10:14:30 +02:00
Jupeyy 85b0dcdbd5 Fix data race in backend_sdl 2021-10-28 00:52:06 +02:00
trml 4a8f18c322 Use correct (larger) m_NumSwitchers bound 2021-10-26 16:16:34 +02:00
fokkonaut 5d86646985
Fix pickup network clipping 2021-10-26 15:34:00 +02:00
bors[bot] a9bdaefde7
Merge #4251
4251: Add inp_translated_keys (fixyes #4241) r=Jupeyy a=def-

fixes #4241

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-26 12:50:13 +00:00
bors[bot] 5df2febd58
Merge #4245
4245: Further fixes for cpu/zoom on large maps with entityex r=def- a=trml

Attempt to fix #4244

Added network clipping to entity ex for projectiles and pickups, and made snapping of gamecontroller happen before gameworld (as suggested in #4236), which should help when zooming out on large maps in general (where the number of entities exceeds the maximum number of snap items).

Also added bounds checks for switchers in the client.

## 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 if it works standalone, system.c especially
- [ ] 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: trml <trml@users.noreply.github.com>
2021-10-26 09:50:51 +00:00
Dennis Felsing 4894b51c94 Add inp_translated_keys (fixyes #4241) 2021-10-26 11:40:53 +02:00
bors[bot] 3adadd039e
Merge #4250
4250: Fix mouse select position in console when using different page r=def- a=Jupeyy

fixes #4246

Also noticed if you enter so much text that console input goes into the second line, it will move the whole console up, but i disabled selection in this case for now, because don't want to redesign the whole console rn and is a real edge case anyway.

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-26 09:25:17 +00:00
Jupeyy 4af9bc7123 Fix mouse select position in console when using different page 2021-10-26 00:16:52 +02:00
bors[bot] 77dcf023a9
Merge #4238 #4249
4238: Make downstream merges easier r=def- a=ChillerDragon

Untested

4249: Using unsuper does not give an advantage r=def- a=ChillerDragon

Count runs that used "unsuper" as legal finishes.

Co-authored-by: Chiller Dragon <chillerdragon@gmail.com>
2021-10-25 21:59:21 +00:00
Chiller Dragon 2c72112eca
Using unsuper does not give an advantage 2021-10-25 22:06:16 +02:00
trml e2dbba3146 Network clipping for entityex in CPickup and CProjectile, snap gamecontroller before gameworld, bound checks for switchers in client 2021-10-25 02:34:28 +02:00
Jupeyy a34c094fb2 Remove pure greyscale colors 2021-10-24 01:54:18 +02:00
Jupeyy f909f612f0 Use default color, if print color is white 2021-10-24 01:48:38 +02:00
Jupeyy c7ae79aec5 Minimal changes from mouse state change: fix editor & input 2021-10-23 14:24:52 +02:00
Jupeyy 0d17665137 Revert "Add new mouse state"
This reverts commit e4cb348db2.
2021-10-23 13:48:21 +02:00
Jupeyy a1ef18e059 Revert "Remove the mouse mode changes that aren't needed"
This reverts commit 1a917b0aae.
2021-10-23 13:48:04 +02:00
Jupeyy 5dbc6416d1 Revert "Still clear pending mouse motion"
This reverts commit 2c565a33ab.
2021-10-23 13:47:51 +02:00
Chiller Dragon c185e75403
Make downstream merges easier 2021-10-23 11:03:55 +02:00
trml 676d6e41aa Snap players first to ensure they are always sent 2021-10-22 00:40:20 +02:00
trml 85a99d174d Preprocess snap items to make getting EntityEx faster 2021-10-22 00:40:17 +02:00
trml 2964c1b4c4 Use network clipping for EntityEx 2021-10-21 22:46:45 +02:00
murpi c5b1d15452 Update server.cpp 2021-10-20 20:26:44 +02:00
bors[bot] 4601f7500e
Merge #4232
4232: Still clear pending mouse motion r=def- a=Jupeyy

Same as #3932 ... again :/

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-19 21:30:32 +00:00
Jupeyy 2c565a33ab Still clear pending mouse motion 2021-10-19 23:18:44 +02:00
def 663eea9cab Fix pasting crash in edit box (fixes #4230)
Don't allocate string with -1 size
2021-10-19 13:49:33 +02:00
Robert Müller fbda0468c6 fix exception in GetAnnouncementLine with empty list 2021-10-17 22:53:56 +02:00
bors[bot] 8ffc7967f8
Merge #4225
4225: Fix segfault when joining team (fixes #4224) r=Zwelf a=def-

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-10-17 19:12:05 +00:00
bors[bot] 37801cbf1d
Merge #4218
4218: Set VERSION_DDNET_SWITCH for upcoming release r=Jupeyy 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-10-17 17:41:29 +00:00
def a269671738 Fix segfault when joining team (fixes #4224) 2021-10-17 19:27:38 +02:00
Jupeyy 1a917b0aae Remove the mouse mode changes that aren't needed 2021-10-16 23:56:40 +02:00
bors[bot] 1e5e392f70
Merge #4222
4222: Fix detect.h r=def- a=Jupeyy

broke by 
3b1c074842 (diff-86d59021cb4561b3911602552aed980edc3ddf8b4846d5e59f09b3e863fff8e5L182)

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-16 21:20:18 +00:00
Jupeyy 66947b70b7 Fix detect.h 2021-10-16 21:16:47 +02:00
def 206585e885 Fix notify on xmonad
I don't get a notification otherwise, not sure if this is the better
default or we need an option
2021-10-16 19:37:53 +02:00
def 87f29d26ce Set VERSION_DDNET_SWITCH for upcoming release 2021-10-16 18:58:33 +02:00
bors[bot] fce6776c38
Merge #4095 #4176
4095: [Concept] Add new mouse state (ingame mouse) r=def- a=Jupeyy

This would remove ui_mousesense and use the desktop cursor position instead for menus and editor
This would also fix the editor cursor to not move faster than in menus.
That's probably how most games would handle menus, instead of using relative mouse mode
And this would work for touch inputs.

The normal gameplay relative mouse is ofc NOT affected by any kind

Opinions?

Missing:
- [x] m_MouseSlow in menus
- [x] Make desktop cursor invisible
- [x] Some components that use ui mouse
- [x] Remove focus in/out relative mouse state changes, fixed with next SDL version


## 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 if it works standalone, system.c especially
- [ ] 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)


4176: Entity switch prediction r=def- a=trml

Adds the prediction for pickups and projectiles (based on #4108)

For blinking entities (deactivated by switch) I also used the extended info to make the blinking effect happen client-side. So instead of the server omitting the projectile/pickup from the snapshot every N ticks (which prevented some things like explosive bullets from being predicted correctly), the server will keep sending the item and let the client decide how to show it.

Added doors as well, and changed how they are sent (and rendered) in a similar way (by always sending both endpoints and using a fixed m_StartTick instead of updating it every tick).

An idea was that this could potentially reduce network traffic a bit (in addition to helping with prediction), especially for stationary items that are rarely/never have to be updated (doors and pickups).

This makes CItems::OnRender a bit more complex, and it could perhaps be cleaned up some way (either using something like CProjectileData, or by moving more of the logic into RenderProjectile/Laser/Pickup).

Some things missing:
- Add more entities (draggers, light, gun)
- Entities are not correctly shown when in super (e.g. doors are shown as closed, and should be open)

## 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 if it works standalone, system.c especially
- [ ] 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: trml <trml@users.noreply.github.com>
2021-10-16 16:38:18 +00:00
bors[bot] f8d634f8d7
Merge #4215
4215: Old chat wrapping for old chat mode r=def- a=Jupeyy


![screenshot_2021-10-14_16-50-34](https://user-images.githubusercontent.com/6654924/137342505-ea0a56b6-24cd-4163-8ad9-7a8f03b2671e.png)

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-16 16:27:48 +00:00
Jupeyy f20965257f Old chat wrapping for old chat mode 2021-10-15 14:31:52 +02:00
Edgar 5539116792
fix style 2021-10-15 12:17:14 +02:00
Edgar 8810531065
remove missused volatile 2021-10-15 12:15:39 +02:00
trml 71e5b7ed3a Fix switch state for super, cleanup door snapping, add dragger/gun/light 2021-10-14 22:59:39 +02:00
Jupeyy 3b333ea063 Lower worst/best case frame time calculations 2021-10-08 00:23:24 +02:00
Jupeyy ad1b45d3a6 Add missing intialize values 2021-10-07 21:18:55 +02:00
Jupeyy e4cb348db2 Add new mouse state 2021-10-07 16:48:25 +02:00
bors[bot] caf931f8a7
Merge #4200
4200: teehistorian: Test statefulness of PLAYER_TEAM and TEAM_PRACTICE r=def- a=heinrich5991

<!-- 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
- [x] Written a unit test if it works standalone, system.c especially
- [ ] 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>
2021-10-06 16:10:22 +00:00
heinrich5991 1bffc6ebfc teehistorian: Test statefulness of PLAYER_TEAM and TEAM_PRACTICE 2021-10-06 18:06:19 +02:00
heinrich5991 fbb98c8801 teehistorian: Test no-op function calls as well 2021-10-06 17:33:22 +02:00
bors[bot] 73de789e90
Merge #4188
4188: Add option to highlight self in kill messages r=heinrich5991 a=Azorlogh

Motivation: #4186

List of changes:
- Add options clKillMessageHighlightSelf, clKillMessageNormalColor, clKillMessageHighlightColor
- Rework HUD panel in settings

![hud_0](https://user-images.githubusercontent.com/17968319/135732345-b8152c74-f754-4722-9b60-46a1ba7cc9c8.png)

![hud_1](https://user-images.githubusercontent.com/17968319/135732346-814a918b-1828-4860-a3c7-372869b79575.png)

![in_game](https://user-images.githubusercontent.com/17968319/135732347-6e9cf148-29b8-4fc4-8dba-647e049f961a.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] Written a unit test if it works standalone, system.c especially (not standalone)
- [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: Azorlogh <bott.alix@gmail.com>
2021-10-06 15:27:25 +00:00
bors[bot] 43e69905bc
Merge #4157
4157: invalidate texture when unloading a texture. r=heinrich5991 a=ChillerDragon

Closes https://github.com/teeworlds/teeworlds/issues/1450

(cherry picked from commit 23a1b80f60)

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: oy <Tom_Adams@web.de>
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-10-06 15:16:00 +00:00
bors[bot] 121c6d16f6
Merge #3879 #4079
3879: Use SDL_FlashWindow to request user's attention r=heinrich5991 a=Jupeyy

We should soon update to SDL 2.0.16 for our bundled libs, but don't merge before this happened.

This drops the remaining X11 dependency.

We should then also use GLEW with EGL for official builds for easy native wayland support(which i discussed before already)

## 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 if it works standalone, system.c especially
- [ ] 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)


4079: Make teehistorian easier to reproduce r=heinrich5991 a=Zwelf

I've tested it ingame, but still have to make sure, that the ordering of the teehistorian messages are right. I would be really happy if we could land this before changing team joining logic (#4006 or /practice logic, but there isn't a pr for this yet), but I would like to make sure that the change is correct.

## Checklist

- [x] Tested the change ingame
- [ ] Tested in combination with possibly related configuration options
- [x] Written a unit test if it works standalone, system.c especially
- [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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Zwelf <zwelf@strct.cc>
2021-10-06 14:52:39 +00:00
bors[bot] 353f265e77
Merge #4197 #4198
4197: Properly export antibot DLL symbols on Windows, this time for real r=Jupeyy a=heinrich5991

0750ae0fbd was missing the function
prototypes that used `ANTIBOTAPI`.

<!-- 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 if it works standalone, system.c especially
- [ ] 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)


4198: Always support resizing, remove gfx_resizable r=Jupeyy 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-10-06 14:41:24 +00:00
Jupeyy ce9a962030 Rename VERSION to VERSION.txt 2021-10-06 16:13:36 +02:00
def ca95a135ce Always support resizing, remove gfx_resizable 2021-10-05 19:32:09 +02:00
Azorlogh 7552bfd05c set defaut highlight color in kill message to white 2021-10-05 18:52:58 +02:00
Azorlogh 40ab93c592 capitalize Color & remove superfluous toggle 2021-10-05 18:48:08 +02:00
heinrich5991 bce74cd1c3 Properly export antibot DLL symbols on Windows, this time for real
0750ae0fbd was missing the function
prototypes that used `ANTIBOTAPI`.
2021-10-05 17:38:58 +02:00
Azorlogh 72ab66997a use m_LocalClientID instead of m_pLocalInfo->m_ClientID 2021-10-05 14:09:31 +02:00
Azorlogh 5e98fa93b9 null check pLocalInfo 2021-10-05 11:25:50 +02:00
bors[bot] b2efcb8ba4
Merge #4196
4196: Fix fs_removedir and fs_remove with unicode on windows r=Jupeyy a=Robyt3

Fixes `fs_removedir` and `fs_remove` to work with unicode names on Windows.

## 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 if it works standalone, system.c especially
- [ ] 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 <robert.mueller@uni-siegen.de>
2021-10-04 19:08:42 +00:00
Robert Müller 2791f1e127 fix fs_removedir and fs_remove with unicode on windows 2021-10-04 20:11:50 +02:00
bors[bot] 26d54f8c8c
Merge #4171
4171: Add basic selection support for ui ex edit boxes r=def- a=Jupeyy

This changes the hotkey for "exclude" to CTRL + SHIFT + X, because else it collides with Cutting strings out of a selection

This is defs not perfect, it basically ignores keyboard keys that could also alter selection (e.g. shift + right) but i didnt want to break the IME stuff, bcs i don't understand it

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-10-04 18:07:09 +00:00
Jupeyy fd68cc3a05 Add basic selection support for ui ex edit boxes 2021-10-04 19:58:25 +02:00
bors[bot] 9a16555058
Merge #4195
4195: Try to fix unicode race demos (fixes #4192) r=Jupeyy a=def-

by making fs_rename work on Windows with Unicode chars

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
2021-10-04 17:55:47 +00:00
Jupeyy 3c1e0fe663 Use SDL_FlashWindow to request user's attention 2021-10-04 19:21:36 +02:00
fokkonaut 83f4472d00 Fix wrong output for unmute 2021-10-04 17:53:14 +02:00
def 8270266bcf Try to fix unicode race demos (fixes #4192)
by making fs_rename work on Windows with Unicode chars
2021-10-04 17:50:12 +02:00
def e8bc6fcb47 Add notes for settings only available
with specific compile options or on specific builds

Also applies to https://ddnet.tw/settingscommands/
2021-10-03 12:23:31 +02:00
Azorlogh 96f25d32cb fix default colors 2021-10-02 23:25:36 +02:00
Azorlogh bb8d746bff remove unneeded variable 2021-10-02 23:21:34 +02:00
Azorlogh 07b85a286b highlight self in kill messages 2021-10-02 23:15:59 +02:00
heinrich5991 5dae776696 Set the maximum connection trials to 5 per 20s
It was previously 4 per 20s which can cause problems with the default
reconnect delay of 5s when the server is full.
2021-10-02 18:27:26 +02:00
bors[bot] 560d2ad1a3
Merge #4166
4166: Update default tune zone, when no local character is alive and tune zones don't exist r=heinrich5991 a=Jupeyy

fixes #4140

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-27 20:55:07 +00:00
bors[bot] a53cde8b4c
Merge #4183
4183: Fix nullptr when using Config() in components r=heinrich5991 a=ChillerDragon

https://github.com/ddnet/ddnet/pull/3993

## 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 if it works standalone, system.c especially
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
2021-09-27 19:56:53 +00:00
ChillerDragon a5ae3bf869 Fix nullptr when using Config() in components 2021-09-27 21:37:20 +02:00
BloodWod-513 7dc228471e add ctrl+backspace for ingame console 2021-09-27 18:46:44 +05:00
bors[bot] f820702522
Merge #4180
4180: Use constructor consistently for colors r=def- a=Robyt3

This changes all color instantiations to consistently use the constructor instead of an initializer list.

## 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 if it works standalone, system.c especially
- [ ] 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 <robert.mueller@uni-siegen.de>
2021-09-25 08:15:42 +00:00
Robert Müller 6ee5dd24a5 use constructor consistently for colors 2021-09-25 09:50:11 +02:00
bors[bot] 3b45d8a28f
Merge #4179
4179: Fix text upload call, make invalid calls visible r=def- a=Jupeyy



## 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-25 07:48:06 +00:00
Jupeyy 451a087bde Fix text upload call, make invalid calls visible 2021-09-25 01:58:28 +02:00
Robert Müller 3d412646a0 add CUI::MapScreen convenience method 2021-09-22 21:48:55 +02:00
trml f0bd4cf5fa Send EntityEx for doors as well 2021-09-19 20:48:50 +02:00
trml 8448f9ef04 Predict switch projectiles and pickups, make blinking effect client-side 2021-09-19 14:14:00 +02:00
Chairn 635485de90 Fixed typo in variable name 2021-09-18 20:41:01 +02:00
Jupeyy 5dee9a3833 Always update default tune zone 2021-09-15 23:27:16 +02:00
bors[bot] 79dbbe2ee2
Merge #4151
4151: Copy ingame console like in ATH r=def- a=BloodWod-513

The idea is taken from the implementation of this in ATH client
<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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>
Co-authored-by: BloodWod-513 <dayn_2013@mail.ru>
2021-09-15 21:22:04 +00:00
bors[bot] f2dd9a0ab3
Merge #4167
4167: Update world config even if the local character is dead r=Jupeyy a=heinrich5991

Interesting for weapons etc.

<!-- 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-15 18:33:43 +00:00
bors[bot] b454990b5f
Merge #4168
4168: Clear game info on connect r=Jupeyy a=heinrich5991

Previously, the old game info persevered into the next server.

<!-- What is the motivation for the changes of this 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-15 18:06:45 +00:00
Zwelf c6ef672985 Reset team of player leaving to 0 in teehistorian 2021-09-15 20:03:14 +02:00
BloodWod-513 4317c43c6b Console copy string 2021-09-15 19:47:01 +02:00
Jupeyy 08881e8a6f Refactor text renderer 2021-09-15 19:46:58 +02:00
Zwelf e9dec007b2 Address review to make code more consistent 2021-09-15 17:31:35 +02:00
heinrich5991 bebc417e99 Ensure a snap is evaluated before the world is rendered the first time 2021-09-15 16:58:33 +02:00
heinrich5991 b7fe9b112c Clear game info on connect
Previously, the old game info persevered into the next server.
2021-09-15 16:22:50 +02:00
heinrich5991 ca2d85107e Update world config even if the local character is dead
Interesting for weapons etc.
2021-09-15 16:05:30 +02:00
heinrich5991 ac50cd1fe7 Split long system message into two lines
Thanks to @murpii for noticing the long line.
2021-09-15 14:47:20 +02:00
ChillerDragon de4e1ea644 Merge UnloadTexture with UnloadTextureNew 2021-09-15 13:19:54 +02:00
bors[bot] a49082d510
Merge #4164
4164: Use gametick as int for emoticon calculation, add the fraction sepera… r=def- a=Jupeyy

I had a wrong parentheses, which resulted in the calculation using floats instead of double, which isnt nice with high ticks, bcs of the float value range

Then I decided to use the gametick as int, bcs in the if before the calc it compared the float against -1, which isnt really nice anyway

So I split the vars, which then doesnt require double

Also simplified the math for readability

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-15 06:51:21 +00:00
Jupeyy 9deac14667 Use gametick as int for emoticon calculation, add the fraction seperately 2021-09-15 01:06:30 +02:00
Zwelf eacd314701 Move team and practice mode recording to the beginning of the tick 2021-09-14 22:33:09 +02:00
Zwelf 81f4263428 Record team practice mode making replay easier 2021-09-14 22:10:43 +02:00
Alexander Akulich 895a0b3451 CServer::ProcessClientPacket(): Adjust the debug message buffer size
We allocated 512 bytes to dump up to 32 data bytes in a hex form.
According to the str_hex() implementation, we need three bytes per the
source data byte (a byte is represented as a two-digit hexadecimal number
with appended space char) plus the null-termination.

We actually could re-use the last space char for the null, but it is not
implemented in str_hex(). Keep this logic as-is.

The stack-allocated buffer size reduced from 512 to 97 bytes.
2021-09-14 20:59:29 +03:00
Alexander Akulich 92abe8d545 Use str_hex() for CServer::ProcessClientPacket() debug output 2021-09-14 20:49:53 +03:00
Jupeyy 4982f8536e Fix shift + tab selecting second last index in console, player name chat & command chat 2021-09-14 13:15:09 +02:00
Jupeyy 1e07a00c3b Refactor CUIElements 2021-09-14 00:21:20 +02:00
Jupeyy 7f5ca0ffe1 Small graphic refactoring 2021-09-14 00:21:17 +02:00
trml c194c7e710 Send extended entity info 2021-09-13 22:22:02 +02:00
bors[bot] 1d9557de20
Merge #3783
3783: Further fixes for Haiku r=def- a=panos

- Haiku is Unix-like, but it still doesn't use libnotify.
- Haiku comes with its own sets of definitions for certain long variables. There's still a problem revolving around the variables, but I removed a duplicate, conflicting definition on the Haiku platform.
- Changed some definition-related logic in detect.h, because the gcc compiler in Haiku (version 8.3.0) complained about duplicate definitions. I chose to use 'unknown' rather than an empty string.

I think that I'm very close.

Co-authored-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
Co-authored-by: def <dennis@felsin9.de>
2021-09-13 19:26:25 +00:00
def b357007897 Fix clang-format 2021-09-13 21:13:39 +02:00
heinrich5991 243c1daa96 Use #include <> instead of #include "" for non-relative includes 2021-09-13 21:04:21 +02:00
Panagiotis Vasilopoulos cc49273cb4
Fixed typo
TO BE SQUASHED LATER
2021-09-13 20:12:21 +02:00
bors[bot] 18eabe0038
Merge #4158
4158: Make emoticons smoother r=heinrich5991 a=Jupeyy

It's still not 100% the same as with high bandwidth, but atleast animation wise it should look the same.
The client doesn't predict if an emote actually is triggered, so it still only triggeres them every second tick without high bandwidth.

~Since this changes demo playing quite a bit, it should defs be tested~(not really xd)

fixes #4156

## 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 if it works standalone, system.c especially
- [ ] 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>
2021-09-13 15:51:04 +00:00
Jupeyy c06edd9aeb Update server list silently 2021-09-13 16:50:40 +02:00
heinrich5991 91b60e6981 Make emoticons smoother 2021-09-13 16:26:48 +02:00
Panagiotis Vasilopoulos 3b1c074842
Further fixes for Haiku
- Haiku is Unix-like, but it still doesn't use libnotify.
- Haiku comes with its own sets of definitions for certain long variables.
  There's still a problem revolving around the variables, but I removed a
  duplicate, conflicting definition on the Haiku platform.
- Changed some definition-related logic in detect.h, because the gcc compiler
  in Haiku (version 8.3.0) complained about duplicate definitions. I chose to
  use 'unknown' rather than an empty string on one occasion.
- Changed size of m_aLastSoundPlayed[CHAT_NUM] in
  `src/game/client/components/chat.cpp` due to an undocumented/undiscovered bug
  in Haiku.
2021-09-13 15:29:32 +02:00
ChillerDragon d60e330085 Pointer naming convention in UnloadTexture 2021-09-13 14:55:21 +02:00