Raised This Month: $32 Target: $400
 8% 

[L4D2]About m_humanSpectatorUserID and the multiplayer plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sorallll
Senior Member
Join Date: Oct 2018
Old 01-22-2022 , 15:50   [L4D2]About m_humanSpectatorUserID and the multiplayer plugin
Reply With Quote #1

Recently, when researching multiplayer plugins, I found a problem. After obtaining the m_humanSpectatorUserID of Survivor Bot and converting it to Client Index, they seem to judge IsClientInGame and others.
sorallll is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 01-22-2022 , 15:52   Re: [L4D2]About m_humanSpectatorUserID and the multiplayer plugin
Reply With Quote #2

But the player in the transition corresponding to the Bot is detected as true IsClientConnected and IsClientInGame detected as false, which will cause the Bot of some transition players to be taken over by others
sorallll is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 01-22-2022 , 15:54   Re: [L4D2]About m_humanSpectatorUserID and the multiplayer plugin
Reply With Quote #3

Maybe the player's equipment role after transition is messed up, and the multiplayer plug-in also has a certain reason
sorallll is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 01-22-2022 , 16:00   Re: [L4D2]About m_humanSpectatorUserID and the multiplayer plugin
Reply With Quote #4

This is the judgment of the game itself on taking over the Bot
PHP Code:
 if ( pSurvivorBot )
    {
        if ( !
pSurvivorBot->SurvivorBot.m_humanSpectatorUserID
          
|| (v22 CDirector::IsHumanSpectatorValid(pDirectorpSurvivorBot), result 0, !v22) )
        {
            
CDirector::NewPlayerPossessBot(a1a2v16pDirectorpPlayerpSurvivorBot_);
            
result 1;
        }
    } 

signed*int*__cdecl*CDirector::IsHumanSpectatorValid(CDirector**this,*SurvivorBot**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",*v5,*v4,*v3);
********
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;
}* 
sorallll is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-22-2022 , 18:25   Re: [L4D2]About m_humanSpectatorUserID and the multiplayer plugin
Reply With Quote #5

Quote:
Originally Posted by sorallll View Post
But the player in the transition corresponding to the Bot is detected as true IsClientConnected and IsClientInGame detected as false, which will cause the Bot of some transition players to be taken over by others
This is by design, because when map ends all players are disconnected and connected again.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas 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 18:54.


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