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

Send client hello; support non-authed service methods #1126

Merged
merged 3 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Resources/SteamLanguage/emsg.steamd
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ enum EMsg
UpdateScheduledTaskEnableState_TEST = 244;
UpdateScheduledTaskEnableStateResponse_TEST = 245;
ContentDescriptionDeltaUpdate = 246;
GMShellAndServerAddressUpdates = 247;

BaseGM = 300;
Heartbeat = 300;
Expand Down Expand Up @@ -100,6 +101,7 @@ enum EMsg
GMTestNextBuildSchemaConversionResponse = 335;
ExpectShellRestart = 336;
HotFixProgress = 337;
GMStatsForwardToAdminConnections = 338;

BaseAIS = 400;
AISRefreshContentDescription = 401; removed
Expand Down Expand Up @@ -705,6 +707,12 @@ enum EMsg
GCHAccountPhoneNumberChange = 2236;
GCHAccountTwoFactorChange = 2237;
GCHInviteUserToLobby = 2238;
GCHUpdateMultipleSessions = 2239;
GCHMarkAppSessionsAuthoritative = 2240;
GCHRecurringSubscriptionStatusChange = 2241;
GCHAppCheersReceived = 2242;
GCHAppCheersGetAllowedTypes = 2243;
GCHAppCheersGetAllowedTypesResponse = 2244;

BaseP2P = 2500;
P2PIntroducerMessage = 2502;
Expand Down Expand Up @@ -1222,6 +1230,8 @@ enum EMsg
AMRequestPersonaUpdateForChatServer = 4420;
AMPerfectWorldPayment = 4421;
AMPerfectWorldPaymentResponse = 4422;
AMECommPayPayment = 4423;
AMECommPayPaymentResponse = 4424;

BasePSRange = 5000;
PSCreateShoppingCart = 5001;
Expand Down Expand Up @@ -1987,6 +1997,8 @@ enum EMsg
ClientVoiceCallPreAuthorizeResponse = 9801;
ClientServerTimestampRequest = 9802;
ClientServerTimestampResponse = 9803;
ServiceMethodCallFromClientNonAuthed = 9804;
ClientHello = 9805;

ClientLANP2PBase = 9900;
ClientLANP2PRequestChunk = 9900;
Expand Down
12 changes: 12 additions & 0 deletions SteamKit2/SteamKit2/Base/Generated/SteamLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public enum EMsg
UpdateScheduledTaskEnableState_TEST = 244,
UpdateScheduledTaskEnableStateResponse_TEST = 245,
ContentDescriptionDeltaUpdate = 246,
GMShellAndServerAddressUpdates = 247,
BaseGM = 300,
Heartbeat = 300,
ShellFailed = 301,
Expand Down Expand Up @@ -100,6 +101,7 @@ public enum EMsg
GMTestNextBuildSchemaConversionResponse = 335,
ExpectShellRestart = 336,
HotFixProgress = 337,
GMStatsForwardToAdminConnections = 338,
BaseAIS = 400,
AISRequestContentDescription = 402,
AISUpdateAppInfo = 403,
Expand Down Expand Up @@ -601,6 +603,12 @@ public enum EMsg
GCHAccountPhoneNumberChange = 2236,
GCHAccountTwoFactorChange = 2237,
GCHInviteUserToLobby = 2238,
GCHUpdateMultipleSessions = 2239,
GCHMarkAppSessionsAuthoritative = 2240,
GCHRecurringSubscriptionStatusChange = 2241,
GCHAppCheersReceived = 2242,
GCHAppCheersGetAllowedTypes = 2243,
GCHAppCheersGetAllowedTypesResponse = 2244,
BaseP2P = 2500,
P2PIntroducerMessage = 2502,
BaseSM = 2900,
Expand Down Expand Up @@ -1075,6 +1083,8 @@ public enum EMsg
AMRequestPersonaUpdateForChatServer = 4420,
AMPerfectWorldPayment = 4421,
AMPerfectWorldPaymentResponse = 4422,
AMECommPayPayment = 4423,
AMECommPayPaymentResponse = 4424,
BasePSRange = 5000,
PSCreateShoppingCart = 5001,
PSCreateShoppingCartResponse = 5002,
Expand Down Expand Up @@ -1727,6 +1737,8 @@ public enum EMsg
ClientVoiceCallPreAuthorizeResponse = 9801,
ClientServerTimestampRequest = 9802,
ClientServerTimestampResponse = 9803,
ServiceMethodCallFromClientNonAuthed = 9804,
ClientHello = 9805,
ClientLANP2PBase = 9900,
ClientLANP2PRequestChunk = 9900,
ClientLANP2PRequestChunkResponse = 9901,
Expand Down
4 changes: 4 additions & 0 deletions SteamKit2/SteamKit2/Steam/CMClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ protected virtual bool OnClientMsgReceived( [NotNullWhen( true )] IPacketMsg? pa
/// </summary>
protected virtual void OnClientConnected()
{
var request = new ClientMsgProtobuf<CMsgClientHello>( EMsg.ClientHello );
request.Body.protocol_version = MsgClientLogon.CurrentProtocol;

Send( request );
}
/// <summary>
/// Called when the client is physically disconnected from Steam3.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public AsyncJob<ServiceMethodResponse> SendMessage<TRequest>( string name, TRequ
throw new ArgumentNullException( nameof( message ) );
}

var msg = new ClientMsgProtobuf<TRequest>( EMsg.ServiceMethodCallFromClient );
var eMsg = Client.SteamID == null ? EMsg.ServiceMethodCallFromClientNonAuthed : EMsg.ServiceMethodCallFromClient;
var msg = new ClientMsgProtobuf<TRequest>( eMsg );
msg.SourceJobID = Client.GetNextJobID();
msg.Header.Proto.target_job_name = name;
msg.Body = message;
Expand All @@ -194,7 +195,8 @@ public void SendNotification<TRequest>( string name, TRequest message )

// Notifications do not set source jobid, otherwise Steam server will actively reject this message
// if the method being used is a "Notification"
var msg = new ClientMsgProtobuf<TRequest>( EMsg.ServiceMethodCallFromClient );
var eMsg = Client.SteamID == null ? EMsg.ServiceMethodCallFromClientNonAuthed : EMsg.ServiceMethodCallFromClient;
var msg = new ClientMsgProtobuf<TRequest>( eMsg );
msg.Header.Proto.target_job_name = name;
msg.Body = message;
Client.Send( msg );
Expand Down