Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[L4D2] Server crash on linux #23

Open
A1mDev opened this issue Nov 12, 2022 · 0 comments
Open

[L4D2] Server crash on linux #23

A1mDev opened this issue Nov 12, 2022 · 0 comments

Comments

@A1mDev
Copy link
Contributor

A1mDev commented Nov 12, 2022

The server on linux crashes, in the 'CGameClient::WriteViewAngleUpdate' function, in this place, because the 'm_NetChannel' property is zero. This happens after some plugin executes the 'PrintToConsole' code and prints the text to the client console, then the sourcehook from the sourcetvmanager works and it clears the pointer and it only happens in this place (OnCGameClient_ClientPrintf_Post). In the specified place, very often the function works not for sourcetv, a simple check 'IsHLTV()' prevents crash, but this is wrong because this sourcehook then stops working for SourceTV. Example:

void HLTVServerWrapper::OnIClient_ClientPrintf_Post(const char* buf)
{
	IClient *pClient = META_IFACEPTR(IClient);
	if (!pClient->IsHLTV()) {
		RETURN_META(MRES_IGNORED);
	}

	HandleClientPrintf(pClient, buf);

	// We already called the function in HandleClientPrintf.
	// Would crash or not do anything anyways.
	RETURN_META(MRES_SUPERCEDE);
}

I also made additional condition 'IsHLTV' here and here. This code has always worked for SourceTV, although I'm not sure if this piece of code works at all, because the logs were written only at the moment when this code worked not for SourceTV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant