Пример #1
0
	bool BaseServer::StartServer()
	{
		if (m_pNetWork == NULL)
			return false;
		if (!m_pNetWork->StartServer())
			return false;

		m_bIsStop = false;

		m_MainThread.Run((DWORD)GET_MEMBER_CALLBACK(BaseServer, _MainProc), (DWORD)this, (DWORD)NULL);
		return true;
	}
//---------------------------------------------------------------------------------
// Purpose: Init stuff for plugin load
//---------------------------------------------------------------------------------
void ManiReservedSlot::Load(void)
{
	m_iUnaccountedPlayers = 0;

	if (!connect_client_addr || !netsendpacket_addr) return; // something is wrong with the sigscan

	ManiClientConnectDetour = CDetourManager::CreateDetour( "ConnectClient", connect_client_addr, GET_MEMBER_CALLBACK(ConnectClientDetour), GET_MEMBER_TRAMPOLINE(ConnectClientDetour));
	if ( ManiClientConnectDetour )
		ManiClientConnectDetour->DetourFunction( );

	ASSIGN_ORIGINAL(NET_SendPacketDetour, netsendpacket_addr);

	ManiNetSendPacketDetour = CDetourManager::CreateDetour( "NETSendPacket", netsendpacket_addr, GET_NON_MEMBER_CALLBACK(NET_SendPacketDetour), GET_NON_MEMBER_TRAMPOLINE(NET_SendPacketDetour) );
	if ( ManiNetSendPacketDetour )
		ManiNetSendPacketDetour->DetourFunction( );

	this->CleanUp();
}
Пример #3
0
#if 0
	DETOUR_DECL_MEMBER(void, CRConClient_SendCmd, const char *cmd)
	{
		DevMsg("CRConClient::SendCmd detour!\n");
		DevMsg("  this = %08x\n", (uintptr_t)this);
		DevMsg("  cmd  = \"%s\"\n", cmd);
		
		DETOUR_MEMBER_CALL(CRConClient_SendCmd)(cmd);
	}
	
	
	CDetour *detour;
	CON_COMMAND(sig_util_vprof_remote_test1, "")
	{
		detour = new CDetour("CRConClient::SendCmd",
			GET_MEMBER_CALLBACK(CRConClient_SendCmd),
			GET_MEMBER_INNERPTR(CRConClient_SendCmd));
		
		detour->Load();
		detour->Enable();
		
		DevMsg("test1: detour created\n");
		
		engineclient->ExecuteClientCmd("rcon helloworld");
		engineclient->ExecuteClientCmd("rcon");
		
		DevMsg("test1: commands executed\n");
	}
	
	CON_COMMAND(sig_util_vprof_remote_test2, "")
	{