psforever / PSF-LoginServer

Emulated PlanetSide 1 world and login server by the PSForever project.
https://psforever.net
GNU General Public License v3.0
75 stars 45 forks source link

Spectator issue #1111

Closed Dethdeath closed 6 months ago

Dethdeath commented 1 year ago

Someone was spectating a fight yesterday and it caused a player to get kicked from the server. It turns out it happens when the person spectating exits spectate mode and then dies of something, like /suicide. It also seems to be timing related? I basically did /suicide right after coming out of spectate mode when testing.

nice

I used a Dragon during testing because of the damage over time, but that might not matter if it just looks at who last damaged the spectator.

Resaec commented 1 year ago

I can recreate the last hitter counting as the killer on suicide, but it will not trigger a kick for me. Is there more information?

Dethdeath commented 1 year ago

As mentioned it seems to be timing related, it took me a few tries to get kicked.

ScrawnyRonnie commented 1 year ago

There is another reason this happens and it relates to when spectator mode is enabled and when a player arrives in that zone. If someone is in spectator mode and a player arrives in the zone after they are already in spectator mode, the spectator is visible to them, but frozen in place where the spectator was when that new player arrived. Players that are already in that zone cannot see the spectator. Toggling spectator off and on fixes it for the new player. image

ScrawnyRonnie commented 1 year ago

This same thing also happens with deconstructing. Player A deconstructs. While A is on the map, player B arrives in the zone. Player B will see player A. I almost said it only happens if a player arrives in the zone after deconstruction, but it also does this if player B is far enough away on the map when player A deconstructs. Player B can travel to A and see them. image

Dethdeath commented 1 year ago

Adding this here for now, could make a separate issue later if needed.

Spectators can get into vehicles if they purchase them a certain way, they should probably just not be allowed to get into the vehicle buying queue. Here's a video:

https://github.com/psforever/PSF-LoginServer/assets/77748540/c0b27eb9-9fa8-4d5f-86e9-21cedd45f51f

After dying in a vehicle they can still move around during the respawn screen.

I also noticed that spectators get an oxygen bar when they go underwater, when it gets to 0 nothing happens. This is a really minor thing that can probably be ignored as it doesn't lead to anything bad.

ScrawnyRonnie commented 1 year ago

Prevent someone in spectator from purchasing a vehicle. Added to same logic as the purchase timer. https://github.com/psforever/PSF-LoginServer/assets/73139382/e7ce9b8a-466c-407d-897d-75474345901f

Dethdeath commented 1 year ago

Nice.