Raised This Month: $12 Target: $400
 3% 

Disconnected players func_tank fix (HLDS-bug crash fix too)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development       
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 07-28-2019 , 10:54   Disconnected players func_tank fix (HLDS-bug crash fix too)
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (func_tank_fix_disconnect.sma - 284 views - 1.4 KB)

Last edited by baneado; 08-11-2021 at 07:03.
baneado is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 07-28-2019 , 12:27   Re: Disconnected players func_tank fix (crash fix too)
Reply With Quote #2

Is this needed on RegameDLL too ?
__________________
JusTGo is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 07-28-2019 , 13:08   Re: Disconnected players func_tank fix (crash fix too)
Reply With Quote #3

For those who are not coding: can you give examples when this funktion is needed, like plugins, maps or in what conditions?
__________________

Mordekay is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 07-28-2019 , 13:27   Re: Disconnected players func_tank fix (crash fix too)
Reply With Quote #4

Quote:
Originally Posted by Mordekay View Post
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 View Post
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.

Last edited by baneado; 07-28-2019 at 15:10.
baneado is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 07-31-2019 , 17:18   Re: Disconnected players func_tank fix (crash fix too)
Reply With Quote #5

Quote:
Originally Posted by JusTGo View Post
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.
baneado is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-14-2019 , 07:52   Re: Disconnected players func_tank fix (crash fix too)
Reply With Quote #6

Quote:
Originally Posted by baneado View Post
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
__________________
JusTGo is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-01-2020 , 06:55   Re: Disconnected players func_tank fix (HLDS-bug crash fix too)
Reply With Quote #7

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

Last edited by baneado; 06-01-2020 at 07:23.
baneado is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:41.


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