View Single Post
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-28-2016 , 08:43   Re: SourceTV Manager
Reply With Quote #18

Quote:
Originally Posted by TinKode View Post
Just wanted to know if is possible to use this in L4D2 as it is not fully implemented.
If L4D2 supports SourceTV, it's certainly possible to add support for it in this extension. I just don't play L4D*, so I won't test much

try adding this to the gamedata file
Code:
"l4d2"
    {
        "Addresses"
        {
            "host_client"
            {
                "windows"
                {
                    "signature"    "host_client"
                    "read" "32"
                }
                "linux"
                {
                    "signature" "host_client"
                }
            }
            
            "CHLTVServer::m_DemoRecorder"
            {
                "windows"
                {
                    "signature"    "CHLTVServer::Shutdown"
                    "read"    "5"
                }
                "linux"
                {
                    "signature"    "CHLTVServer::Shutdown"
                    "read"    "12"
                }
            }
        }
        "Offsets"
        {
            "CNetChan::SendNetMsg"
            {
                "windows"    "41"
                "linux"    "42"
            }
            
            "CBaseClient::m_NetChannel"
            {
                "windows"    "180"
                "linux"    "184"
            }
            
            "CGameClient::ClientPrintf"
            {
                "linux"    "31"
            }
            
            "CBaseServer::BroadcastPrintf"
            {
                "windows"    "36"
                "linux"        "37"
            }
            
            "CHLTVServer::ConnectClient"
            {
                "windows"    "50"
                "linux"    "51"
            }
            
            "CHLTVServer::RejectConnection"
            {
                "windows"    "48"
                "linux"    "49"
            }
            
            "CHLTVServer::GetChallengeType"
            {
                "windows"    "54"
                "linux"    "55"
            }
            
            "CBaseClient::ActivatePlayer"
            {
                "windows"    "15"
                "linux"    "61"
            }
            
            "CBaseClient::Disconnect"
            {
                "linux"    "15"
            }
            
            "CHLTVServer::Shutdown"
            {
                "windows"    "42"
                "linux"    "43"
            }
            
            "CHLTVDirector::m_iPVSEntity"
            {
                "windows"    "16"
                "linux"    "16"
            }
            
            "CHLTVDirector::m_vPVSOrigin"
            {
                "windows"    "20"
                "linux"    "20"
            }
            
            "CHLTVDirector::m_nNextShotTick"
            {
                "windows"    "40"
                "linux"    "40"
            }
        }
        "Signatures"
        {
            "host_client"
            {
                "library"    "engine"
                "linux"    "@host_client"
                // ping(CCommand const&) "Client ping times:\n"
                "windows" "\x55\x8B\xEC\x51\x83\x3D\x2A\x2A\x2A\x2A\x01\x75\x2A"
            }
            
            "CHLTVServer::BroadcastEventLocal"
            {
                "library"    "engine"
                "linux"    "@_ZN11CHLTVServer19BroadcastEventLocalEP10IGameEventb"
                // "SourceTV broadcast local event: %s\n"
                "windows"    "\x55\x8B\xEC\x81\xEC\x58\x04\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x8B\x45\x10\x8B"
            }
            
            "CHLTVServer::Shutdown"
            {
                "library"    "engine"
                "linux"    "@_ZN11CHLTVServer8ShutdownEv"
                // "SourceTV stop."
                "windows"    "\x56\x8B\xF1\x8B\x86\x2A\x2A\x2A\x2A\x8B\x50\x2A\x8D\x8E\x2A\x2A\x2A\x2A\xFF\xD2\x8B\x86\x2A\x2A\x2A\x2A\x8B\x50"
            }
            
            // StartRecording and StopRecording are virtual, but get called directly in the linux binary..
            // Need to add a detour.
            "CHLTVDemoRecorder::StartRecording"
            {
                "library"    "engine"
                "linux"    "@_ZN17CHLTVDemoRecorder14StartRecordingEPKcb"
            }
            
            "CHLTVDemoRecorder::StopRecording"
            {
                "library"    "engine"
                "linux"    "@_ZN17CHLTVDemoRecorder13StopRecordingEv"
            }
        }
    }
Edit: Here's a windows binary too
Attached Files
File Type: dll sourcetvmanager.ext.2.l4d2.dll (777.0 KB, 357 views)
__________________

Last edited by Peace-Maker; 07-28-2016 at 09:34. Reason: Add l4d2 binary
Peace-Maker is offline