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

MP Fail to Work #43

Closed
derric-young opened this issue Feb 19, 2023 · 9 comments · May be fixed by #46
Closed

MP Fail to Work #43

derric-young opened this issue Feb 19, 2023 · 9 comments · May be fixed by #46
Assignees
Labels
bug Something isn't working

Comments

@derric-young
Copy link

Expected Behavior

Work like How Singleplayer Builds. why does MP not?

Steps to Reproduce

After Building on any Ordernary Setup. set it up in a source mod and there. error

Detailed Description

assert error line 618.

Operating System

Windows

@derric-young derric-young added the bug Something isn't working label Feb 19, 2023
@Nbc66
Copy link
Owner

Nbc66 commented Feb 21, 2023

these are mainly issues if you compile in debug and run the game without a debugger attached to the hl2.exe

if you could provide a crash dump or the location of the crash like in which file the assert happened i can check it out

@Derailedzack
Copy link

Derailedzack commented Jun 4, 2023

From tier1\utlbuffer.cpp

//-----------------------------------------------------------------------------
// Reads a null-terminated string
//-----------------------------------------------------------------------------
void CUtlBuffer::GetStringInternal( char *pString, size_t maxLenInChars )
{
	if ( !IsValid() )
	{
		*pString = 0;
		return;
	}

	Assert( maxLenInChars != 0 ); //This is where the client crashes

	if ( maxLenInChars == 0 )
	{
		return;
	}

	// Remember, this *includes* the null character
	// It will be 0, however, if the buffer is empty.
	int nLen = PeekStringLength();

	if ( IsText() )
	{
		EatWhiteSpace();
	}

	if ( nLen <= 0 )
	{
		*pString = 0;
		m_Error |= GET_OVERFLOW;
		return;
	}

	const size_t nCharsToRead = min( (size_t)nLen, maxLenInChars ) - 1;

	Get( pString, nCharsToRead );
	pString[nCharsToRead] = 0;

	if ( (size_t)nLen > (nCharsToRead + 1) )
	{
		SeekGet( SEEK_CURRENT, nLen - (nCharsToRead + 1) );
	}

	// Read the terminating NULL in binary formats
	if ( !IsText() )
	{
		VerifyEquals( GetChar(), 0 );
	}
}

@Derailedzack
Copy link

Derailedzack commented Jun 4, 2023

If you want I can include a screenshot of the crash in a debugger.

@derric-young
Copy link
Author

derric-young commented Jun 4, 2023 via email

@Derailedzack
Copy link

windbg_nD0wXFUVER
windbg_UKVlPvDV8p

@Derailedzack
Copy link

Removing the assert only seems to mess up the text on the title screen

@derric-young
Copy link
Author

derric-young commented Jun 4, 2023 via email

@Derailedzack
Copy link

Derailedzack commented Jun 4, 2023

Why does this function do a not null check? This assert is unnecessary the function already checks if the string is invalid or has a char count of 0. Removing the assert shouldn't break anything

@Derailedzack
Copy link

CUtlBuffer::GetStringInternal is only in the mp source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants