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

[L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]


Post New Thread Reply   
 
Thread Tools Display Modes
yzybb
Member
Join Date: Jul 2020
Old 05-28-2021 , 02:04   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #41

Quote:
Originally Posted by Lux View Post
no idea there could be 100 different possible reasons, trial and error removing plugins nothing else i can help you with.

This maybe the problem
https://forums.alliedmods.net/showth...31#post2393931
I suspect it may be caused by a conflict between the idle repair function of this plugins and your plugins. Do you think there is such a possibility?
yzybb is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 05-29-2021 , 02:38   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #42

To be honest, I can see this fix being expanded to preventing newly joined players taking control of "idle" bots when their human players are still transitioning.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-31-2021 , 04:26   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #43

Quote:
Originally Posted by cravenge View Post
To be honest, I can see this fix being expanded to preventing newly joined players taking control of "idle" bots when their human players are still transitioning.
The game already checks for this here if you can point to me in the game binary where it fails these checks show me.
PHP Code:
if ( pSurvivorBot )
    {
        if ( !
pSurvivorBot->SurvivorBot.m_humanSpectatorUserID
          
|| (v22 CDirector::IsHumanSpectatorValid(pDirectorpSurvivorBot), result 0, !v22) )
        {
            
CDirector::NewPlayerPossessBot(a1a2v16pDirectorpPlayerpSurvivorBot_);
            
result 1;
        }
    } 
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 05-31-2021 , 04:40   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #44

Quote:
Originally Posted by Lux View Post
The game already checks for this here if you can point to me in the game binary where it fails these checks show me.
PHP Code:
if ( pSurvivorBot )
    {
        if ( !
pSurvivorBot->SurvivorBot.m_humanSpectatorUserID
          
|| (v22 CDirector::IsHumanSpectatorValid(pDirectorpSurvivorBot), result 0, !v22) )
        {
            
CDirector::NewPlayerPossessBot(a1a2v16pDirectorpPlayerpSurvivorBot_);
            
result 1;
        }
    } 
I think this check only works for static amount of survivors but not for dynamic ones and by dynamic, I mean spawning extras when there are no other bots around. I've seen myself taking control of a new bot instead of my own whenever someone joins during transition and loads in before me.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-31-2021 , 04:54   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #45

Quote:
Originally Posted by cravenge View Post
I think this check only works for static amount of survivors but not for dynamic ones and by dynamic, I mean spawning extras when there are no other bots around. I've seen myself taking control of a new bot instead of my own whenever someone joins during transition and loads in before me.
Whatever you are using needs to set the proper data on the extra survivors CDirector::IsHumanSpectatorValid checks few things including m_humanSpectatorUserID.

m_humanSpectatorUserID should be enough for loaders to keep their bots i think.

This would have to be a different fix and not something i would put in AFK fix, transition bot handling only supports 8 characters iirc they use survivor name keyvaules to store the data.

