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

What's my mistake? #5

Open
ghost opened this issue Mar 25, 2019 · 4 comments
Open

What's my mistake? #5

ghost opened this issue Mar 25, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 25, 2019

I want the bot to go online. Saw similar code in many examples. But it does not work. What am I missing? Thank.

`void TestClient::OnLoggedOnManual(SteamServersConnected_t* cbMsg)
{
printf("TestClient::OnLoggedOnManual Logged in\n");

EPersonaState state = m_pClientFriends->GetPersonaState();
    if (state != k_EPersonaStateOnline)
    {
   m_pClientFriends->SetPersonaState(k_EPersonaStateOnline);
   printf("Online\n");
   }

}`

@m4dEngi
Copy link
Owner

m4dEngi commented Mar 25, 2019

IClientFriends doesn't work as intended since steam chat ui update. Since chat update IClientSharedConnection interface is used to interact with steam friends. At this point you'll probably want to use SteamKit2 unless you plan to make custom steam ui.

@ghost
Copy link
Author

ghost commented Mar 29, 2019

Thanks for the tip. It is ugly, but it works.
`unsigned char msg[] =
{

		0xcc ,0x02 ,0x00 ,0x80 ,0x0f ,0x00 ,0x00 ,0x00,
		0x09 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,	0x00 ,
		0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x01 ,0x08 ,0x01 ,0x28 ,0x00 ,0x38 ,0x01 ,0x40, 0x00

	};
	*(uint64*)(msg +9) = m_pSteamUser->GetSteamID().ConvertToUint64();
	m_pClentShared->SendMessage(m_hShared, msg, sizeof(msg));
		printf("send 716\n");`

@SeRi0uS007
Copy link

@velvey
Thanks. It works!
Can you tell me how you found the necessary values?)

@m4dEngi
Copy link
Owner

m4dEngi commented Jan 31, 2020

You can get necessary values using client protobuf dumps from steamdb or steamkit projects.

Those values (predefined array in @velvey 's code) are regular client protobuf messages that will be sent through client shared connection wrapped in steam unified request. They will appear as client service method calls in nethook dumps.

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

2 participants