Closed Rosentti closed 1 year ago
IIRC you don't get callbacks for SharedConnections on incoming messages. You have to poll after allocating it. I haven't investigated the new login process yet.
Maybe I need to use SharedConnection->InitiateConnection. But that doesn't seem to change anything.
How can I get a response out? Currently after getting a response I'm notified by callback, however using BPopReceivedMessage crashes. I guess this is because it needs a CUtlBuffer passed in. But how can I create one?
Figured it out, you need to create and allocate a CUtlBuf yourself.
@20PercentRendered Can you show an example of using a shared connection and creating a CUtlBuf ? Thank you.
I'm not currently on my PC, will share an example when I get home. However I used MiniUTL by FWGS and constructed a CUtlBuffer set with an initial allocation and growsize of 1.
@promo55 https://github.com/20PercentRendered/opensteamclient/blob/master/src/client/messaging/protomsg.hpp This class uses SharedConnection quite extensively. Note that you need to send protobuf or the other format. And be careful with endianness.
@promo55 @20PercentRendered Gentlemen, please tell a newbie what I'm doing wrong:
`IClientEngine clEngine = (IClientEngine)SteamInternal_CreateInterface(CLIENTENGINE_INTERFACE_VERSION);
HSteamPipe hSteamPipe = clEngine->CreateSteamPipe();
HSteamUser` hSteamUser = clEngine->CreateGlobalUser(&hSteamPipe);
IClientSharedConnection* shrConnection = clEngine->GetIClientSharedConnection(hSteamUser, hSteamPipe);
IClientUser* clUser = clEngine->GetIClientUser(hSteamUser, hSteamPipe);
clUser->EConnect();
HSharedConnection hcon = shrConnection->AllocateSharedConnection();
cout<<"say hello"<<endl;
vector
test{0x4d,0x26,0x00,0x80,0x0e,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80,0x02,0x01,0x08,0xac,0x80,0x04 }; shrConnection->SendMessage(hcon, test.data(), test.size());
cout<<"succes"<<endl;
while(true){
//do nothing
}`
I'm trying to send a test message using the interface sharedconnection, but my application just closes on the moment it's sent, without any error. The message is not sent and I don't see "success".
If you are trying to login then:
thanks, but I saw it in @20PercentRendered code. i want to use sharedconnection for many things, it is important for me to understand how it works
Your IClient classes and IClientEngine might be outdated. If you use my headers, you should also use the specific steamclient library version. Your message might also have an invalid header or emsg. I strongly recommend using the protobuf library.
I am using the latest version of steamclient. I tried both your(@20PercentRendered ) and @m4dEngi versions of the interfaces, but there is no difference, I came to a dead end.
Logging in using SetLoginInformation and SetTwoFactorCode followed with the LogIn call works fine, but it doesn't save the password. I'm assuming since the client log says "Using JWT" with the official client and "Using credential pair" with my client, it doesn't send the required protobufs itself, and I can't send them through SharedConnection. Am I missing something?
How I'm doing it right now:
https://steamcommunity.com/login/getrsakey?username=
CAuthentication_BeginAuthSessionViaCredentials_Request
ClientUser->EConnect()
SendMessageAndAwaitResponse
How can I use SharedConnection successfully? And is it possible to get the response data?