Here is pseudo code.
PHP Code:
signed int __cdecl CDirector::IsHumanSpectatorValid(CDirector *thisSurvivorBot *a2)
{
    
SurvivorBot *v2// eax
    
int v3// edi
    
int v4// esi
    
const char *v5// eax
    
signed int result// eax
    
const char *v7// eax

    
v2 UTIL_PlayerByUserId(a2->SurvivorBot.m_humanSpectatorUserID);
    if ( 
v2 )
    {
        
v3 a2->SurvivorBot.m_humanSpectatorUserID;
        
v4 = (v2->vptr->CBaseEntity.GetPlayerName)(v2);
        
v5 SurvivorCharacterName(a2->SurvivorBot.CTerrorPlayer.m_survivorCharacter);
        
DevMsg(1"[TAKEOVER]: %s is already spectated by %s (%d)\n"v5v4v3);
        
result 1;
    }
    else
    {
        
v7 SurvivorCharacterName(a2->SurvivorBot.CTerrorPlayer.m_survivorCharacter);
        
DevMsg(1"[TAKEOVER]: %s is spectated by an invalid userid - clearing spectator id.\n"v7);
        
RemoveTransitioningPlayerRecord(a2->SurvivorBot.m_humanSpectatorUserID);
        
SurvivorBot::ResetHumanSpectator(a2);
        
result 0;
    }
    return 
result;

__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 05-31-2021 at 04:57.
Lux is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 05-31-2021 , 10:18   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #46

Quote:
Originally Posted by Lux View Post
Whatever you are using needs to set the proper data on the extra survivors CDirector::IsHumanSpectatorValid checks few things including m_humanSpectatorUserID.

m_humanSpectatorUserID should be enough for loaders to keep their bots i think.

This would have to be a different fix and not something i would put in AFK fix, transition bot handling only supports 8 characters iirc they use survivor name keyvaules to store the data.

Here is pseudo code.
PHP Code:
signed int __cdecl CDirector::IsHumanSpectatorValid(CDirector *thisSurvivorBot *a2)
{
    
SurvivorBot *v2// eax
    
int v3// edi
    
int v4// esi
    
const char *v5// eax
    
signed int result// eax
    
const char *v7// eax

    
v2 UTIL_PlayerByUserId(a2->SurvivorBot.m_humanSpectatorUserID);
    if ( 
v2 )
    {
        
v3 a2->SurvivorBot.m_humanSpectatorUserID;
        
v4 = (v2->vptr->CBaseEntity.GetPlayerName)(v2);
        
v5 SurvivorCharacterName(a2->SurvivorBot.CTerrorPlayer.m_survivorCharacter);
        
DevMsg(1"[TAKEOVER]: %s is already spectated by %s (%d)\n"v5v4v3);
        
result 1;
    }
    else
    {
        
v7 SurvivorCharacterName(a2->SurvivorBot.CTerrorPlayer.m_survivorCharacter);
        
DevMsg(1"[TAKEOVER]: %s is spectated by an invalid userid - clearing spectator id.\n"v7);
        
RemoveTransitioningPlayerRecord(a2->SurvivorBot.m_humanSpectatorUserID);
        
SurvivorBot::ResetHumanSpectator(a2);
        
result 0;
    }
    return 
result;

Ah, I see.
cravenge is offline
Proaxel
Member
Join Date: Oct 2014
Old 06-15-2021 , 16:11   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #47

The signatures this plugin uses are broken from today's L4D2 update.

Code:
L 06/15/2021 - 12:40:21: [SM] Exception reported: Failed to find 'SurvivorBot::SetHumanSpectator' signature
L 06/15/2021 - 12:40:21: [SM] Blaming: survivor_afk_fix.smx
L 06/15/2021 - 12:40:21: [SM] Call stack trace:
L 06/15/2021 - 12:40:21: [SM]   [0] SetFailState
L 06/15/2021 - 12:40:21: [SM]   [1] Line 84, D:\Github\Left-4-fix\left 4 fix\survivors\survivor_afk_fix\scripting\survivor_afk_fix.sp::OnPluginStart
L 06/15/2021 - 12:40:21: [SM] Unable to load plugin "survivor_afk_fix.smx": Error detected in plugin startup (see error logs)
Code:
SourceMod Version Information:
    SourceMod Version: 1.10.0.6502
    SourcePawn Engine: 1.10.0.6502, jit-x86 (build 1.10.0.6502)
    SourcePawn API: v1 = 5, v2 = 12
    Compiled on: Dec 18 2020 11:19:18
    Built from: https://github.com/alliedmodders/sourcemod/commit/617fb77e
    Build ID: 6502:617fb77e
    http://www.sourcemod.net/
meta version
 Metamod:Source Version Information
    Metamod:Source version 1.11.0-dev+1144
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: Aug 25 2020 06:51:26
    Built from: https://github.com/alliedmodders/metamod-source/commit/7341116
    Build ID: 1144:7341116
    http://www.metamodsource.net/
Proaxel is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 06-15-2021 , 17:35   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #48

New Windows signature:
PHP Code:
"SurvivorBot::SetHumanSpectator"
{
    
"library"    "server"
    "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x83\xBE\x24\x43\x00\x00\x00\x7E\x2A\x32\xC0\x5E\x5D\xC2\x04\x00"
                
/* ? ? ? ? ? ? 83 BE 24 43 00 00 00 7E ? 32 C0 5E 5D C2 04 00 */

Only one byte changed as well like other signatures.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-15-2021 , 19:04   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #49

Quote:
Originally Posted by cravenge View Post
New Windows signature:
PHP Code:
"SurvivorBot::SetHumanSpectator"
{
    
"library"    "server"
    "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x83\xBE\x24\x43\x00\x00\x00\x7E\x2A\x32\xC0\x5E\x5D\xC2\x04\x00"
                
/* ? ? ? ? ? ? 83 BE 24 43 00 00 00 7E ? 32 C0 5E 5D C2 04 00 */

Only one byte changed as well like other signatures.
Thanks ill get around to updating everything in due time
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-16-2021 , 05:11   Re: [L4D1 & L4D2]Survivor_AFK_Fix[Left 4 Fix][25/09/2020]
Reply With Quote #50

updated gamedata for 2.2.1.3
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Reply



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 12:31.


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