AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Disconnected players func_tank fix (HLDS-bug crash fix too) (https://forums.alliedmods.net/showthread.php?t=317763)

baneado 07-28-2019 10:54

Disconnected players func_tank fix (HLDS-bug crash fix too)
 
1 Attachment(s)
Recently it has been discovered a crash bug on HLDS related with func_tank entities.
Here it's the issue at official Half-Life Github: https://github.com/ValveSoftware/halflife/issues/2594

The issue is related to player disconnection while using a func_tank entity.

Is this issue affecting me?
Only if your server is using a map that has a func_tank entity.

It's an entity used on too many jailbreak maps.
For example: the six canyons at jb_snow [ Screenshot ] [ Video ]

According to this comment: https://forums.alliedmods.net/showpo...76&postcount=6
It's already fixed at ReGameDLL

What's a func_tank entity?
"It simulates a gun turret that can aim and shoot things." from https://developer.valvesoftware.com/wiki/Func_tank
So, if you have a map in your server with something like this, that entity probably is a func_tank and your server it's affected by the issue.
List of entities affected and fixed by the plugin:
  • func_tank
  • func_tankmortar
  • func_tankrocket
  • func_tanklaser

Steps to reproduce both issues
First, a bug appeared. Steps to reproduce:
  1. Control a func_tank
  2. Disconnect using it
  3. Reconnect
  4. Now, if you look to the entity you have controlled previously, it follows your angles movement with the camera.
    Really a visual bug, because player can't shoot with it unless he will use it again.

Then, players can abuse this bug to cause a server crash.
We will need two different players. Steps to reproduce:
  1. Connect the two players
  2. 1st player use the func_tank
  3. Disconnect while using (1st player)
  4. Reconnect (1st player).
    Note: 1st player will be able to move the angles of the entity without using it (the visual bug mentioned above).
  5. 2nd player use the func_tank.
    Now func_tank attached to 2nd player and 1st can't move the angles of the entity.
  6. 2nd player uses retry command while using func_tank
  7. Finally crash server when player full reconnected

To protect our servers against this bug abuse, I made a plugin to fix the bug while we wait for an official fix by Valve.

Possibly someone can provide a better way to fix this bug.
Any improvement for the plugin will be welcomed.

For developers:
Plugin was tested and working well.

Changelog
Code:

v0.2 (01 june 2020)
It seems using get_pdata_int on client_disconnect sometimes server crashes on mapchange.
- Replaced client_disconnect to fakemeta disconnect forward
- Not reset m_pTank offset (anyways, don't needed?)

v0.1 (28 july 2019) - 305 views
- First release


JusTGo 07-28-2019 12:27

Re: Disconnected players func_tank fix (crash fix too)
 
Is this needed on RegameDLL too ?

Mordekay 07-28-2019 13:08

Re: Disconnected players func_tank fix (crash fix too)
 
For those who are not coding: can you give examples when this funktion is needed, like plugins, maps or in what conditions?

baneado 07-28-2019 13:27

Re: Disconnected players func_tank fix (crash fix too)
 
Quote:

Originally Posted by Mordekay (Post 2660982)
For those who are not coding: can you give examples when this funktion is needed, like plugins, maps or in what conditions?

Whatever map having a func_tank entity or similar (look the list on the first post).
It's an entity used in most of jailbreak maps.
For example: jb_snow has six canyons like func_tank

Quote:

Originally Posted by JusTGo (Post 2660976)
Is this needed on RegameDLL too ?

According to the comment on the issue: https://github.com/ValveSoftware/hal...ment-514538906

Seems that it's not fixed at rehlds or regamedll.

Anyways, test yourself. You have the steps to reproduce the visual bug and the crash.

baneado 07-31-2019 17:18

Re: Disconnected players func_tank fix (crash fix too)
 
Quote:

Originally Posted by JusTGo (Post 2660976)
Is this needed on RegameDLL too ?

Tested on a community server with ReGame and ReHLDS.

Crash seems to be fixed (don't know if server has some plugin protection, but I doubt...)
Visual bug stills present.

JusTGo 08-14-2019 07:52

Re: Disconnected players func_tank fix (crash fix too)
 
Quote:

Originally Posted by baneado (Post 2661347)
Tested on a community server with ReGame and ReHLDS.

Crash seems to be fixed (don't know if server has some plugin protection, but I doubt...)
Visual bug stills present.

Ok then i guess that bug should be fixed.

https://github.com/s1lentq/ReGameDLL_CS/pull/400

baneado 06-01-2020 06:55

Re: Disconnected players func_tank fix (HLDS-bug crash fix too)
 
Plugin updated

Code:

v0.2 (01 june 2020)
It seems using get_pdata_int on client_disconnect sometimes server crashes on mapchange.
- Replaced client_disconnect to fakemeta disconnect forward
- Not reset m_pTank offset (anyways, don't needed?)



All times are GMT -4. The time now is 06:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.