Commit graph

3136 commits

Author SHA1 Message Date
def 5be5f1032a Fix stack-buffer-overflow in Whisper (fixes #4400) 2021-11-27 20:58:06 +01:00
def 8dce8d0a8c /swap fix: swap started/finished information
Thanks to 冷落 for report
2021-11-25 23:48:29 +01: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 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] 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] 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
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
def e13987bdd3 Fix crash in CDragger (fixes #4307) 2021-11-06 20:07:12 +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] 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
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
Learath 066467f742 Ugly but more portable 2021-11-03 00:51:03 +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
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
Learath ee10debfe5 Try to catch #4240 in action 2021-10-31 16:18:00 +01:00
fokkonaut 5d86646985
Fix pickup network clipping 2021-10-26 15:34:00 +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
trml 676d6e41aa Snap players first to ensure they are always sent 2021-10-22 00:40:20 +02:00
trml 2964c1b4c4 Use network clipping for EntityEx 2021-10-21 22:46:45 +02:00
def a269671738 Fix segfault when joining team (fixes #4224) 2021-10-17 19:27:38 +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
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
heinrich5991 1bffc6ebfc teehistorian: Test statefulness of PLAYER_TEAM and TEAM_PRACTICE 2021-10-06 18:06:19 +02: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
fokkonaut 83f4472d00 Fix wrong output for unmute 2021-10-04 17:53:14 +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
Zwelf c6ef672985 Reset team of player leaving to 0 in teehistorian 2021-09-15 20:03:14 +02:00
Zwelf e9dec007b2 Address review to make code more consistent 2021-09-15 17:31:35 +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
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