Skip to content

Conversation

ThisIsKashakov
Copy link
Contributor

For some reason, when I tried to call the VoiceData:GetUncompressedData function in the HolyLib:PreProcessVoiceChat hook, I get the error: Failed to get SteamUser!. I don't know for what reason SteamUser() returns a null pointer, but this is the only solution I could find to fix this error.

@RaphaelIT7
Copy link
Owner

RaphaelIT7 commented Oct 11, 2024

I would move the init code to the module's init function as stuff is mean to be initialized there.
Since that module doesn't have one you would have to add it.

	// Add it as a class member at the beginning.
	virtual void LuaInit(bool bServerInit) OVERRIDE;
	virtual void Shutdown() OVERRIDE;
void CVoiceChatModule::Init(CreateInterfaceFn* appfn, CreateInterfaceFn* gamefn)
{
	// Move the Init code into here
}

void CVoiceChatModule::Shutdown()
{
	// Set the pointer to null
}

Btw thanks for the PR <3
(Just noticed that the workflow doesn't like PR's.... just ignore it for now, I'll look into that tomorrow xd)

@RaphaelIT7 RaphaelIT7 self-assigned this Oct 11, 2024
@ThisIsKashakov
Copy link
Contributor Author

I tried to initialize SteamUser in the CVoiceChatModule::Init function by calling CreateLocalUser, but it ended up with my scrds crashing. So I decided that the best solution was to create a new local anonymous steam user and initialize SteamUser in the hook_CSteam3Server_OnLogonSuccess function hook in the steamworks module and globally declare an empty pointer to ISteamUser in util.h. I hope that this solution will be better than the last one, although it requires the steamworks module to be enabled :)

@RaphaelIT7 RaphaelIT7 merged commit 259000a into RaphaelIT7:main Oct 13, 2024
9 of 12 checks passed
@RaphaelIT7 RaphaelIT7 added the bug Something isn't working label Jul 25, 2025
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 this pull request may close these issues.

2 participants